diff --git a/lib/Baal/.env.sample b/lib/Baal/.env.sample new file mode 100644 index 0000000..0bc6fd3 --- /dev/null +++ b/lib/Baal/.env.sample @@ -0,0 +1,11 @@ +MNEMONIC= +ACCOUNT_PK= +INFURA_API_KEY= +ETHERSCAN_API_KEY= +GNOSISSCAN_API_KEY= +POLYGONSCAN_API-KEY= +OPTIMISTICSCAN_API_KEY= +ARBISCAN_API_KEY= +BASESCAN_API_KEY= +REPORT_GAS=false +COINMARKETCAP_API_KEY= \ No newline at end of file diff --git a/lib/Baal/.gitattributes b/lib/Baal/.gitattributes new file mode 100644 index 0000000..52031de --- /dev/null +++ b/lib/Baal/.gitattributes @@ -0,0 +1 @@ +*.sol linguist-language=Solidity diff --git a/lib/Baal/.github/workflows/publish.yml b/lib/Baal/.github/workflows/publish.yml new file mode 100644 index 0000000..05eb65c --- /dev/null +++ b/lib/Baal/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish + +on: + push: + branches: + - feat/baalZodiac +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.x + registry-url: https://registry.npmjs.org/ + - run: yarn global add npm + - name: Check package version + id: cpv + uses: PostHog/check-package-version@v2 + - name: Echo package vs published versions + run: | + echo "Committed version: ${{ steps.cpv.outputs.committed-version }}" + echo "Published version: ${{ steps.cpv.outputs.published-version }}" + echo "Is new version: ${{ steps.cpv.outputs.is-new-version }}" + - run: yarn install + if: steps.cpv.outputs.is-new-version == 'true' + - run: yarn build + if: steps.cpv.outputs.is-new-version == 'true' + - run: yarn test + if: steps.cpv.outputs.is-new-version == 'true' + - name: publishing + if: steps.cpv.outputs.is-new-version == 'true' + run: | + echo '//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}' > .npmrc + npm publish --access public --scope daohaus --otp ${{ secrets.NPM_TOKEN }} diff --git a/lib/Baal/.gitignore b/lib/Baal/.gitignore new file mode 100644 index 0000000..44a73fe --- /dev/null +++ b/lib/Baal/.gitignore @@ -0,0 +1,20 @@ +node_modules/ +artifacts/ +cache/ +.DS_Store +*.swp +*.txt +yarn-error.log + +dist/ +src/types/ +abi/ +export/ +.openzeppelin/ + +.env +.env.production +.env.staging + +coverage.json +coverage/ \ No newline at end of file diff --git a/lib/Baal/.npmignore b/lib/Baal/.npmignore new file mode 100644 index 0000000..b8f71d1 --- /dev/null +++ b/lib/Baal/.npmignore @@ -0,0 +1,4 @@ +* +!dist/** +!package.json +!README.md diff --git a/lib/Baal/.vscode/settings.json b/lib/Baal/.vscode/settings.json new file mode 100644 index 0000000..9936f68 --- /dev/null +++ b/lib/Baal/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "solidity.defaultCompiler": "localNodeModule", + "solidity.compileUsingRemoteVersion": "v0.8.7+commit.e28d00a7", + "solidity.enableLocalNodeCompiler": false + +} diff --git a/lib/Baal/LICENSE b/lib/Baal/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/lib/Baal/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/Baal/README.md b/lib/Baal/README.md new file mode 100644 index 0000000..cec3b16 --- /dev/null +++ b/lib/Baal/README.md @@ -0,0 +1,248 @@ +# Baal 👺 + +Baal (Molochv3) is a minimal yet composable DAO template continuing work from the +Moloch, Minion, Compound/OZ and Safe frameworks to make it easier for people to +combine and command crypto assets with intuitive membership games. + +*Guilds, venture clubs and control panels can benefit from Baal:* + +

+ +## Setup + +If you are going to just use this project feel free to clone it. If you would like to submit any pull requests please create an issue or work on a current issue and fork the repo. The main groups that are contributing to this project are [Moloch Mystics](https://github.com/Moloch-Mystics/Baal), [DaoHaus](https://discord.com/channels/709210493549674598) [MetaCartel](https://discord.com/channels/702325961433284609). + +### Setup Environment + +`yarn install` - to install all of the components for the project + +`.env.sample` containes the all required environment variables that need to be set to build, deploy & publish the smart contracts on the blockchain. These should be added to a `.env[.*]` file. + +### Building + +This project uses the [hardhat](https://hardhat.org/) ethereum tools for solidity compiling and running a virtual ethereum environment for testing. + +`yarn build` - will compile the solidity code and generate your contract artifacts (in the /artifacts directory), and generate all of the necessary types. + +### Testing + +If you are looking to work on unit tests for this project be sure to read the README file in the test directory. + +`yarn hardhat test` - run the unit tests + +## Publishing + +the Baal contracts, types, and abis are published through the CI process, after making changes to the repo, and when you are ready to publish the packages, do the following: + +1) bump the version in `package.json` +2) push and merge into `feat/baalZodiac` branch + +running the CI process will trigger on `merges to feat/baalZodiac branch` build the dist folder and publish it to `@daohaus/baal-contracts` package to npm if the package.json version is different than the current latest on npm. + +---- +## Folder Structure +- ./abi - generated abis +- ./contracts - main solidity contracts, interfaces, tools and utils +- ./deploy - deploy scripts and helpers) +- ./scripts - deploy scripts and helpers (**soon to be deprecated**) +- ./tasks - hard hat cli tasks +- ./tests - test files + +---- + +## Coverage + +currently, coverage is turned off for test efficiency purposes. In order to switch coverage on, add `yul` to the hardhat config: + +``` +{ + ... + compilers: [ + { + version: "0.8.7", + settings: { + optimizer: { + enabled: true, + runs: 200, + details: { + yul: true + } + }, + }, + } + ] +} +``` + +then run the coverage command: + +``` +npx hardhat coverage +``` +---- +## Verify Contracts + +Run the following command: + +``` +yarn hardhat etherscan-verify +``` + +---- +## Importing the package on your own project + +You can `yarn add @daohaus/baal-contracts` on your own project and get access to Baal smart contracts, ABIs & deployment scripts for local testing your contract integrations: + +* *Smart contracts*: you can import Baal smart contract on your Hardhat /Foundry / Truffle project at `@daohaus/baal-contracts/contracts/*` +* *ABIs*: if your custom frontend needs to interact with Baal contracts, you can find contract ABIs at `@daohaus/baal-contracts/abi/*` +* *Local testing*: if you're using [hardhat-deploy](https://www.npmjs.com/package/hardhat-deploy), you can reuse our scripts to deploy all Baal + infrastructure contracts locally to perform integration testing with your implementation. You just need to follow these steps: + + 1. Add these lines on your `hardhat.config.ts` config file to allow `hardhat-deploy` to find Baal artifacts & deployment scripts: + ``` + ... + external: { + contracts: [ + { + artifacts: 'node_modules/@daohaus/baal-contracts/export/artifacts', + deploy: 'node_modules/@daohaus/baal-contracts/export/deploy' + } + ] + }, + ... + ``` + + 2. On your test scripts, you can call `await deployments.fixture([tag1, tag2, ...])` (e.g. under `beforeEach()`) and specify the deployment tags you need. For example, `await deployments.fixture(['Infra', 'BaalSummoner'])` will deploy both Safe & Baal contracts. + + + 3. You can also use the [`baalSetup`](test/utils/fixtures.ts) fixture to setup your tests with factory contracts, baal settings, members, loot/shares/token distributions, etc. Moreover, you can also customize it to cover new use cases such as custom summoner contracts, shamans and other setup needs by implementing the`setupBaalOverride` and/or `setupUsersOverride` fixture function parameters. You can take a look at a few example implementations of ([baalSetup](test/utils/baal.ts) and [setupUsersDefault](test/utils/fixtures.ts)) for inspiration. You can find and import all the available scripts/fixtures available for hardhat testing as follows: + + ```js + import { baalSetup, ... } from "@daohaus/baal-contracts/hardhat"; + ``` + + Below, there's the list of parameters can be customized when calling the hardhat fixture: + + ```js + type BaalSetupOpts = { + fixtureTags?: Array; // additional deployment tags + daoSettings?: Partial; + summonSetupOpts?: Partial; + safeAddress?: `0x${string}`; + forwarderAddress?: `0x${string}`; + lootAddress?: `0x${string}`; + sharesAddress?: `0x${string}`; + setupBaalOverride?: (params: NewBaalParams) => Promise; + setupUsersOverride?: (params: SetupUsersParams) => Promise; + } + ``` + +To learn more about using `fixtures` on hardhat visit [link1](https://github.com/wighawag/hardhat-deploy#creating-fixtures) and [link2](https://www.npmjs.com/package/hardhat-deploy#testing-deployed-contracts). It is also recommended to check out the [Baal shamans](https://github.com/HausDAO/baal-shamans) repository for examples. + +---- +## Contracts + +### **Baal (contracts/Baal.sol)** + +It is a minimal yet composable DAO template continuing work from +the Moloch, Minion and Compound frameworks to make it easier for +people to combine and command crypto assets with intuitive membership +games. + +#### Interfaces + +* EIP721 +* OZ Minimal Clone Factoy [EIP 1167 Clones](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Clones) +Gnosis Safe Module [Zodiac](https://github.com/gnosis/zodiac) + +### **Shares (contracts/SharesERC20.sol)** + +Have direct execution, voting, and exit rights around actions +taken by the main DAO contract. Shareholders are the collective DAO +admins. + +#### Interfaces + +* ERC20, Initializable [OpenZeplin v4](https://docs.openzeppelin.com/contracts/4.x/) + + +### **BaalVotes (contracts/utils/BaalVotes.sol)** + +Abstract with a similar Implimentation of ERC20VOTES with the main +difference being auto self-delegation and the use of timestmap instead of block.number. + +#### Interfaces + +* ERC20Permit + +### **Loot (contracts/LootERC20.sol)** + +Has only exit rights against the DAO treasury, so loot does +not have the ability to admin the DAO config. However, because it has +exit rights, it is still a powerful unit, and because it is an ERC-20 +can be used in many composable ways. + +#### Interfaces + +* ERC20, ERC20Snapshot, ERC20Permit, Initializable [OpenZeplin v4](https://docs.openzeppelin.com/contracts/4.x/) + +### **TributeMinion (contracts/tools/TributeMinion.sol)** + +It is a helper contract for making tribute proposals. +Provides contract to approve ERC-20 transfers. Provides a simple +function/interface to make a single proposal type. + +### **BaalSummoner (contracts/BaalSummoner.sol)** + +Factory to summon new dao contracts. +It can take an existing safe or exsiting tokens + +### **Higher Order BaalAndVaultSummoner (contracts/higherOrderFactories/BaalAndVaultSummoner.sol)** + +Factory to summon new dao contracts with an extra 'sidecar' non-ragequitable vault. +A registry is used to save safe addresses for use in UI. +It can also add a external safe to an existing DAO as owner + +### **Higher Order BaalAdvTokenSummoner (contracts/higherOrderFactories/BaalAdvTokenSummoner.sol)** + +Factory to summon new dao contracts with custom loot token name and symbol +Minting and pausing of token happen upfront before Baal is setup + +---- + +## Privileged roles + +- Shamans - are specific addresses that have more granular control +outside the standard governance proposal flow. These addresses should +always be contracts that have been explicitly given these rights +through the standard proposal flow or during initial DAO setup. +- Governor - can cancel a proposal, set Governance Config (change the +length of proposals, if there is a required quorum, etc.). +- Manager - can mint/burn shares/loot. +- Admin - can set Admin configuration and pause/unpause shares/loot. +- DAO - is always a super admin over its config and can vote to make +changes to its configuration at any time. + +## Risks + +- In case of Shaman keys leak, an attacker can get access to Baal +(admin) functionalities, burn, mint, give shaman roles etc. +Because of this Shamans are ment to be external contracts and not EOAs +but it is up to the DAO to enforce this. + +## More Documentation + +More docs for [Functions](https://baal-docs.vercel.app/functions) and [Events](https://baal-docs.vercel.app/events), [V3 updates](https://baal-docs.vercel.app/features/updates), patterns, stories and other superficial musings can be found at the [Docs Page here](https://baal-docs.vercel.app/) + +

+ +## initial audit +See audit notes in ./audits + +## Addresses Beta Factories and Templates + Would you like to deploy to another chain? Use scripts/deployFactories and scripts/deployTribute. Please reach out for more info on deploys + +see current deploys at: src/addresses/deployed.js + +## License + +[MIT]() diff --git a/lib/Baal/audits/Hacken-02082022.pdf b/lib/Baal/audits/Hacken-02082022.pdf new file mode 100644 index 0000000..b0a679f Binary files /dev/null and b/lib/Baal/audits/Hacken-02082022.pdf differ diff --git a/lib/Baal/audits/Quantstamp-10182022.pdf b/lib/Baal/audits/Quantstamp-10182022.pdf new file mode 100644 index 0000000..ec69b59 Binary files /dev/null and b/lib/Baal/audits/Quantstamp-10182022.pdf differ diff --git a/lib/Baal/contracts/Baal.sol b/lib/Baal/contracts/Baal.sol new file mode 100644 index 0000000..f802505 --- /dev/null +++ b/lib/Baal/contracts/Baal.sol @@ -0,0 +1,1058 @@ +// SPDX-License-Identifier: MIT +/* +███ ██ ██ █ +█ █ █ █ █ █ █ +█ ▀ ▄ █▄▄█ █▄▄█ █ +█ ▄▀ █ █ █ █ ███▄ +███ █ █ ▀ + █ █ + ▀ ▀*/ +pragma solidity ^0.8.7; + +import "@gnosis.pm/safe-contracts/contracts/base/Executor.sol"; +import "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol"; +import "@gnosis.pm/zodiac/contracts/core/Module.sol"; +import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol"; +import "@opengsn/contracts/src/BaseRelayRecipient.sol"; +import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; + +import "./interfaces/IBaalToken.sol"; + +/// @title Baal ';_;'. +/// @notice Flexible guild contract inspired by Moloch DAO framework. +contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient { + using ECDSAUpgradeable for bytes32; + + // ERC20 SHARES + LOOT + + IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/ + IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/ + + address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/ + + // GOVERNANCE PARAMS + uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/ + uint32 public gracePeriod; /*time delay after proposal voting period for processing*/ + uint32 public proposalCount; /*counter for total `proposals` submitted*/ + uint256 public proposalOffering; /* non-member proposal offering*/ + uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/ + uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/ + uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/ + + // SHAMAN PERMISSIONS + bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */ + bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */ + bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */ + mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/ + /* permissions registry for shamans + 0 = no permission + 1 = admin only + 2 = manager only + 4 = governance only + 3 = admin + manager + 5 = admin + governance + 6 = manager + governance + 7 = admin + manager + governance */ + + // PROPOSAL TRACKING + mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */ + mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/ + mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/ + + // MISCELLANEOUS PARAMS + uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */ + address public multisendLibrary; /*address of multisend library*/ + string public override versionRecipient; /* version recipient for OpenGSN */ + + // SIGNATURE HELPERS + bytes32 constant VOTE_TYPEHASH = keccak256("Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)"); + + // DATA STRUCTURES + struct Proposal { + /*Baal proposal details*/ + uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/ + uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */ + uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/ + uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/ + uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/ + uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */ + uint256 baalGas; /* gas needed to process proposal */ + uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/ + uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/ + uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/ + uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/ + bool[4] status; /* [cancelled, processed, passed, actionFailed] */ + address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */ + bytes32 proposalDataHash; /*hash of raw data associated with state updates*/ + } + + /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed + \-> Cancelled \-> Defeated */ + enum ProposalState { + Unborn, /* 0 - can submit */ + Submitted, /* 1 - can sponsor -> voting */ + Voting, /* 2 - can be cancelled, otherwise proceeds to grace */ + Cancelled, /* 3 - terminal state, counts as processed */ + Grace, /* 4 - proceeds to ready/defeated */ + Ready, /* 5 - can be processed */ + Processed, /* 6 - terminal state */ + Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */ + } + + // MODIFIERS + + modifier baalOnly() { + require(_msgSender() == avatar, "!baal"); + _; + } + + modifier baalOrAdminOnly() { + require(_msgSender() == avatar || isAdmin(_msgSender()), "!baal & !admin"); /*check `shaman` is admin*/ + _; + } + + modifier baalOrManagerOnly() { + require( + _msgSender() == avatar || isManager(_msgSender()), + "!baal & !manager" + ); /*check `shaman` is manager*/ + _; + } + + modifier baalOrGovernorOnly() { + require( + _msgSender() == avatar || isGovernor(_msgSender()), + "!baal & !governor" + ); /*check `shaman` is governor*/ + _; + } + + // EVENTS + event SetupComplete( + bool lootPaused, + bool sharesPaused, + uint32 gracePeriod, + uint32 votingPeriod, + uint256 proposalOffering, + uint256 quorumPercent, + uint256 sponsorThreshold, + uint256 minRetentionPercent, + string name, + string symbol, + uint256 totalShares, + uint256 totalLoot + ); /*emits after Baal summoning*/ + event SubmitProposal( + uint256 indexed proposal, + bytes32 indexed proposalDataHash, + uint256 votingPeriod, + bytes proposalData, + uint256 expiration, + uint256 baalGas, + bool selfSponsor, + uint256 timestamp, + string details + ); /*emits after proposal is submitted*/ + event SponsorProposal( + address indexed member, + uint256 indexed proposal, + uint256 indexed votingStarts + ); /*emits after member has sponsored proposal*/ + event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/ + event SubmitVote( + address indexed member, + uint256 balance, + uint256 indexed proposal, + bool indexed approved + ); /*emits after vote is submitted on proposal*/ + event ProcessProposal( + uint256 indexed proposal, + bool passed, + bool actionFailed + ); /*emits when proposal is processed & executed*/ + event Ragequit( + address indexed member, + address to, + uint256 indexed lootToBurn, + uint256 indexed sharesToBurn, + address[] tokens + ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/ + event Approval( + address indexed owner, + address indexed spender, + uint256 amount + ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/ + + event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/ + event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/ + event GovernanceConfigSet( + uint32 voting, + uint32 grace, + uint256 newOffering, + uint256 quorum, + uint256 sponsor, + uint256 minRetention + ); /*emits when gov config changes*/ + event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/ + event LootPaused(bool paused); /*emits when loot is paused or unpaused*/ + event LockAdmin(bool adminLock); /*emits when admin is locked*/ + event LockManager(bool managerLock); /*emits when admin is locked*/ + event LockGovernor(bool governorLock); /*emits when admin is locked*/ + + function encodeMultisend(bytes[] memory _calls, address _target) + external + pure + returns (bytes memory encodedMultisend) + { + bytes memory encodedActions; + for (uint256 i = 0; i < _calls.length; i++) { + encodedActions = abi.encodePacked( + encodedActions, + uint8(0), + _target, + uint256(0), + uint256(_calls[i].length), + bytes(_calls[i]) + ); + } + encodedMultisend = abi.encodeWithSignature( + "multiSend(bytes)", + encodedActions + ); + } + + constructor() { + _disableInitializers(); + } + + /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights. + /// @param _initializationParams Encoded setup information. + function setUp(bytes memory _initializationParams) + public + override(FactoryFriendly) + initializer + nonReentrant + { + ( + address _lootToken, /*loot ERC20 token*/ + address _sharesToken, /*shares ERC20 token*/ + address _multisendLibrary, /*address of multisend library*/ + address _avatar, /*Safe contract address*/ + address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/ + bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/ + ) = abi.decode( + _initializationParams, + (address, address, address, address, address, bytes) + ); + + require( + _multisendLibrary != address(0) && + _avatar != address(0), + "0 addr used" + ); + // no need to check _forwarder address exists, the default is address(0) for no forwarder + + versionRecipient = "2.2.5+opengsn.payablewithbaal.irelayrecipient"; + __Ownable_init(); + __ReentrancyGuard_init(); + __EIP712_init("Vote", "4"); + transferOwnership(_avatar); + + // Set the Gnosis safe address + avatar = _avatar; + target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/ + + // Set trusted forwarder + _setTrustedForwarder(_forwarder); + + lootToken = IBaalToken(_lootToken); + sharesToken = IBaalToken(_sharesToken); + + /*Set address of Gnosis multisend library to use for all execution*/ + multisendLibrary = _multisendLibrary; + + // Execute all setups including but not limited to + // * mint shares + // * convert shares to loot + // * set shamans + // * set admin configurations + require( + exec( + multisendLibrary, + 0, + _initializationMultisendData, + Enum.Operation.DelegateCall + ), + "call failure setup" + ); + + emit SetupComplete( + lootToken.paused(), + sharesToken.paused(), + gracePeriod, + votingPeriod, + proposalOffering, + quorumPercent, + sponsorThreshold, + minRetentionPercent, + sharesToken.name(), + sharesToken.symbol(), + totalShares(), + totalLoot() + ); + + } + + /***************** + PROPOSAL FUNCTIONS + *****************/ + /// @notice Submit proposal to Baal `members` for approval within given voting period. + /// @param proposalData Multisend encoded transactions or proposal data + /// @param details Context for proposal. + /// @return proposal Count for submitted proposal. + function submitProposal( + bytes calldata proposalData, + uint32 expiration, + uint256 baalGas, + string calldata details + ) external payable nonReentrant returns (uint256) { + require( + expiration == 0 || + expiration > block.timestamp + votingPeriod + gracePeriod, + "expired" + ); + require(baalGas <= 20000000, "baalGas to high"); /* gwei 2/3 eth block limit */ + + bool selfSponsor = false; /*plant sponsor flag*/ + if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) { + selfSponsor = true; /*if above sponsor threshold, self-sponsor*/ + } else { + require(msg.value == proposalOffering, "Baal requires an offering"); /*Optional anti-spam gas token tribute*/ + (bool _success, ) = target.call{value: msg.value}(""); /*Send ETH to sink*/ + require(_success, "could not send"); + } + + bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/ + + proposalCount++; /*increment proposal counter*/ + proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/ + proposalCount, + selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */ + selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */ + selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */ + selfSponsor + ? uint32(block.timestamp) + votingPeriod + gracePeriod + : 0, /* graceEnds */ + expiration, + baalGas, + 0, /* yes votes */ + 0, /* no votes */ + selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */ + selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */ + [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */ + selfSponsor ? _msgSender() : address(0), + proposalDataHash + ); + + if (selfSponsor) { + latestSponsoredProposalId = proposalCount; + } + + emit SubmitProposal( + proposalCount, + proposalDataHash, + votingPeriod, + proposalData, + expiration, + baalGas, + selfSponsor, + block.timestamp, + details + ); /*emit event reflecting proposal submission*/ + + return proposalCount; + } + + /// @notice Sponsor proposal to Baal `members` for approval within voting period. + /// @param id Number of proposal in `proposals` mapping to sponsor. + function sponsorProposal(uint32 id) external nonReentrant { + Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/ + + require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, "!sponsor"); /*check 'votes > threshold - required to sponsor proposal*/ + require(state(id) == ProposalState.Submitted, "!submitted"); + require( + prop.expiration == 0 || + prop.expiration > block.timestamp + votingPeriod + gracePeriod, + "expired" + ); + + prop.votingStarts = uint32(block.timestamp); + + unchecked { + prop.votingEnds = uint32(block.timestamp) + votingPeriod; + prop.graceEnds = + uint32(block.timestamp) + + votingPeriod + + gracePeriod; + } + + prop.prevProposalId = latestSponsoredProposalId; + prop.sponsor = _msgSender(); + // snapshot both total supply and total shares + prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention + prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum + latestSponsoredProposalId = id; + + emit SponsorProposal(_msgSender(), id, block.timestamp); + } + + /// @notice Submit vote - proposal must exist & voting period must not have ended. + /// @param id Number of proposal in `proposals` mapping to cast vote on. + /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted. + function submitVote(uint32 id, bool approved) external nonReentrant { + _submitVote(_msgSender(), id, approved); + } + + /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended. + /// @param voter Address of member who submitted vote. + /// @param expiry Expiration of signature. + /// @param id Number of proposal in `proposals` mapping to cast vote on. + /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted. + /// @param v v in signature + /// @param r r in signature + /// @param s s in signature + function submitVoteWithSig( + address voter, + uint256 expiry, + uint256 nonce, + uint32 id, + bool approved, + uint8 v, + bytes32 r, + bytes32 s + ) external nonReentrant { + require(block.timestamp <= expiry, "ERC20Votes: signature expired"); + require(nonce == votingNonces[voter], "!nonce"); + + /*calculate EIP-712 struct hash*/ + bytes32 structHash = keccak256( + abi.encode( + VOTE_TYPEHASH, + keccak256(abi.encodePacked(sharesToken.name())), + voter, + expiry, + nonce, + id, + approved + ) + ); + bytes32 hash = _hashTypedDataV4(structHash); + address signer = ECDSAUpgradeable.recover(hash, v, r, s); + + require(signer == voter, "invalid signature"); + require(signer != address(0), "!signer"); + votingNonces[voter] += 1; + + _submitVote(signer, id, approved); + } + + /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature + /// @param voter Address of voter + /// @param id Number of proposal in `proposals` mapping to cast vote on. + /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted. + function _submitVote( + address voter, + uint32 id, + bool approved + ) internal { + Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/ + require(state(id) == ProposalState.Voting, "!voting"); + + uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/ + + require(balance > 0, "!member"); /* check that user has shares*/ + require(!memberVoted[voter][id], "voted"); /*check vote not already cast*/ + + memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/ + + // get high water mark on all votes + uint256 _totalSupply = totalSupply(); + if (_totalSupply > prop.maxTotalSharesAndLootAtVote) { + prop.maxTotalSharesAndLootAtVote = _totalSupply; + } + + unchecked { + if (approved) { + /*if `approved`, cast delegated balance `yesVotes` to proposal*/ + prop.yesVotes += balance; + } else { + /*otherwise, cast delegated balance `noVotes` to proposal*/ + prop.noVotes += balance; + } + } + + emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/ + } + + /// @notice Process `proposal` & execute internal functions. + /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met + /// @param id Number of proposal in `proposals` mapping to process for execution. + /// @param proposalData Packed multisend data to execute via Gnosis multisend library + function processProposal(uint32 id, bytes calldata proposalData) + external + nonReentrant + { + Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/ + + require(prop.sponsor != address(0), "!sponsor"); /*check proposal has been sponsored*/ + require(state(id) == ProposalState.Ready, "!ready"); /* check proposal is Ready to process */ + + ProposalState prevProposalState = state(prop.prevProposalId); + require( + prevProposalState == ProposalState.Processed || + prevProposalState == ProposalState.Cancelled || + prevProposalState == ProposalState.Defeated || + prevProposalState == ProposalState.Unborn, + "prev!processed" + ); + + // check that the proposalData matches the stored hash + require( + hashOperation(proposalData) == prop.proposalDataHash, + "incorrect calldata" + ); + + require( + prop.baalGas == 0 || gasleft() >= prop.baalGas, + "not enough gas" + ); + + prop.status[1] = true; /*Set processed flag to true*/ + bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/ + + // Make proposal fail if after expiration + if (prop.expiration != 0 && prop.expiration < block.timestamp) + okToExecute = false; + + // Make proposal fail if it didn't pass quorum + if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor) + okToExecute = false; + + // Make proposal fail if the minRetentionPercent is exceeded + if ( + okToExecute && + (totalSupply()) < + (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/ + ) { + okToExecute = false; + } + + /*check if `proposal` approved by simple majority of members*/ + if (okToExecute) { + prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/ + bool success = processActionProposal(proposalData); /*execute 'action'*/ + if (!success) { + prop.status[3] = true; + } + } + + emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/ + } + + /// @notice Internal function to process 'action'[0] proposal. + /// @param proposalData Packed multisend data to execute via Gnosis multisend library + /// @return success Success or failure of execution + function processActionProposal(bytes memory proposalData) + private + returns (bool success) + { + success = exec( + multisendLibrary, + 0, + proposalData, + Enum.Operation.DelegateCall + ); + } + + /// @notice Cancel proposal prior to execution + /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold + /// @param id Number of proposal in `proposals` mapping to process for execution. + function cancelProposal(uint32 id) external nonReentrant { + Proposal storage prop = proposals[id]; + require(state(id) == ProposalState.Voting, "!voting"); + require( + _msgSender() == prop.sponsor || + sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) < + sponsorThreshold || + isGovernor(_msgSender()), + "!cancellable" + ); + prop.status[0] = true; + emit CancelProposal(id); + } + + /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here + /// @notice Can only be called by the avatar which means this can only be called if passed by another + /// proposal or by a delegated signer on the Safe + /// @param _to address to call + /// @param _value value to include in wei + /// @param _data arbitrary transaction data + function executeAsBaal( + address _to, + uint256 _value, + bytes calldata _data + ) external baalOnly { + (bool success, ) = _to.call{value: _value}(_data); + require(success, "call failure execute"); + } + + // **************** + // MEMBER FUNCTIONS + // **************** + + /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens` + /// @param to Account that receives 'fair share'. + /// @param lootToBurn Baal pure economic weight to burn. + /// @param sharesToBurn Baal voting weight to burn. + /// @param tokens Array of tokens to include in rage quit calculation + function ragequit( + address to, + uint256 sharesToBurn, + uint256 lootToBurn, + address[] calldata tokens + ) external nonReentrant { + for (uint256 i = 1; i < tokens.length; i++) { + require(tokens[i] > tokens[i - 1], "!order"); + } + + _ragequit(to, sharesToBurn, lootToBurn, tokens); + } + + /// @notice Internal execution of rage quite + /// @param to Account that receives 'fair share'. + /// @param lootToBurn Baal pure economic weight to burn. + /// @param sharesToBurn Baal voting weight to burn. + /// @param tokens Array of tokens to include in rage quit calculation + function _ragequit( + address to, + uint256 sharesToBurn, + uint256 lootToBurn, + address[] memory tokens + ) internal { + uint256 _totalSupply = totalSupply(); + + if (lootToBurn != 0) { + /*gas optimization*/ + _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/ + } + + if (sharesToBurn != 0) { + /*gas optimization*/ + _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/ + } + + for (uint256 i = 0; i < tokens.length; i++) { + uint256 balance; + if(tokens[i] == ETH) { + balance = address(target).balance; + } else { + (, bytes memory balanceData) = tokens[i].staticcall( + abi.encodeWithSelector(0x70a08231, address(target)) + ); /*get Baal token balances - 'balanceOf(address)'*/ + balance = abi.decode(balanceData, (uint256)); + } + + uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) / + _totalSupply; /*calculate 'fair shair' claims*/ + + if (amountToRagequit != 0) { + /*gas optimization to allow higher maximum token limit*/ + tokens[i] == ETH + ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/ + : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/ + } + } + + emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/ + } + + /******************* + GUILD MGMT FUNCTIONS + *******************/ + /// @notice Baal-only function to set shaman status. + /// @param _shamans Addresses of shaman contracts + /// @param _permissions Permission level of each shaman in _shamans + function setShamans( + address[] calldata _shamans, + uint256[] calldata _permissions + ) external baalOnly { + require(_shamans.length == _permissions.length, "!array parity"); /*check array lengths match*/ + for (uint256 i = 0; i < _shamans.length; i++) { + uint256 permission = _permissions[i]; + if (adminLock) + require( + permission != 1 && + permission != 3 && + permission != 5 && + permission != 7, + "admin lock" + ); + if (managerLock) + require( + permission != 2 && + permission != 3 && + permission != 6 && + permission != 7, + "manager lock" + ); + if (governorLock) + require( + permission != 4 && + permission != 5 && + permission != 6 && + permission != 7, + "governor lock" + ); + shamans[_shamans[i]] = permission; + emit ShamanSet(_shamans[i], permission); + } + } + + /// @notice Lock admin so setShamans cannot be called with admin changes + function lockAdmin() external baalOnly { + adminLock = true; + + emit LockAdmin(adminLock); + } + + /// @notice Lock manager so setShamans cannot be called with manager changes + function lockManager() external baalOnly { + managerLock = true; + + emit LockManager(managerLock); + } + + /// @notice Lock governor so setShamans cannot be called with governor changes + function lockGovernor() external baalOnly { + governorLock = true; + + emit LockGovernor(governorLock); + } + + // **************** + // SHAMAN FUNCTIONS + // **************** + /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token + /// @param pauseShares Turn share transfers on or off + /// @param pauseLoot Turn loot transfers on or off + function setAdminConfig(bool pauseShares, bool pauseLoot) + external + baalOrAdminOnly + { + + if(pauseShares && !sharesToken.paused()){ + sharesToken.pause(); + emit SharesPaused(true); + } else if(!pauseShares && sharesToken.paused()){ + sharesToken.unpause(); + emit SharesPaused(false); + } + + if(pauseLoot && !lootToken.paused()){ + lootToken.pause(); + emit LootPaused(true); + } else if(!pauseLoot && lootToken.paused()){ + lootToken.unpause(); + emit LootPaused(false); + } + } + + /// @notice Baal-or-manager-only function to mint shares. + /// @param to Array of addresses to receive shares + /// @param amount Array of amounts to mint + function mintShares(address[] calldata to, uint256[] calldata amount) + external + baalOrManagerOnly + { + require(to.length == amount.length, "!array parity"); /*check array lengths match*/ + for (uint256 i = 0; i < to.length; i++) { + _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/ + } + } + + /// @notice Minting function for Baal `shares`. + /// @param to Address to receive shares + /// @param shares Amount to mint + function _mintShares(address to, uint256 shares) private { + sharesToken.mint(to, shares); + } + + /// @notice Baal-or-manager-only function to burn shares. + /// @param from Array of addresses to lose shares + /// @param amount Array of amounts to burn + function burnShares(address[] calldata from, uint256[] calldata amount) + external + baalOrManagerOnly + { + require(from.length == amount.length, "!array parity"); /*check array lengths match*/ + for (uint256 i = 0; i < from.length; i++) { + _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/ + } + } + + /// @notice Burn function for Baal `shares`. + /// @param from Address to lose shares + /// @param shares Amount to burn + function _burnShares(address from, uint256 shares) private { + sharesToken.burn(from, shares); + } + + /// @notice Baal-or-manager-only function to mint loot. + /// @param to Array of addresses to mint loot + /// @param amount Array of amounts to mint + function mintLoot(address[] calldata to, uint256[] calldata amount) + external + baalOrManagerOnly + { + require(to.length == amount.length, "!array parity"); /*check array lengths match*/ + for (uint256 i = 0; i < to.length; i++) { + _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/ + } + } + + /// @notice Minting function for Baal `loot`. + /// @param to Address to mint loot + /// @param loot Amount to mint + function _mintLoot(address to, uint256 loot) private { + lootToken.mint(to, loot); + } + + /// @notice Baal-or-manager-only function to burn loot. + /// @param from Array of addresses to lose loot + /// @param amount Array of amounts to burn + function burnLoot(address[] calldata from, uint256[] calldata amount) + external + baalOrManagerOnly + { + require(from.length == amount.length, "!array parity"); /*check array lengths match*/ + for (uint256 i = 0; i < from.length; i++) { + _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/ + } + } + + /// @notice Burn function for Baal `loot`. + /// @param from Address to lose loot + /// @param loot Amount to burn + function _burnLoot(address from, uint256 loot) private { + lootToken.burn(from, loot); + } + + /// @notice Baal-or-governance-only function to change periods. + /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound + function setGovernanceConfig(bytes memory _governanceConfig) + external + baalOrGovernorOnly + { + ( + uint32 voting, + uint32 grace, + uint256 newOffering, + uint256 quorum, + uint256 sponsor, + uint256 minRetention + ) = abi.decode( + _governanceConfig, + (uint32, uint32, uint256, uint256, uint256, uint256) + ); + require(quorum >= 0 && minRetention <= 100, 'bad quorum'); + require(minRetention >= 0 && minRetention <= 100, 'bad minRetention'); + + // on initialization of governance config, there is no shares token + // skip this check on initialization of governance config. + if (sponsorThreshold > 0 && address(sharesToken) != address(0)) { + require(sponsor <= totalShares(), 'sponsor > sharesSupply'); + } + + if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/ + if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/ + proposalOffering = newOffering; /*set new proposal offering amount */ + quorumPercent = quorum; + sponsorThreshold = sponsor; + minRetentionPercent = minRetention; + + emit GovernanceConfigSet( + voting, + grace, + newOffering, + quorum, + sponsor, + minRetention + ); + } + + /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions. + /// @param _trustedForwarderAddress Trusted forwarder's address + function setTrustedForwarder(address _trustedForwarderAddress) + external + baalOrGovernorOnly + { + _setTrustedForwarder(_trustedForwarderAddress); + emit SetTrustedForwarder(_trustedForwarderAddress); + } + + /*************** + GETTER FUNCTIONS + ***************/ + /// @notice State helper to determine proposal state + /// @param id Number of proposal in proposals + /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed + /// \-> Cancelled \-> Defeated + function state(uint32 id) public view returns (ProposalState) { + Proposal memory prop = proposals[id]; + if (prop.id == 0) { + /*Uninitialized state*/ + return ProposalState.Unborn; + } else if ( + prop.status[0] /* cancelled */ + ) { + return ProposalState.Cancelled; + } else if ( + prop.votingStarts == 0 /*Voting has not started*/ + ) { + return ProposalState.Submitted; + } else if ( + block.timestamp <= prop.votingEnds /*Voting in progress*/ + ) { + return ProposalState.Voting; + } else if ( + block.timestamp <= prop.graceEnds /*Proposal in grace period*/ + ) { + return ProposalState.Grace; + } else if ( + prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/ + ) { + return ProposalState.Defeated; + } else if ( + prop.status[1] /* processed */ + ) { + return ProposalState.Processed; + } + /* Proposal is ready to be processed*/ + else { + return ProposalState.Ready; + } + } + + /// @notice Helper to get recorded proposal flags + /// @param id Number of proposal in proposals + /// @return [cancelled, processed, passed, actionFailed] + function getProposalStatus(uint32 id) + external + view + returns (bool[4] memory) + { + return proposals[id].status; + } + + /// @notice Helper to check if shaman permission contains admin capabilities + /// @param shaman Address attempting to execute admin permissioned functions + function isAdmin(address shaman) public view returns (bool) { + uint256 permission = shamans[shaman]; + return (permission == 1 || + permission == 3 || + permission == 5 || + permission == 7); + } + + /// @notice Helper to check if shaman permission contains manager capabilities + /// @param shaman Address attempting to execute manager permissioned functions + function isManager(address shaman) public view returns (bool) { + uint256 permission = shamans[shaman]; + return (permission == 2 || + permission == 3 || + permission == 6 || + permission == 7); + } + + /// @notice Helper to check if shaman permission contains governor capabilities + /// @param shaman Address attempting to execute governor permissioned functions + function isGovernor(address shaman) public view returns (bool) { + uint256 permission = shamans[shaman]; + return (permission == 4 || + permission == 5 || + permission == 6 || + permission == 7); + } + + /// @notice Helper to check total supply of child loot contract + function totalLoot() public view returns (uint256) { + return lootToken.totalSupply(); + } + + /// @notice Helper to check total supply of child shares contract + function totalShares() public view returns (uint256) { + return sharesToken.totalSupply(); + } + + /// @notice Helper to check total supply of loot and shares + function totalSupply() public view returns (uint256) { + return totalLoot() + totalShares(); + } + + /*************** + HELPER FUNCTIONS + ***************/ + /// @notice Returns the keccak256 hash of calldata + function hashOperation(bytes memory _transactions) + public + pure + virtual + returns (bytes32 hash) + { + return keccak256(abi.encode(_transactions)); + } + + /// @notice Provides 'safe' {transfer} for ETH. + function _safeTransferETH(address to, uint256 amount) internal { + // transfer eth from target + (bool success, ) = execAndReturnData( + to, + amount, + "", + Enum.Operation.Call + ); + + require(success, "ETH_TRANSFER_FAILED"); + } + + /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'. + function _safeTransfer( + address token, + address to, + uint256 amount + ) private { + (bool success, bytes memory data) = execAndReturnData( + token, + 0, + abi.encodeWithSelector(0xa9059cbb, to, amount), + Enum.Operation.Call + ); /*'transfer(address,uint)'*/ + require( + success && (data.length == 0 || abi.decode(data, (bool))), + "transfer failed" + ); /*checks success & allows non-conforming transfers*/ + } + + /// @notice Provides access to message sender of a meta transaction (EIP-2771) + function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient) + returns (address sender) { + sender = BaseRelayRecipient._msgSender(); + } + + /// @notice Provides access to message data of a meta transaction (EIP-2771) + function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient) + returns (bytes calldata) { + return BaseRelayRecipient._msgData(); + } +} diff --git a/lib/Baal/contracts/BaalSummoner.sol b/lib/Baal/contracts/BaalSummoner.sol new file mode 100644 index 0000000..37c1f25 --- /dev/null +++ b/lib/Baal/contracts/BaalSummoner.sol @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +import "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol"; +import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "./Baal.sol"; + +contract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable { + // when some of the init addresses are updated + uint256 public addrsVersion; + + address payable public template; // fixed template for baal using eip-1167 proxy pattern + + // Template contract to use for new Gnosis safe proxies + address public gnosisSingleton; + + // Library to use for EIP1271 compatability + address public gnosisFallbackLibrary; + + // Library to use for all safe transaction executions + address public gnosisMultisendLibrary; + + // template contract to clone for loot ERC20 token + address public lootSingleton; + + // template contract to clone for shares ERC20 token + address public sharesSingleton; + + // Proxy summoners + // + GnosisSafeProxyFactory gnosisSafeProxyFactory; + ModuleProxyFactory moduleProxyFactory; + + event SetAddrsVersion( + uint256 version + ); + + event SummonBaal( + address indexed baal, + address indexed loot, + address indexed shares, + address safe, + address forwarder, + uint256 existingAddrs + ); + + event DaoReferral( + bytes32 referrer, + address daoAddress + ); + + event DeployBaalTokens( + address lootToken, + address sharesToken + ); + + event DeployBaalSafe( + address baalSafe, + address moduleAddr + ); + + function initialize() initializer public { + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + // must be called after deploy to set libraries + function setAddrs( + address payable _template, + address _gnosisSingleton, + address _gnosisFallbackLibrary, + address _gnosisMultisendLibrary, + address _gnosisSafeProxyFactory, + address _moduleProxyFactory, + address _lootSingleton, + address _sharesSingleton + ) public onlyOwner { + require(_lootSingleton != address(0), "!lootSingleton"); + require(_sharesSingleton != address(0), "!sharesSingleton"); + require(_gnosisSingleton != address(0), "!gnosisSingleton"); + require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary'); + require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary'); + require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory'); + require(_moduleProxyFactory != address(0), '!moduleProxyFactory'); + + template = _template; + gnosisSingleton = _gnosisSingleton; + gnosisFallbackLibrary = _gnosisFallbackLibrary; + gnosisMultisendLibrary = _gnosisMultisendLibrary; + gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory); + moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory); + lootSingleton = _lootSingleton; + sharesSingleton = _sharesSingleton; + + emit SetAddrsVersion( + addrsVersion++ + ); + + } + + function encodeMultisend(bytes[] memory _calls, address _target) + public + pure + returns (bytes memory encodedMultisend) + { + bytes memory encodedActions; + for (uint256 i = 0; i < _calls.length; i++) { + encodedActions = abi.encodePacked( + encodedActions, + uint8(0), + _target, + uint256(0), + uint256(_calls[i].length), + bytes(_calls[i]) + ); + } + encodedMultisend = abi.encodeWithSignature( + "multiSend(bytes)", + encodedActions + ); + } + + function summonBaal( + bytes calldata initializationParams, + bytes[] calldata initializationActions, + uint256 _saltNonce + ) external returns (address) { + + return + _summonBaal( + initializationParams, + initializationActions, + _saltNonce + ); + } + + // Add a referrer to help keep track of where deploies are coming from + function summonBaalFromReferrer( + bytes calldata initializationParams, + bytes[] calldata initializationActions, + uint256 _saltNonce, + bytes32 referrer + ) external payable returns (address) { + address daoAddress; + + daoAddress = _summonBaal( + initializationParams, + initializationActions, + _saltNonce + ); + + emit DaoReferral(referrer, daoAddress); + return daoAddress; + } + + // deploy new share and loot contracts + function deployTokens(string memory _name, string memory _symbol) + public + returns (address lootToken, address sharesToken) + { + lootToken = address(new ERC1967Proxy( + lootSingleton, + abi.encodeWithSelector( + IBaalToken(lootSingleton).setUp.selector, + string(abi.encodePacked(_name, " LOOT")), + string(abi.encodePacked(_symbol, "-LOOT"))) + )); + + sharesToken = address(new ERC1967Proxy( + sharesSingleton, + abi.encodeWithSelector( + IBaalToken(sharesSingleton).setUp.selector, + _name, + _symbol) + )); + + emit DeployBaalTokens(lootToken, sharesToken); + + } + + function configureSafe(address _moduleAddr, GnosisSafe _safe) internal { + // Generate delegate calls so the safe calls enableModule on itself during setup + bytes memory _enableBaal = abi.encodeWithSignature( + "enableModule(address)", + address(_moduleAddr) + ); + bytes memory _enableBaalMultisend = abi.encodePacked( + uint8(0), + address(_safe), + uint256(0), + uint256(_enableBaal.length), + bytes(_enableBaal) + ); + + bytes memory _multisendAction = abi.encodeWithSignature( + "multiSend(bytes)", + _enableBaalMultisend + ); + + // Workaround for solidity dynamic memory array + address[] memory _owners = new address[](1); + _owners[0] = address(_moduleAddr); + + // Call setup on safe to enable our new module and set the module as the only signer + _safe.setup( + _owners, + 1, + gnosisMultisendLibrary, + _multisendAction, + gnosisFallbackLibrary, + address(0), + 0, + payable(address(0)) + ); + } + + + // deploy a safe with module and single module signer setup + // with nounce + function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce) + public + returns (address) + { + GnosisSafe _safe = GnosisSafe( + payable( + gnosisSafeProxyFactory.createProxyWithNonce( + gnosisSingleton, + bytes(""), + _saltNonce + ) + ) + ); + + configureSafe(_moduleAddr, _safe); + + emit DeployBaalSafe(address(_safe), address(_moduleAddr)); + + return address(_safe); + } + + + // deploy a safe with module and single module signer setup + function deployAndSetupSafe(address _moduleAddr) + public + returns (address) + { + GnosisSafe _safe = GnosisSafe( + payable( + gnosisSafeProxyFactory.createProxy( + gnosisSingleton, + bytes("") + ) + ) + ); + + configureSafe(_moduleAddr, _safe); + + emit DeployBaalSafe(address(_safe), address(_moduleAddr)); + + return address(_safe); + } + + // advanced summon baal with different configurations + // name and symbol can be blank if bringing own baal tokens + // zero address for either loot or shares token will summon new ones + // if bringing own tokens the ownership must be transfered to the new DAO + // zero address for Safe with summon and setup a new Safe + // if bringing existing safe the new dao must be enabled as a module + // todo: add a simple summon that just creates a dao with a single summoner + function _summonBaal( + bytes calldata initializationParams, + bytes[] calldata initializationActions, + uint256 _saltNonce + ) internal returns (address) { + uint256 existingAddrs; // 1 tokens, 2 safe, 3 both + ( + string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */ + string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/ + address _safeAddr, /*address of safe, 0 addr if new*/ + address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/ + address _lootToken, /*predeployed loot token, 0 addr if new*/ + address _sharesToken /*predeployed shares token, 0 addr if new*/ + ) = abi.decode(initializationParams, (string, string, address, address, address, address)); + + Baal _baal = Baal( + moduleProxyFactory.deployModule( + template, + abi.encodeWithSignature("avatar()"), + _saltNonce + ) + ); + + // if loot or shares are zero address new tokens are deployed + // tokens need to be baalTokens + if(_lootToken == address(0) || _sharesToken == address(0)){ + (_lootToken, _sharesToken) = deployTokens(_name, _symbol); + // pause tokens by default and transfer to the DAO + IBaalToken(_lootToken).pause(); + IBaalToken(_sharesToken).pause(); + IBaalToken(_lootToken).transferOwnership(address(_baal)); + IBaalToken(_sharesToken).transferOwnership(address(_baal)); + } else { + existingAddrs += 1; + } + + // if zero address deploy a new safe + // Needs to be a valid zodiac treasury + if(_safeAddr == address(0)){ + _safeAddr = deployAndSetupSafe(address(_baal), _saltNonce); + } else { + existingAddrs += 2; + } + + bytes memory _initializationMultisendData = encodeMultisend( + initializationActions, + address(_baal) + ); + bytes memory _initializer = abi.encode( + _lootToken, + _sharesToken, + gnosisMultisendLibrary, + _safeAddr, + _forwarder, + _initializationMultisendData + ); + // can run the actions now because we have a baal + _baal.setUp(_initializer); + + emit SummonBaal( + address(_baal), + address(_baal.lootToken()), + address(_baal.sharesToken()), + _safeAddr, + _forwarder, + existingAddrs + ); + + return (address(_baal)); + } + + function _authorizeUpgrade(address newImplementation) + internal + onlyOwner + override + {} +} diff --git a/lib/Baal/contracts/LootERC20.sol b/lib/Baal/contracts/LootERC20.sol new file mode 100644 index 0000000..1e2b50a --- /dev/null +++ b/lib/Baal/contracts/LootERC20.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts/utils/Address.sol"; + +contract Loot is + ERC20SnapshotUpgradeable, + ERC20PermitUpgradeable, + PausableUpgradeable, + OwnableUpgradeable, + UUPSUpgradeable +{ + constructor() { + _disableInitializers(); + } + + /// @notice Configure loot - called by Baal on summon + /// @dev initializer should prevent this from being called again + /// @param name_ Name for ERC20 token trackers + /// @param symbol_ Symbol for ERC20 token trackers + function setUp(string memory name_, string memory symbol_) + external + initializer + { + require(bytes(name_).length != 0, "loot: name empty"); + require(bytes(symbol_).length != 0, "loot: symbol empty"); + + __ERC20_init(name_, symbol_); + __ERC20Permit_init(name_); + __Pausable_init(); + __ERC20Snapshot_init(); + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + /// @notice Allows baal to create a snapshot + function snapshot() external onlyOwner returns(uint256) { + return _snapshot(); + } + + /// @notice get current SnapshotId + function getCurrentSnapshotId() external view returns (uint256) { + return _getCurrentSnapshotId(); + } + + /// @notice Baal-only function to pause shares. + function pause() public onlyOwner { + _pause(); + } + + /// @notice Baal-only function to pause shares. + function unpause() public onlyOwner { + _unpause(); + } + + /// @notice Baal-only function to mint loot. + /// @param recipient Address to receive loot + /// @param amount Amount to mint + function mint(address recipient, uint256 amount) external onlyOwner { + // can not be more than half the max because of totalsupply of loot and shares + require(totalSupply() + amount <= type(uint256).max / 2, "loot: cap exceeded"); + _mint(recipient, amount); + } + + /// @notice Baal-only function to burn loot. + /// @param account Address to lose loot + /// @param amount Amount to burn + function burn(address account, uint256 amount) external onlyOwner { + _burn(account, amount); + } + + /// @notice Internal hook to restrict token transfers unless allowed by baal + /// @dev Allows transfers if msg.sender is Baal which enables minting and burning + /// @param from The address of the source account. + /// @param to The address of the destination account. + /// @param amount The number of `loot` tokens to transfer. + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) { + super._beforeTokenTransfer(from, to, amount); + require( + from == address(0) || /*Minting allowed*/ + (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/ + !paused(), + "loot: !transferable" + ); + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} +} diff --git a/lib/Baal/contracts/SharesERC20.sol b/lib/Baal/contracts/SharesERC20.sol new file mode 100644 index 0000000..17fc4d1 --- /dev/null +++ b/lib/Baal/contracts/SharesERC20.sol @@ -0,0 +1,102 @@ +pragma solidity 0.8.7; +//SPDX-License-Identifier: MIT + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol"; + +import "./utils/BaalVotes.sol"; +import "./interfaces/IBaal.sol"; + +// import "hardhat/console.sol"; + +/// @title Shares +/// @notice Accounting for Baal non voting shares +contract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable { + + constructor() { + _disableInitializers(); + } + + /// @notice Configure shares - called by Baal on summon + /// @dev initializer should prevent this from being called again + /// @param name_ Name for ERC20 token trackers + /// @param symbol_ Symbol for ERC20 token trackers + function setUp(string memory name_, string memory symbol_) + external + initializer + { + require(bytes(name_).length != 0, "shares: name empty"); + require(bytes(symbol_).length != 0, "shares: symbol empty"); + + __ERC20_init(name_, symbol_); + __ERC20Permit_init(name_); + __Pausable_init(); + __ERC20Snapshot_init(); + __Ownable_init(); + __UUPSUpgradeable_init(); + __EIP712_init_delegation("delegation", "4"); + + + } + + /// @notice Baal-only function to pause shares. + function pause() public onlyOwner { + _pause(); + } + + /// @notice Baal-only function to unpause shares. + function unpause() public onlyOwner { + _unpause(); + } + + /// @notice Allows baal to create a snapshot + function snapshot() external onlyOwner returns(uint256) { + return _snapshot(); + } + + /// @notice get current SnapshotId + function getCurrentSnapshotId() external view returns (uint256) { + return _getCurrentSnapshotId(); + } + + /// @notice Baal-only function to mint shares. + /// @param recipient Address to receive shares + /// @param amount Amount to mint + function mint(address recipient, uint256 amount) external onlyOwner { + // can not be more than half the max because of totalsupply of loot and shares + require(totalSupply() + amount <= type(uint256).max / 2, "shares: cap exceeded"); + _mint(recipient, amount); + } + + /// @notice Baal-only function to burn shares. + /// @param account Address to lose shares + /// @param amount Amount to burn + function burn(address account, uint256 amount) external onlyOwner { + _burn(account, amount); + } + + /// @notice Internal hook to restrict token transfers unless allowed by baal + /// @dev Allows transfers if msg.sender is Baal which enables minting and burning + /// @param from The address of the source account. + /// @param to The address of the destination account. + /// @param amount The number of `shares` tokens to transfer. + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal override(BaalVotes, ERC20SnapshotUpgradeable) { + super._beforeTokenTransfer(from, to, amount); + require( + from == address(0) || /*Minting allowed*/ + (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/ + !paused(), + "shares: !transferable" + ); + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} +} diff --git a/lib/Baal/contracts/fixtures/GnosisImports.sol b/lib/Baal/contracts/fixtures/GnosisImports.sol new file mode 100644 index 0000000..aceef81 --- /dev/null +++ b/lib/Baal/contracts/fixtures/GnosisImports.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: LGPL-3.0-only +pragma solidity 0.8.7; + +import "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol +import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol +import "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol +import "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol +import "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol diff --git a/lib/Baal/contracts/higherOrderFactories/BaalAdvTokenSummoner.sol b/lib/Baal/contracts/higherOrderFactories/BaalAdvTokenSummoner.sol new file mode 100644 index 0000000..19ef2d2 --- /dev/null +++ b/lib/Baal/contracts/higherOrderFactories/BaalAdvTokenSummoner.sol @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +import "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol"; +import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "../Baal.sol"; +import "../interfaces/IBaalSummoner.sol"; + +contract BaalAdvTokenSummoner is + Initializable, + OwnableUpgradeable, + UUPSUpgradeable +{ + IBaalSummoner public _baalSummoner; + + event setSummoner(address summoner); + + event DeployBaalTokens(address lootToken, address sharesToken); + + constructor() { + _disableInitializers(); + } + + function initialize() public initializer { + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + /** + * @dev Sets the address of the BaalSummoner contract + * @param baalSummoner The address of the BaalSummoner contract + */ + function setSummonerAddr(address baalSummoner) public onlyOwner { + require(baalSummoner != address(0), "zero address"); + _baalSummoner = IBaalSummoner(baalSummoner); + emit setSummoner(baalSummoner); + } + + /** + * @dev Summon a new Baal contract with a new set of tokens + * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe + * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set + * @param _saltNonce The salt nonce to be used for the Safe contract + * @param initializationMintParams The parameters for minting the tokens + * @param initializationTokenParams The parameters for deploying the tokens + * @param postInitializationActions The actions to be performed after the initialization + */ + function summonBaalFromReferrer( + address _safeAddr, + address _forwarderAddr, + uint256 _saltNonce, + bytes calldata initializationMintParams, + bytes calldata initializationTokenParams, + bytes[] calldata postInitializationActions + ) external { + // summon tokens + (address _lootToken, address _sharesToken) = deployTokens( + initializationTokenParams + ); + + // mint shares loot tokens + mintTokens(initializationMintParams, _lootToken, _sharesToken); + + // summon baal with new tokens + address _baal = _baalSummoner.summonBaalFromReferrer( + abi.encode( + IBaalToken(_sharesToken).name(), + IBaalToken(_sharesToken).symbol(), + _safeAddr, + _forwarderAddr, + _lootToken, + _sharesToken + ), + postInitializationActions, + _saltNonce, + bytes32(bytes("DHAdvTokenSummoner")) // referrer + ); + + // change token ownership to baal + IBaalToken(_lootToken).transferOwnership(address(_baal)); + IBaalToken(_sharesToken).transferOwnership(address(_baal)); + } + + /** + * @dev mintTokens + * @param initializationTokens The parameters for minting the tokens + * @param _lootToken The loot token address + * @param _sharesToken The shares token address + */ + function mintTokens( + bytes calldata initializationTokens, + address _lootToken, + address _sharesToken + ) internal { + ( + address[] memory summoners, // The address to mint initial tokens to + uint256[] memory summonerShares, // The amount of shares to mint + uint256[] memory summonerLoot // The amount of loot to mint + ) = abi.decode(initializationTokens, (address[], uint256[], uint256[])); + + require( + summoners.length == summonerShares.length && + summoners.length == summonerLoot.length, + "!array parity" + ); /*check array lengths match*/ + + for (uint256 i = 0; i < summoners.length; i++) { + if (summonerLoot[i] > 0) { + IBaalToken(_lootToken).mint( + summoners[i], + summonerLoot[i] + ); /*grant `to` `amount` `loot`*/ + } + if (summonerShares[i] > 0) { + IBaalToken(_sharesToken).mint( + summoners[i], + summonerShares[i] + ); /*grant `to` `amount` `shares`*/ + } + } + } + + /** + * @dev deployTokens + * @param initializationParams The parameters for deploying the tokens + */ + function deployTokens( + bytes calldata initializationParams + ) internal returns (address lootToken, address sharesToken) { + ( + string + memory _name /*_name Name for erc20 `shares` accounting, empty if token */, + string + memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/, + string + memory _lootName /* name for erc20 `loot` accounting, empty if token */, + string + memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/, + bool _transferableShares /* if shares is transferable */, + bool _transferableLoot /* if loot is transferable */ + ) = abi.decode( + initializationParams, + (string, string, string, string, bool, bool) + ); + + address lootSingleton = _baalSummoner.lootSingleton(); + address sharesSingleton = _baalSummoner.sharesSingleton(); + + lootToken = address( + new ERC1967Proxy( + lootSingleton, + abi.encodeWithSelector( + IBaalToken(lootSingleton).setUp.selector, + _lootName, + _lootSymbol + ) + ) + ); + + sharesToken = address( + new ERC1967Proxy( + sharesSingleton, + abi.encodeWithSelector( + IBaalToken(sharesSingleton).setUp.selector, + _name, + _symbol + ) + ) + ); + if (!_transferableShares) { + IBaalToken(sharesToken).pause(); + } + if (!_transferableLoot) { + IBaalToken(lootToken).pause(); + } + + emit DeployBaalTokens(lootToken, sharesToken); + } + + function _authorizeUpgrade( + address newImplementation + ) internal override onlyOwner {} +} diff --git a/lib/Baal/contracts/higherOrderFactories/BaalAndVaultSummoner.sol b/lib/Baal/contracts/higherOrderFactories/BaalAndVaultSummoner.sol new file mode 100644 index 0000000..e9e6afd --- /dev/null +++ b/lib/Baal/contracts/higherOrderFactories/BaalAndVaultSummoner.sol @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "../interfaces/IBaalSummoner.sol"; + +/* +Summon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?) +Can summon a dao with a new Vault. +Can summon a new vault for a dao after initial dao setup. +Acts as a register and the owner of the contract or DAO can deactivate +register is primarily a helper for UIs +Owner of the contract can add new vaults, and set current vaults +Contract is upgradable and should be owned by a DAO +*/ +contract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable { + + IBaalSummoner public _baalSummoner; + uint256 public vaultIdx; + + struct Vault{ + uint256 id; + bool active; + address daoAddress; + address vaultAddress; + string name; + } + mapping(uint256 => Vault) public vaults; + mapping(address => address) public delegates; + + event SetVault( + Vault vault + ); + + event SetDelegate( + address daoAddress, + address delegate + ); + + event setSummoner( + address summoner + ); + + function initialize() initializer public { + __Ownable_init(); + __UUPSUpgradeable_init(); + vaultIdx = 0; + } + + function setSummonerAddr( + address baalSummoner + ) public onlyOwner { + require(baalSummoner != address(0), "zero address"); + _baalSummoner = IBaalSummoner(baalSummoner); + emit setSummoner(baalSummoner); + } + + /** Summon a new baal and add a Vault */ + function summonBaalAndVault( + bytes calldata initializationParams, + bytes[] calldata initializationActions, + uint256 saltNonce, + bytes32 referrer, + string memory name + ) external returns (address _daoAddress, address _vaultAddress) { + _daoAddress = _baalSummoner.summonBaalFromReferrer( + initializationParams, + initializationActions, + saltNonce, + referrer + ); + _vaultAddress = summonVault(_daoAddress, name); + } + + /** create and add a Vault(Safe) to an existing DAO */ + function summonVault( + address daoAddress, + string memory name + ) public returns (address _vaultAddress) { + _vaultAddress = _baalSummoner.deployAndSetupSafe( + daoAddress + ); + _setNewVault(name, daoAddress, _vaultAddress); + } + + /** set a Vault as active or not on existing dao (owner only) */ + // Admin functions to help maintain the registry. + function setVault( + uint256 id, + bool active + ) public onlyOwner + { + _setVault(id, active); + } + + /** set a new Vault as active on existing dao (owner only) */ + // Admin functions to help maintain the registry. + function setNewVault( + address daoAddress, + address vaultAddress, + string memory name + ) public onlyOwner + { + _setNewVault(name, daoAddress, vaultAddress); + } + + /** + A DAO can set a Vault as inactive + */ + function deactivateVaultAsDao( + uint256 id, + address daoAddress + ) external + { + require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], "not DAO or delegate"); + require(vaults[id].daoAddress == daoAddress && vaults[id].active,"!not active DAO vault"); + _setVault(id, false); + } + + /** Allow a Dao to set a delegate that can manage vault enteries */ + function setDelegate( + address daoAddress, + address delegate + ) external + { + require(msg.sender == daoAddress, "!DAO"); + delegates[daoAddress] = delegate; + emit SetDelegate(daoAddress, delegate); + } + + + function _setVault( + uint256 id, + bool active + ) internal + { + vaults[id].active = active; + emit SetVault(vaults[id]); + } + + function _setNewVault( + string memory name, + address daoAddress, + address vaultAddress + ) internal + { + vaultIdx += 1; + vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name); + emit SetVault(vaults[vaultIdx]); + } + + function _authorizeUpgrade(address newImplementation) + internal + onlyOwner + override + {} +} diff --git a/lib/Baal/contracts/interfaces/IAdminShaman.sol b/lib/Baal/contracts/interfaces/IAdminShaman.sol new file mode 100644 index 0000000..f6d5585 --- /dev/null +++ b/lib/Baal/contracts/interfaces/IAdminShaman.sol @@ -0,0 +1,9 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IAdminShaman { + function isAdmin(address shaman) external view returns (bool); + + // Admin Only + function setAdminConfig(bool pauseShares, bool pauseLoot) external; +} diff --git a/lib/Baal/contracts/interfaces/IBaal.sol b/lib/Baal/contracts/interfaces/IBaal.sol new file mode 100644 index 0000000..65868f4 --- /dev/null +++ b/lib/Baal/contracts/interfaces/IBaal.sol @@ -0,0 +1,112 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IBaal { + // DATA STRUCTURES + struct Proposal { + /*Baal proposal details*/ + uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/ + uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */ + uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/ + uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/ + uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/ + uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */ + uint256 baalGas; /* gas needed to process proposal */ + uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/ + uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/ + uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/ + uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/ + bool[4] status; /* [cancelled, processed, passed, actionFailed] */ + address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */ + bytes32 proposalDataHash; /*hash of raw data associated with state updates*/ + } + + /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed + \-> Cancelled \-> Defeated */ + enum ProposalState { + Unborn, /* 0 - can submit */ + Submitted, /* 1 - can sponsor -> voting */ + Voting, /* 2 - can be cancelled, otherwise proceeds to grace */ + Cancelled, /* 3 - terminal state, counts as processed */ + Grace, /* 4 - proceeds to ready/defeated */ + Ready, /* 5 - can be processed */ + Processed, /* 6 - terminal state */ + Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */ + } + + function lootToken() external view returns (address); + function sharesToken() external view returns (address); + function votingPeriod() external view returns (uint32); + function gracePeriod() external view returns (uint32); + function proposalCount() external view returns (uint32); + function proposalOffering() external view returns (uint256); + function quorumPercent() external view returns (uint256); + function sponsorThreshold() external view returns (uint256); + function minRetentionPercent() external view returns (uint256); + function latestSponsoredProposalId() external view returns (uint32); + function state(uint32 id) external view returns (ProposalState); + function proposals(uint32 id) external view returns (Proposal memory); + + function setUp(bytes memory initializationParams) external; + function multisendLibrary() external view returns (address); + // Module + function avatar() external view returns (address); + function target() external view returns (address); + function setAvatar(address avatar) external; + function setTarget(address avatar) external; + // BaseRelayRecipient + function trustedForwarder() external view returns (address); + function setTrustedForwarder(address trustedForwarderAddress) external; + + function mintLoot(address[] calldata to, uint256[] calldata amount) external; + function burnLoot(address[] calldata from, uint256[] calldata amount) external; + function mintShares(address[] calldata to, uint256[] calldata amount) external; + function burnShares(address[] calldata from, uint256[] calldata amount) external; + function totalLoot() external view returns (uint256); + function totalShares() external view returns (uint256); + function totalSupply() external view returns (uint256); + function lootPaused() external view returns (bool); + function sharesPaused() external view returns (bool); + + function shamans(address shaman) external view returns (uint256); + function setShamans(address[] calldata shamans, uint256[] calldata permissions) external; + function isAdmin(address shaman) external view returns (bool); + function isManager(address shaman) external view returns (bool); + function isGovernor(address shaman) external view returns (bool); + function lockAdmin() external; + function lockManager() external; + function lockGovernor() external; + function adminLock() external view returns (bool); + function managerLock() external view returns (bool); + function governorLock() external view returns (bool); + function setAdminConfig(bool pauseShares, bool pauseLoot) external; + function setGovernanceConfig(bytes memory governanceConfig) external; + + function submitProposal( + bytes calldata proposalData, + uint32 expiration, + uint256 baalGas, + string calldata details + ) external payable returns (uint256); + function sponsorProposal(uint32 id) external; + function processProposal(uint32 id, bytes calldata proposalData) external; + function cancelProposal(uint32 id) external; + function getProposalStatus(uint32 id) external returns (bool[4] memory); + function submitVote(uint32 id, bool approved) external; + function submitVoteWithSig( + address voter, + uint256 expiry, + uint256 nonce, + uint32 id, + bool approved, + uint8 v, + bytes32 r, + bytes32 s + ) external; + + function executeAsBaal(address to, uint256 value, bytes calldata data) external; + function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external; + + function hashOperation(bytes memory transactions) external pure returns (bytes32); + function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory); +} diff --git a/lib/Baal/contracts/interfaces/IBaalAndVaultSummoner.sol b/lib/Baal/contracts/interfaces/IBaalAndVaultSummoner.sol new file mode 100644 index 0000000..19f699c --- /dev/null +++ b/lib/Baal/contracts/interfaces/IBaalAndVaultSummoner.sol @@ -0,0 +1,14 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IBaalAndVaultSummoner { + + function _baalSummoner() external view returns (address); + function summonBaalAndVault( + bytes calldata initializationParams, + bytes[] calldata initializationActions, + uint256 saltNonce, + bytes32 referrer, + string memory name + ) external returns (address _daoAddress, address _vaultAddress); +} diff --git a/lib/Baal/contracts/interfaces/IBaalSummoner.sol b/lib/Baal/contracts/interfaces/IBaalSummoner.sol new file mode 100644 index 0000000..4c04c50 --- /dev/null +++ b/lib/Baal/contracts/interfaces/IBaalSummoner.sol @@ -0,0 +1,69 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IBaalSummoner { + event AdminChanged(address previousAdmin, address newAdmin); + event BeaconUpgraded(address indexed beacon); + event DaoReferral(bytes32 referrer, address daoAddress); + event DeployBaalSafe(address baalSafe, address moduleAddr); + event DeployBaalTokens(address lootToken, address sharesToken); + event Initialized(uint8 version); + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + event SetAddrsVersion(uint256 version); + event SummonBaal( + address indexed baal, + address indexed loot, + address indexed shares, + address safe, + address forwarder, + uint256 existingAddrs + ); + event Upgraded(address indexed implementation); + + function setAddrs( + address _template, + address _gnosisSingleton, + address _gnosisFallbackLibrary, + address _gnosisMultisendLibrary, + address _gnosisSafeProxyFactory, + address _moduleProxyFactory, + address _lootSingleton, + address _sharesSingleton + ) external; + + function initialize() external; + + function transferOwnership(address newOwner) external; + function upgradeTo(address newImplementation) external; + function upgradeToAndCall(address newImplementation, bytes memory data) external payable; + function renounceOwnership() external; + + function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce) + external + returns (address); + function summonBaalFromReferrer( + bytes memory initializationParams, + bytes[] memory initializationActions, + uint256 _saltNonce, + bytes32 referrer + ) external payable returns (address); + + function deployAndSetupSafe(address _moduleAddr) external returns (address); + function deployTokens(string memory _name, string memory _symbol) + external + returns (address lootToken, address sharesToken); + + function encodeMultisend(bytes[] memory _calls, address _target) + external + pure + returns (bytes memory encodedMultisend); + function addrsVersion() external view returns (uint256); + function gnosisFallbackLibrary() external view returns (address); + function gnosisMultisendLibrary() external view returns (address); + function gnosisSingleton() external view returns (address); + function lootSingleton() external view returns (address); + function sharesSingleton() external view returns (address); + function owner() external view returns (address); + function proxiableUUID() external view returns (bytes32); + function template() external view returns (address); +} diff --git a/lib/Baal/contracts/interfaces/IBaalToken.sol b/lib/Baal/contracts/interfaces/IBaalToken.sol new file mode 100644 index 0000000..d2516f3 --- /dev/null +++ b/lib/Baal/contracts/interfaces/IBaalToken.sol @@ -0,0 +1,68 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IBaalToken { + function name() external view returns (string memory); + + function symbol() external view returns (string memory); + + function setUp(string memory _name, string memory _symbol) external; + + function mint(address recipient, uint256 amount) external; + + function burn(address account, uint256 amount) external; + + function pause() external; + + function unpause() external; + + function paused() external view returns (bool); + + function transferOwnership(address newOwner) external; + + function owner() external view returns (address); + + function balanceOf(address account) external view returns (uint256); + + function totalSupply() external view returns (uint256); + + function snapshot() external returns(uint256); + + function getCurrentSnapshotId() external returns(uint256); + + function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256); + + function totalSupplyAt(uint256 snapshotId) external view returns (uint256); + + // below is shares token specific + struct Checkpoint { + uint32 fromTimePoint; + uint256 votes; + } + + function getPastVotes(address account, uint256 timePoint) external view returns (uint256); + + function numCheckpoints(address) external view returns (uint256); + + function getCheckpoint(address, uint256) + external + view + returns (Checkpoint memory); + + function getVotes(address account) external view returns (uint256); + + function delegates(address account) external view returns (address); + + function delegationNonces(address account) external view returns (uint256); + + function delegate(address delegatee) external; + + function delegateBySig( + address delegatee, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) external; +} diff --git a/lib/Baal/contracts/interfaces/IGovernorShaman.sol b/lib/Baal/contracts/interfaces/IGovernorShaman.sol new file mode 100644 index 0000000..ea9170a --- /dev/null +++ b/lib/Baal/contracts/interfaces/IGovernorShaman.sol @@ -0,0 +1,8 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IGovernorShaman { + function isGovernor(address shaman) external view returns (bool); + // Governor Only + function setGovernanceConfig(bytes memory _governanceConfig) external; +} diff --git a/lib/Baal/contracts/interfaces/IManagerShaman.sol b/lib/Baal/contracts/interfaces/IManagerShaman.sol new file mode 100644 index 0000000..905b43c --- /dev/null +++ b/lib/Baal/contracts/interfaces/IManagerShaman.sol @@ -0,0 +1,15 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IManagerShaman { + + function isManager(address shaman) external view returns (bool); + + // Manager Only + function mintShares(address[] calldata to, uint256[] calldata amount) external; + function burnShares(address[] calldata from, uint256[] calldata amount) external; + + function mintLoot(address[] calldata to, uint256[] calldata amount) external; + function burnLoot(address[] calldata from, uint256[] calldata amount) external; + +} diff --git a/lib/Baal/contracts/interfaces/IPoster.sol b/lib/Baal/contracts/interfaces/IPoster.sol new file mode 100644 index 0000000..ba23f0e --- /dev/null +++ b/lib/Baal/contracts/interfaces/IPoster.sol @@ -0,0 +1,6 @@ +//SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +interface IPoster { + function post(string calldata content, string calldata tag) external; +} diff --git a/lib/Baal/contracts/mock/BaalLessToken.sol b/lib/Baal/contracts/mock/BaalLessToken.sol new file mode 100644 index 0000000..72c936f --- /dev/null +++ b/lib/Baal/contracts/mock/BaalLessToken.sol @@ -0,0 +1,70 @@ +pragma solidity 0.8.7; +//SPDX-License-Identifier: MIT + +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import "../utils/BaalVotes.sol"; +import "../interfaces/IBaal.sol"; + +// import "hardhat/console.sol"; + +/// @title Shares +/// @notice Accounting for Baal non voting shares +contract BaalLessShares is BaalVotes, OwnableUpgradeable, UUPSUpgradeable { + // Baal Config + IBaal public baal; + uint8 public version; + + constructor() { + _disableInitializers(); + } + + /// @notice Configure shares - called by Baal on summon + /// @param _version new version + function setUp(uint8 _version) + external + reinitializer(_version) + { + baal = IBaal(address(0)); /*Configure Baal to setup sender*/ + version = _version; + __Ownable_init(); + __UUPSUpgradeable_init(); + } + + + /// @notice owner-only function to mint shares. + /// @param recipient Address to receive shares + /// @param amount Amount to mint + function mint(address recipient, uint256 amount) external onlyOwner { + unchecked { + if (totalSupply() + amount <= type(uint256).max / 2) { + _mint(recipient, amount); + } + } + } + + /// @notice owner-only function to burn shares. + /// @param account Address to lose shares + /// @param amount Amount to burn + function burn(address account, uint256 amount) external onlyOwner { + _burn(account, amount); + } + + /// @notice new before transfer + /// @dev Allows transfers if msg.sender is Baal which enables minting and burning + /// @param from The address of the source account. + /// @param to The address of the destination account. + /// @param amount The number of `shares` tokens to transfer. + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal override(BaalVotes) { + super._beforeTokenTransfer(from, to, amount); + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} +} diff --git a/lib/Baal/contracts/mock/MockBaal.sol b/lib/Baal/contracts/mock/MockBaal.sol new file mode 100644 index 0000000..b4abce5 --- /dev/null +++ b/lib/Baal/contracts/mock/MockBaal.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +import "@openzeppelin/contracts/proxy/Clones.sol"; + +import "../Baal.sol"; + +contract MockBaal { + bool public lootPaused; + IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/ + + constructor( + address payable _lootSingleton, + string memory _name, + string memory _symbol + ) { + /*Clone loot singleton using EIP1167 minimal proxy pattern*/ + lootToken = IBaalToken(Clones.clone(_lootSingleton)); + lootToken.setUp( + string(abi.encodePacked(_name, " LOOT")), + string(abi.encodePacked(_symbol, "-LOOT")) + ); + } + + function setLootPaused(bool paused) external { + if(!lootToken.paused() && paused){ + lootToken.pause(); + } else if(lootToken.paused() && !paused){ + lootToken.unpause(); + } + lootPaused = paused; + } + + function mintLoot(address _to, uint256 _amount) external { + lootToken.mint(_to, _amount); + } + + function burnLoot(address _from, uint256 _amount) external { + lootToken.burn(_from, _amount); + } +} diff --git a/lib/Baal/contracts/mock/TestAvatar.sol b/lib/Baal/contracts/mock/TestAvatar.sol new file mode 100644 index 0000000..73abee7 --- /dev/null +++ b/lib/Baal/contracts/mock/TestAvatar.sol @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: LGPL-3.0-only +pragma solidity 0.8.7; + +contract Enum { + enum Operation { + Call, + DelegateCall + } +} + +contract TestAvatar { + address public module; + + receive() external payable {} + + function enableModule(address _module) external { + module = _module; + } + + function disableModule(address, address) external { + module = address(0); + } + + function isModuleEnabled(address _module) external view returns (bool) { + if (module == _module) { + return true; + } else { + return false; + } + } + + function execTransactionFromModule( + address payable to, + uint256 value, + bytes calldata data, + uint8 operation + ) external returns (bool success) { + require(msg.sender == module, "Not authorized"); + if (operation == 1) (success, ) = to.delegatecall(data); + else (success, ) = to.call{value: value}(data); + } + + function execTransactionFromModuleReturnData( + address payable to, + uint256 value, + bytes calldata data, + uint8 operation + ) external returns (bool success, bytes memory returnData) { + require(msg.sender == module, "Not authorized"); + if (operation == 1) (success, ) = to.delegatecall(data); + else (success, returnData) = to.call{value: value}(data); + } + + function getModulesPaginated(address, uint256 pageSize) + external + view + returns (address[] memory array, address next) + { + // Init array with max page size + array = new address[](pageSize); + + array[0] = module; + next = module; + } +} diff --git a/lib/Baal/contracts/mock/TestERC20.sol b/lib/Baal/contracts/mock/TestERC20.sol new file mode 100644 index 0000000..befae52 --- /dev/null +++ b/lib/Baal/contracts/mock/TestERC20.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; + +/// @notice Basic ERC20 implementation. +contract TestERC20 { + string public name; + string public symbol; + uint8 public constant decimals = 18; + uint256 public totalSupply; + + mapping(address => uint256) public balanceOf; + mapping(address => mapping(address => uint256)) public allowance; + + event Transfer(address indexed from, address indexed to, uint256 amount); + event Approval(address indexed owner, address indexed spender, uint256 amount); + + constructor(string memory _name, string memory _symbol, uint256 _totalSupply) { + name = _name; + symbol = _symbol; + totalSupply = _totalSupply; + balanceOf[msg.sender] = _totalSupply; + emit Transfer(address(0), msg.sender, _totalSupply); + } + + function approve(address to, uint256 amount) external returns (bool) { + allowance[msg.sender][to] = amount; + emit Approval(msg.sender, to, amount); + return true; + } + + function transfer(address to, uint256 amount) external returns (bool) { + balanceOf[msg.sender] -= amount; + balanceOf[to] += amount; + emit Transfer(msg.sender, to, amount); + return true; + } + + function transferFrom( + address from, + address to, + uint256 amount + ) external returns (bool) { + if (allowance[from][msg.sender] != type(uint256).max) + allowance[from][msg.sender] -= amount; + + balanceOf[from] -= amount; + balanceOf[to] += amount; + emit Transfer(from, to, amount); + return true; + } +} diff --git a/lib/Baal/contracts/tools/TributeMinion.sol b/lib/Baal/contracts/tools/TributeMinion.sol new file mode 100644 index 0000000..6dd0e78 --- /dev/null +++ b/lib/Baal/contracts/tools/TributeMinion.sol @@ -0,0 +1,176 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; +import "../Baal.sol"; + +interface IERC20 { + function transferFrom( + address from, + address to, + uint256 value + ) external returns (bool); +} + +contract TributeMinion { + event TributeProposal( + address indexed baal, + address token, + uint256 amount, + address recipient, + uint256 proposalId + ); + struct Escrow { + address token; + address applicant; + uint256 amount; + bool released; + address safe; + } + mapping(address => mapping(uint256 => Escrow)) public escrows; + + event EscrowReleased( + address indexed baal, + uint32 proposalId, + address applicant, + address safe, + uint256 amount + ); + + function encodeTributeProposal( + address baal, + uint256 shares, + uint256 loot, + address recipient, + uint32 proposalId, + address escrow + ) public pure returns (bytes memory) { + // Workaround for solidity dynamic memory array + address[] memory _recipients = new address[](1); + _recipients[0] = recipient; + + bytes memory _releaseEscrow = abi.encodeWithSignature( + "releaseEscrow(address,uint32)", + baal, + proposalId + ); + + bytes memory tributeMultisend = abi.encodePacked( + uint8(0), + escrow, + uint256(0), + uint256(_releaseEscrow.length), + bytes(_releaseEscrow) + ); + + if (shares > 0) { + // Workaround for solidity dynamic memory array + uint256[] memory _shares = new uint256[](1); + _shares[0] = shares; + + bytes memory _issueShares = abi.encodeWithSignature( + "mintShares(address[],uint256[])", + _recipients, + _shares + ); + + tributeMultisend = abi.encodePacked( + tributeMultisend, + uint8(0), + baal, + uint256(0), + uint256(_issueShares.length), + bytes(_issueShares) + ); + } + if (loot > 0) { + // Workaround for solidity dynamic memory array + uint256[] memory _loot = new uint256[](1); + _loot[0] = loot; + + bytes memory _issueLoot = abi.encodeWithSignature( + "mintLoot(address[],uint256[])", + _recipients, + _loot + ); + + tributeMultisend = abi.encodePacked( + tributeMultisend, + uint8(0), + address(baal), + uint256(0), + uint256(_issueLoot.length), + bytes(_issueLoot) + ); + } + + bytes memory _multisendAction = abi.encodeWithSignature( + "multiSend(bytes)", + tributeMultisend + ); + return _multisendAction; + } + + function submitTributeProposal( + Baal baal, + address token, + uint256 amount, + uint256 shares, + uint256 loot, + uint32 expiration, + uint256 baalgas, + string memory details + ) external payable { + uint32 proposalId = baal.proposalCount() + 1; + + bytes memory encodedProposal = encodeTributeProposal( + address(baal), + shares, + loot, + msg.sender, + proposalId, + address(this) + ); + + escrows[address(baal)][proposalId] = Escrow( + token, + msg.sender, + amount, + false, + baal.target() + ); + + baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details); + + emit TributeProposal( + address(baal), + token, + amount, + msg.sender, + proposalId + ); + } + + function releaseEscrow(address _baal, uint32 _proposalId) external { + Baal baal = Baal(_baal); + Escrow storage escrow = escrows[address(baal)][_proposalId]; + require(!escrow.released, "Already released"); + + bool[4] memory status = baal.getProposalStatus(_proposalId); + require(status[2], "Not passed"); + escrow.released = true; + + IERC20 token = IERC20(escrow.token); + + emit EscrowReleased( + _baal, + _proposalId, + escrow.applicant, + escrow.safe, + escrow.amount + ); + + require( + token.transferFrom(escrow.applicant, escrow.safe, escrow.amount), + "Transfer failed" + ); + } +} diff --git a/lib/Baal/contracts/utils/BaalVotes.sol b/lib/Baal/contracts/utils/BaalVotes.sol new file mode 100644 index 0000000..925397b --- /dev/null +++ b/lib/Baal/contracts/utils/BaalVotes.sol @@ -0,0 +1,252 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.7; +import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; +import "./DelegationEIP712Upgradeable.sol"; + +/** + * @dev similar to Openzeplin ERC20Votes + * + * uses timestamp instead of block.number and auto self delegates. + * + * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either + * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting + * power can be queried through the public accessors {getPriorVotes}. + * + */ +abstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable { + using ECDSAUpgradeable for bytes32; + + struct Checkpoint { + /*Baal checkpoint for marking number of delegated votes*/ + uint32 fromTimePoint; /*unix time for referencing voting balance*/ + uint256 votes; /*votes at given unix time*/ + } + + // DELEGATE TRACKING + mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/ + mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/ + mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/ + mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/ + + // SIGNATURE HELPERS + bytes32 constant DELEGATION_TYPEHASH = keccak256("Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)"); + + event DelegateChanged( + address indexed delegator, + address indexed fromDelegate, + address indexed toDelegate + ); /*emits when an account changes its voting delegate*/ + event DelegateVotesChanged( + address indexed delegate, + uint256 previousBalance, + uint256 newBalance + ); /*emits when a delegate account's voting balance changes*/ + + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal virtual override { + super._beforeTokenTransfer(from, to, amount); + + /*If recipient is receiving their first shares, auto-self delegate*/ + if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) { + delegates[to] = to; + } + + _moveDelegates(delegates[from], delegates[to], amount); + } + + /// @notice Delegate votes from user to `delegatee`. + /// @param delegatee The address to delegate votes to. + function delegate(address delegatee) external virtual { + _delegate(msg.sender, delegatee); + } + + /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature. + /// @param delegatee The address to delegate 'votes' to. + /// @param nonce The contract state required to match the signature. + /// @param expiry The time at which to expire the signature. + /// @param v The v signature + /// @param r The r signature + /// @param s The s signature + function delegateBySig( + address delegatee, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) public { + require(now() <= expiry, "ERC20Votes: signature expired"); + address signer = ECDSAUpgradeable.recover( + _hashTypedDataV4Delegation( + keccak256( + abi.encode( + DELEGATION_TYPEHASH, + keccak256(abi.encodePacked(name())), + delegatee, + nonce, + expiry + ) + ) + ), + v, + r, + s + ); + require(signer != address(0), "ERC20Votes: invalid signer (0x0)"); + require(nonce == delegationNonces[signer], "ERC20Votes: invalid nonce"); + + delegationNonces[signer]++; + _delegate(signer, delegatee); + } + + /// @notice Delegates Baal voting weight. + /// @param delegator The address to delegate 'votes' from. + /// @param delegatee The address to delegate 'votes' to. + function _delegate(address delegator, address delegatee) internal virtual { + require(balanceOf(delegator) > 0, "!shares"); + address currentDelegate = delegates[delegator]; + delegates[delegator] = delegatee; + + _moveDelegates( + currentDelegate, + delegatee, + uint256(balanceOf(delegator)) + ); + + emit DelegateChanged(delegator, currentDelegate, delegatee); + } + + /// @notice Elaborates delegate update - cf., 'Compound Governance'. + /// @param srcRep The address to delegate 'votes' from. + /// @param dstRep The address to delegate 'votes' to. + /// @param amount The amount of votes to delegate + function _moveDelegates( + address srcRep, + address dstRep, + uint256 amount + ) private { + unchecked { + if (srcRep != dstRep && amount != 0) { + if (srcRep != address(0)) { + uint256 srcRepNum = numCheckpoints[srcRep]; + uint256 srcRepOld = srcRepNum != 0 + ? getCheckpoint(srcRep, srcRepNum - 1).votes + : 0; + uint256 srcRepNew = srcRepOld - amount; + _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); + } + + if (dstRep != address(0)) { + uint256 dstRepNum = numCheckpoints[dstRep]; + uint256 dstRepOld = dstRepNum != 0 + ? getCheckpoint(dstRep, dstRepNum - 1).votes + : 0; + uint256 dstRepNew = dstRepOld + amount; + _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); + } + } + } + } + + /// @notice Elaborates delegate update - cf., 'Compound Governance'. + /// @param delegatee The address to snapshot + /// @param nCheckpoints The number of checkpoints delegatee has + /// @param oldVotes The number of votes the delegatee had + /// @param newVotes The number of votes the delegate has now + function _writeCheckpoint( + address delegatee, + uint256 nCheckpoints, + uint256 oldVotes, + uint256 newVotes + ) private { + uint32 timePoint = uint32(now()); + + unchecked { + if ( + nCheckpoints != 0 && + checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint + ) { + checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; + } else { + checkpoints[delegatee][nCheckpoints] = Checkpoint( + timePoint, + newVotes + ); + numCheckpoints[delegatee] = nCheckpoints + 1; + } + } + + emit DelegateVotesChanged(delegatee, oldVotes, newVotes); + } + + /// @notice Returns the current timepoint. + /// @return timePoint returns unix epoch timestamp + function now() public view returns (uint256 timePoint) { + return block.timestamp; + } + + /// @notice Returns the prior number of `votes` for `account` as of `timePoint`. + /// @param account The user to check `votes` for. + /// @param timePoint The unix time to check `votes` for. + /// @return votes Past `votes` delegated to `account`. + function getPastVotes(address account, uint256 timePoint) + external + view + virtual + returns (uint256 votes) + { + require(timePoint < now(), "!determined"); /* Prior votes must be in the past*/ + + uint256 nCheckpoints = numCheckpoints[account]; + if (nCheckpoints == 0) return 0; + + unchecked { + if ( + getCheckpoint(account, nCheckpoints - 1).fromTimePoint <= + timePoint + ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/ + if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0; + uint256 lower = 0; + uint256 upper = nCheckpoints - 1; + while (upper > lower) { + /* Binary search to look for highest timePoint before desired timePoint*/ + uint256 center = upper - (upper - lower) / 2; + Checkpoint memory cp = getCheckpoint(account, center); + if (cp.fromTimePoint == timePoint) return cp.votes; + else if (cp.fromTimePoint < timePoint) lower = center; + else upper = center - 1; + } + votes = getCheckpoint(account, lower).votes; + } + } + + /// @notice Returns the current delegated `vote` balance for `account`. + /// @param account The user to check delegated `votes` for. + /// @return votes Current `votes` delegated to `account`. + function getVotes(address account) + external + view + virtual + returns (uint256 votes) + { + uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/ + unchecked { + votes = nCheckpoints != 0 + ? getCheckpoint(account, nCheckpoints - 1).votes + : 0; + } + } + + function getCheckpoint(address delegatee, uint256 nCheckpoints) + public + view + virtual + returns (Checkpoint memory) + { + return checkpoints[delegatee][nCheckpoints]; + } +} diff --git a/lib/Baal/contracts/utils/DelegationEIP712Upgradeable.sol b/lib/Baal/contracts/utils/DelegationEIP712Upgradeable.sol new file mode 100644 index 0000000..e591ce5 --- /dev/null +++ b/lib/Baal/contracts/utils/DelegationEIP712Upgradeable.sol @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) + +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; + +/** + * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. + * + * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, + * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding + * they need in their contracts using a combination of `abi.encode` and `keccak256`. + * + * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding + * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA + * ({_hashTypedDataV4Delegation}). + * + * The implementation of the domain separator was designed to be as efficient as possible while still properly updating + * the chain id to protect against replay attacks on an eventual fork of the chain. + * + * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method + * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. + * + * _Available since v3.4._ + * + * @custom:storage-size 52 + */ +abstract contract DelegationEIP712Upgradeable is Initializable { + /* solhint-disable var-name-mixedcase */ + bytes32 private _HASHED_NAME_DELEGATION; + bytes32 private _HASHED_VERSION_DELEGATION; + bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); + + /* solhint-enable var-name-mixedcase */ + + /** + * @dev Initializes the domain separator and parameter caches. + * + * The meaning of `name` and `version` is specified in + * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: + * + * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. + * - `version`: the current major version of the signing domain. + * + * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart + * contract upgrade]. + */ + function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing { + __EIP712_init_unchained_delegation(name, version); + } + + function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing { + bytes32 hashedName = keccak256(bytes(name)); + bytes32 hashedVersion = keccak256(bytes(version)); + _HASHED_NAME_DELEGATION = hashedName; + _HASHED_VERSION_DELEGATION = hashedVersion; + } + + /** + * @dev Returns the domain separator for the current chain. + */ + function _domainSeparatorV4Delegation() internal view returns (bytes32) { + return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation()); + } + + function _buildDomainSeparatorDelegation( + bytes32 typeHash, + bytes32 nameHash, + bytes32 versionHash + ) private view returns (bytes32) { + return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); + } + + /** + * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this + * function returns the hash of the fully encoded EIP712 message for this domain. + * + * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: + * + * ```solidity + * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode( + * keccak256("Mail(address to,string contents)"), + * mailTo, + * keccak256(bytes(mailContents)) + * ))); + * address signer = ECDSA.recover(digest, signature); + * ``` + */ + function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) { + return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash); + } + + /** + * @dev The hash of the name parameter for the EIP712 domain. + * + * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs + * are a concern. + */ + function _EIP712NameHashDelegation() internal virtual view returns (bytes32) { + return _HASHED_NAME_DELEGATION; + } + + /** + * @dev The hash of the version parameter for the EIP712 domain. + * + * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs + * are a concern. + */ + function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) { + return _HASHED_VERSION_DELEGATION; + } + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[50] private __gap; +} diff --git a/lib/Baal/contracts/utils/Poster.sol b/lib/Baal/contracts/utils/Poster.sol new file mode 100644 index 0000000..7022763 --- /dev/null +++ b/lib/Baal/contracts/utils/Poster.sol @@ -0,0 +1,22 @@ +/* +██████╗ ██████╗ ███████╗████████╗███████╗██████╗ +██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗ +██████╔╝██║ ██║███████╗ ██║ █████╗ ██████╔╝ +██╔═══╝ ██║ ██║╚════██║ ██║ ██╔══╝ ██╔══██╗ +██║ ╚██████╔╝███████║ ██║ ███████╗██║ ██║ +╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ +A ridiculously simple general purpose social media smart contract. +It takes two strings (content and tag) as parameters and emits those strings, along with msg.sender, as an event. That's it. +Made with ❤️ by Auryn.eth +*/ +// SPDX-License-Identifier: LGPL-3.0-only + +pragma solidity 0.8.7; + +contract Poster { + event NewPost(address indexed user, string content, string indexed tag); + + function post(string calldata content, string calldata tag) external { + emit NewPost(msg.sender, content, tag); + } +} diff --git a/lib/Baal/deploy/000_deploy_safe.ts b/lib/Baal/deploy/000_deploy_safe.ts new file mode 100644 index 0000000..60f3931 --- /dev/null +++ b/lib/Baal/deploy/000_deploy_safe.ts @@ -0,0 +1,61 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + + const { deployments, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + + if (network.name === 'hardhat') { + console.log('Deploying Safe infra locally...'); + + const { deploy } = deployments; + + const multisendDeployed = await deploy('MultiSend', { + contract: 'MultiSend', + from: deployer, + args: [], + log: false, + }); + + const safeDeployed = await deploy('GnosisSafe', { + contract: 'GnosisSafe', + from: deployer, + args: [], + log: false, + }); + + const cfhDeployed = await deploy('CompatibilityFallbackHandler', { + contract: 'CompatibilityFallbackHandler', + from: deployer, + args: [], + log: false, + }); + + const safepfDeployed = await deploy('GnosisSafeProxyFactory', { + contract: 'GnosisSafeProxyFactory', + from: deployer, + args: [], + log: false, + }); + + const safemfDeployed = await deploy('ModuleProxyFactory', { + contract: 'ModuleProxyFactory', + from: deployer, + args: [], + log: false, + }); + + console.log('Deployed Safe Infra:\n'); + console.log('Multisend ->', multisendDeployed.address); + console.log('CompatibilityFallbackHandler ->', cfhDeployed.address); + console.log('ModuleProxyFactory ->', safemfDeployed.address); + console.log('Safe Singleton ->', safeDeployed.address); + console.log('GnosisSafeProxyFactor ->y', safepfDeployed.address); + } + +}; + +export default deployFn; +deployFn.tags = ['Infra', 'Safe']; diff --git a/lib/Baal/deploy/001_deploy_poster.ts b/lib/Baal/deploy/001_deploy_poster.ts new file mode 100644 index 0000000..4ea6673 --- /dev/null +++ b/lib/Baal/deploy/001_deploy_poster.ts @@ -0,0 +1,27 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + console.log('\n\nDeploying Poster on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + await deploy('Poster', { + contract: 'Poster', + from: deployer, + args: [], + log: true, + }); +} + +export default deployFn; +deployFn.tags = ['Infra', 'Poster']; diff --git a/lib/Baal/deploy/002_deploy_tribute.ts b/lib/Baal/deploy/002_deploy_tribute.ts new file mode 100644 index 0000000..e4e032e --- /dev/null +++ b/lib/Baal/deploy/002_deploy_tribute.ts @@ -0,0 +1,27 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + console.log('\n\nDeploying TributeMinion on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + await deploy('TributeMinion', { + contract: 'TributeMinion', + from: deployer, + args: [], + log: true, + }); +} + +export default deployFn; +deployFn.tags = ['TributeMinion']; diff --git a/lib/Baal/deploy/003_deploy_b_factory.ts b/lib/Baal/deploy/003_deploy_b_factory.ts new file mode 100644 index 0000000..b6e0423 --- /dev/null +++ b/lib/Baal/deploy/003_deploy_b_factory.ts @@ -0,0 +1,91 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +import { getSetupAddresses } from '../src/addresses/setup'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const _addresses = await getSetupAddresses(chainId, network, deployments); + + if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') { + console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO); + return; + } + + console.log('\n\nDeploying BaalSummoner factory on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + + const lootSingleton = await deploy('Loot', { + contract: 'Loot', + from: deployer, + args: [], + log: true, + }); + + const sharesSingleton = await deploy('Shares', { + contract: 'Shares', + from: deployer, + args: [], + log: true, + }); + + const baalSingleton = await deploy('Baal', { + contract: 'Baal', + from: deployer, + args: [], + log: true, + }); + + const summonerDeeployed = await deploy('BaalSummoner', { + contract: 'BaalSummoner', + from: deployer, + args: [], + proxy: { + proxyContract: 'UUPS', + methodName: 'initialize', + }, + log: true, + }); + console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash); + + // set addresses of templates and libraries + const tx_1 = await deployments.execute('BaalSummoner', { + from: deployer, + }, 'setAddrs', + baalSingleton.address, + _addresses.gnosisSingleton, + _addresses.gnosisFallbackLibrary, + _addresses.gnosisMultisendLibrary, + _addresses.gnosisSafeProxyFactory, + _addresses.moduleProxyFactory, + lootSingleton.address, + sharesSingleton.address + ); + console.log('BaalSummoner setAddrs Tx ->', tx_1.transactionHash); + + + // transfer ownership to DAO + if (network.name !== 'hardhat') { + console.log("BaalSummoner transferOwnership to", _addresses.DAO); + const tx_2 = await deployments.execute('BaalSummoner', { + from: deployer, + }, 'transferOwnership', + _addresses.DAO + ); + console.log('BaalSummoner transferOwnership Tx ->', tx_2.transactionHash); + } +}; + +export default deployFn; +deployFn.tags = ['Factories', 'BaalSummoner']; diff --git a/lib/Baal/deploy/004_deploy_bv_factory.ts b/lib/Baal/deploy/004_deploy_bv_factory.ts new file mode 100644 index 0000000..0ad5cc3 --- /dev/null +++ b/lib/Baal/deploy/004_deploy_bv_factory.ts @@ -0,0 +1,63 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +import { getSetupAddresses } from '../src/addresses/setup'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const _addresses = await getSetupAddresses(chainId, network, deployments); + + if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') { + console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO); + return; + } + + console.log('\n\Deploying BaalAndVaultSummoner factory on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + + const baalSummoner = await deployments.get('BaalSummoner'); + console.log('BaalSummoner address', baalSummoner.address); + + const summonerDeeployed = await deploy('BaalAndVaultSummoner', { + contract: 'BaalAndVaultSummoner', + from: deployer, + args: [], + proxy: { + proxyContract: 'UUPS', + methodName: 'initialize', + }, + log: true, + }); + console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash); + + const tx_3 = await deployments.execute('BaalAndVaultSummoner', { + from: deployer, + }, 'setSummonerAddr', + baalSummoner.address + ); + console.log('BaalAndVaultSummoner setSummonerAddr Tx ->', tx_3.transactionHash); + + + if (network.name !== 'hardhat') { + console.log("BaalAndVaultSummoner transferOwnership to", _addresses.DAO); + const tx_4 = await deployments.execute('BaalAndVaultSummoner', { + from: deployer, + }, 'transferOwnership', + _addresses.DAO + ); + console.log('BaalAndVaultSummoner transferOwnership Tx ->', tx_4.transactionHash); + } +}; + +export default deployFn; +deployFn.tags = ['Factories', 'BaalAndVaultSummoner']; diff --git a/lib/Baal/deploy/005_deploy_bt_factory.ts b/lib/Baal/deploy/005_deploy_bt_factory.ts new file mode 100644 index 0000000..9e04ab4 --- /dev/null +++ b/lib/Baal/deploy/005_deploy_bt_factory.ts @@ -0,0 +1,72 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DeployFunction } from 'hardhat-deploy/types'; + +import { deployments as logDeployments } from '../src/addresses/deployed'; +import { getSetupAddresses } from '../src/addresses/setup'; + +type SupportedNetwork = keyof typeof logDeployments[0]['v103']; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const _addresses = await getSetupAddresses(chainId, network, deployments); + + if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') { + console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO); + return; + } + + console.log('\n\nDeploying BaalAdvTokenSummoner(UUPS) factory on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + + + let baalSummonerAddress = logDeployments[0]['v103'][network.name as SupportedNetwork]?.addresses?.factory; + if (!network.live || !baalSummonerAddress) { + const baal = await deployments.get('BaalSummoner'); + baalSummonerAddress = baal.address; + } + console.log('BaalSummoner address', baalSummonerAddress); + + const summonerDeeployed = await deploy('BaalAdvTokenSummoner', { + contract: 'BaalAdvTokenSummoner', + from: deployer, + args: [], + proxy: { + proxyContract: 'UUPS', + methodName: 'initialize', + }, + log: true, + }); + console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash); + + const tx_1 = await deployments.execute('BaalAdvTokenSummoner', { + from: deployer, + }, 'setSummonerAddr', + baalSummonerAddress + ); + console.log('BaalAdvTokenSummoner setSummonerAddr Tx ->', tx_1.transactionHash); + + // transfer ownership to DAO + if (network.name !== 'hardhat') { + console.log("BaalAdvTokenSummoner transferOwnership to", _addresses.DAO); + const tx_2 = await deployments.execute('BaalAdvTokenSummoner', { + from: deployer, + }, 'transferOwnership', + _addresses.DAO + ); + console.log('BaalAdvTokenSummoner transferOwnership Tx ->', tx_2.transactionHash); + } +}; + +export default deployFn; +deployFn.tags = ['Factories', 'BaalAdvTokenSummoner']; diff --git a/lib/Baal/deploy/006_upgrade_b_factory.ts b/lib/Baal/deploy/006_upgrade_b_factory.ts new file mode 100644 index 0000000..91e5b4e --- /dev/null +++ b/lib/Baal/deploy/006_upgrade_b_factory.ts @@ -0,0 +1,42 @@ +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +const { ethers, upgrades } = require("hardhat"); +import { DeployFunction } from 'hardhat-deploy/types'; + +import { getSetupAddresses } from '../src/addresses/setup'; + +const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + + const { deployments, ethers, getChainId, getNamedAccounts, network } = hre; + + const { deployer } = await getNamedAccounts(); + const chainId = await getChainId(); + + const _addresses = await getSetupAddresses(chainId, network, deployments); + + if ((!_addresses.DAO || _addresses.DAO === ethers.constants.AddressZero) && network.name !== 'hardhat') { + console.log('You need to set DAO address to transfer ownership of summoner', _addresses.DAO); + return; + } + + console.log('\n\nDeploying BaalSummoner factory on network:', network.name); + console.log('Deployer address:', `${chainId}:${deployer}`); + console.log( + 'Deployer balance:', + ethers.utils.formatEther(await ethers.provider.getBalance(deployer)), + ); + + const { deploy } = deployments; + + const summonerDeeployed = await deploy('BaalSummoner', { + contract: 'BaalSummoner', + from: deployer, + args: [], + log: true, + }); + console.log('BaalSummoner deployment Tx ->', summonerDeeployed.transactionHash); + + +}; + +export default deployFn; +deployFn.tags = ['UpgradeBaalSummoner']; diff --git a/lib/Baal/deployments/arbitrumOne/.chainId b/lib/Baal/deployments/arbitrumOne/.chainId new file mode 100644 index 0000000..7df83ec --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/.chainId @@ -0,0 +1 @@ +42161 \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/Baal.json b/lib/Baal/deployments/arbitrumOne/Baal.json new file mode 100644 index 0000000..7d300cf --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x17234C0Ae25AF09fAf57B9D5ea2B93C1f220E800", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner.json b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..53e7202 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner.json @@ -0,0 +1,330 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..92bcfd7 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,262 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..1fd3615 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner.json b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner.json new file mode 100644 index 0000000..fe020f9 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..058320f --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x2a9886Bd3Dc34f05d56650105F5239F441FA2EDd", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..5cd0990 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalSummoner.json b/lib/Baal/deployments/arbitrumOne/BaalSummoner.json new file mode 100644 index 0000000..4aa1841 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0xb08Cc8C343cF6dC20d8cf51Fb2D6C436c6390dAa", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalSummoner_Implementation.json b/lib/Baal/deployments/arbitrumOne/BaalSummoner_Implementation.json new file mode 100644 index 0000000..d8080d3 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/BaalSummoner_Proxy.json b/lib/Baal/deployments/arbitrumOne/BaalSummoner_Proxy.json new file mode 100644 index 0000000..68c9a19 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0xb08Cc8C343cF6dC20d8cf51Fb2D6C436c6390dAa", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/Loot.json b/lib/Baal/deployments/arbitrumOne/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/Poster.json b/lib/Baal/deployments/arbitrumOne/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/Shares.json b/lib/Baal/deployments/arbitrumOne/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/arbitrumOne/TributeMinion.json b/lib/Baal/deployments/arbitrumOne/TributeMinion.json new file mode 100644 index 0000000..73e2382 --- /dev/null +++ b/lib/Baal/deployments/arbitrumOne/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/.chainId b/lib/Baal/deployments/base/.chainId new file mode 100644 index 0000000..2a0c263 --- /dev/null +++ b/lib/Baal/deployments/base/.chainId @@ -0,0 +1 @@ +8453 \ No newline at end of file diff --git a/lib/Baal/deployments/base/Baal.json b/lib/Baal/deployments/base/Baal.json new file mode 100644 index 0000000..217a495 --- /dev/null +++ b/lib/Baal/deployments/base/Baal.json @@ -0,0 +1,2362 @@ +{ + "address": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x26dcbeb0849723a20745216ac3399a13f37d3c0b34b558e37ec8567f24f130df", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "transactionIndex": 6, + "gasUsed": "5162353", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x74c99951139585e994f604d9f9beda17e2b6e78972791cf758f558cb3838be14", + "transactionHash": "0x26dcbeb0849723a20745216ac3399a13f37d3c0b34b558e37ec8567f24f130df", + "logs": [ + { + "transactionIndex": 6, + "blockNumber": 7428456, + "transactionHash": "0x26dcbeb0849723a20745216ac3399a13f37d3c0b34b558e37ec8567f24f130df", + "address": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 25, + "blockHash": "0x74c99951139585e994f604d9f9beda17e2b6e78972791cf758f558cb3838be14" + } + ], + "blockNumber": 7428456, + "cumulativeGasUsed": "6222177", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "928daf6847beb441da40e990eb20d125", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guard_\",\"type\":\"address\"}],\"name\":\"NotIERC165Compliant\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAvatar\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAvatar\",\"type\":\"address\"}],\"name\":\"AvatarSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"}],\"name\":\"CancelProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"ChangedGuard\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"voting\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"grace\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newOffering\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sponsor\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minRetention\",\"type\":\"uint256\"}],\"name\":\"GovernanceConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"adminLock\",\"type\":\"bool\"}],\"name\":\"LockAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"governorLock\",\"type\":\"bool\"}],\"name\":\"LockGovernor\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"managerLock\",\"type\":\"bool\"}],\"name\":\"LockManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"name\":\"LootPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"passed\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"actionFailed\",\"type\":\"bool\"}],\"name\":\"ProcessProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"lootToBurn\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"sharesToBurn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"Ragequit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"SetTrustedForwarder\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"lootPaused\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sharesPaused\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gracePeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"votingPeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalOffering\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorumPercent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sponsorThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minRetentionPercent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalShares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalLoot\",\"type\":\"uint256\"}],\"name\":\"SetupComplete\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"permission\",\"type\":\"uint256\"}],\"name\":\"ShamanSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"name\":\"SharesPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"votingStarts\",\"type\":\"uint256\"}],\"name\":\"SponsorProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalDataHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"selfSponsor\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"SubmitProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"SubmitVote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousTarget\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTarget\",\"type\":\"address\"}],\"name\":\"TargetSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"adminLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"avatar\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"from\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"burnLoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"from\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"burnShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"cancelProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_calls\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"encodeMultisend\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedMultisend\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeAsBaal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGuard\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_guard\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"getProposalStatus\",\"outputs\":[{\"internalType\":\"bool[4]\",\"name\":\"\",\"type\":\"bool[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governorLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gracePeriod\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"guard\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_transactions\",\"type\":\"bytes\"}],\"name\":\"hashOperation\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isGovernor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSponsoredProposalId\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lootToken\",\"outputs\":[{\"internalType\":\"contract IBaalToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"memberVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minRetentionPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"to\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"mintLoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"to\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"mintShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"multisendLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"}],\"name\":\"processProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalOffering\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposals\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"prevProposalId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"votingStarts\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"votingEnds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"graceEnds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"yesVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"noVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTotalSharesAndLootAtVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTotalSharesAtSponsor\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sponsor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"proposalDataHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sharesToBurn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lootToBurn\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"ragequit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"pauseShares\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"pauseLoot\",\"type\":\"bool\"}],\"name\":\"setAdminConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_avatar\",\"type\":\"address\"}],\"name\":\"setAvatar\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_governanceConfig\",\"type\":\"bytes\"}],\"name\":\"setGovernanceConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_guard\",\"type\":\"address\"}],\"name\":\"setGuard\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_shamans\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_permissions\",\"type\":\"uint256[]\"}],\"name\":\"setShamans\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_trustedForwarderAddress\",\"type\":\"address\"}],\"name\":\"setTrustedForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_initializationParams\",\"type\":\"bytes\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"shamans\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharesToken\",\"outputs\":[{\"internalType\":\"contract IBaalToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"sponsorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sponsorThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum Baal.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"submitProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"submitVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"submitVoteWithSig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalLoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"trustedForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"versionRecipient\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"votingNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"burnLoot(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to burn\",\"from\":\"Array of addresses to lose loot\"}},\"burnShares(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to burn\",\"from\":\"Array of addresses to lose shares\"}},\"cancelProposal(uint32)\":{\"details\":\"Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\",\"params\":{\"id\":\"Number of proposal in `proposals` mapping to process for execution.\"}},\"executeAsBaal(address,uint256,bytes)\":{\"details\":\"Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\",\"params\":{\"_data\":\"arbitrary transaction data\",\"_to\":\"address to call\",\"_value\":\"value to include in wei\"}},\"getProposalStatus(uint32)\":{\"params\":{\"id\":\"Number of proposal in proposals\"},\"returns\":{\"_0\":\"[cancelled, processed, passed, actionFailed]\"}},\"isAdmin(address)\":{\"params\":{\"shaman\":\"Address attempting to execute admin permissioned functions\"}},\"isGovernor(address)\":{\"params\":{\"shaman\":\"Address attempting to execute governor permissioned functions\"}},\"isManager(address)\":{\"params\":{\"shaman\":\"Address attempting to execute manager permissioned functions\"}},\"mintLoot(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to mint\",\"to\":\"Array of addresses to mint loot\"}},\"mintShares(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to mint\",\"to\":\"Array of addresses to receive shares\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"processProposal(uint32,bytes)\":{\"details\":\"Proposal must have succeeded, not been processed, not expired, retention threshold must be met\",\"params\":{\"id\":\"Number of proposal in `proposals` mapping to process for execution.\",\"proposalData\":\"Packed multisend data to execute via Gnosis multisend library\"}},\"ragequit(address,uint256,uint256,address[])\":{\"params\":{\"lootToBurn\":\"Baal pure economic weight to burn.\",\"sharesToBurn\":\"Baal voting weight to burn.\",\"to\":\"Account that receives 'fair share'.\",\"tokens\":\"Array of tokens to include in rage quit calculation\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAdminConfig(bool,bool)\":{\"params\":{\"pauseLoot\":\"Turn loot transfers on or off\",\"pauseShares\":\"Turn share transfers on or off\"}},\"setAvatar(address)\":{\"details\":\"Sets the avatar to a new avatar (`newAvatar`).\"},\"setGovernanceConfig(bytes)\":{\"params\":{\"_governanceConfig\":\"Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\"}},\"setGuard(address)\":{\"details\":\"Set a guard that checks transactions before execution.\",\"params\":{\"_guard\":\"The address of the guard to be used or the 0 address to disable the guard.\"}},\"setShamans(address[],uint256[])\":{\"params\":{\"_permissions\":\"Permission level of each shaman in _shamans\",\"_shamans\":\"Addresses of shaman contracts\"}},\"setTarget(address)\":{\"details\":\"Sets the target to a new target (`newTarget`).\"},\"setTrustedForwarder(address)\":{\"params\":{\"_trustedForwarderAddress\":\"Trusted forwarder's address\"}},\"setUp(bytes)\":{\"params\":{\"_initializationParams\":\"Encoded setup information.\"}},\"sponsorProposal(uint32)\":{\"params\":{\"id\":\"Number of proposal in `proposals` mapping to sponsor.\"}},\"state(uint32)\":{\"params\":{\"id\":\"Number of proposal in proposals\"},\"returns\":{\"_0\":\"Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed \\\\-> Cancelled \\\\-> Defeated\"}},\"submitProposal(bytes,uint32,uint256,string)\":{\"params\":{\"details\":\"Context for proposal.\",\"proposalData\":\"Multisend encoded transactions or proposal data\"},\"returns\":{\"_0\":\"proposal Count for submitted proposal.\"}},\"submitVote(uint32,bool)\":{\"params\":{\"approved\":\"If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\",\"id\":\"Number of proposal in `proposals` mapping to cast vote on.\"}},\"submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)\":{\"params\":{\"approved\":\"If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\",\"expiry\":\"Expiration of signature.\",\"id\":\"Number of proposal in `proposals` mapping to cast vote on.\",\"r\":\"r in signature\",\"s\":\"s in signature\",\"v\":\"v in signature\",\"voter\":\"Address of member who submitted vote.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Baal ';_;'.\",\"version\":1},\"userdoc\":{\"errors\":{\"NotIERC165Compliant(address)\":[{\"notice\":\"`guard_` does not implement IERC165.\"}]},\"kind\":\"user\",\"methods\":{\"burnLoot(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to burn loot.\"},\"burnShares(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to burn shares.\"},\"cancelProposal(uint32)\":{\"notice\":\"Cancel proposal prior to execution\"},\"executeAsBaal(address,uint256,bytes)\":{\"notice\":\"Can only be called by the avatar which means this can only be called if passed by another proposal or by a delegated signer on the Safe\"},\"getProposalStatus(uint32)\":{\"notice\":\"Helper to get recorded proposal flags\"},\"hashOperation(bytes)\":{\"notice\":\"Returns the keccak256 hash of calldata\"},\"isAdmin(address)\":{\"notice\":\"Helper to check if shaman permission contains admin capabilities\"},\"isGovernor(address)\":{\"notice\":\"Helper to check if shaman permission contains governor capabilities\"},\"isManager(address)\":{\"notice\":\"Helper to check if shaman permission contains manager capabilities\"},\"isTrustedForwarder(address)\":{\"notice\":\"return if the forwarder is trusted to forward relayed transactions to us. the forwarder is required to verify the sender's signature, and verify the call is not a replay.\"},\"lockAdmin()\":{\"notice\":\"Lock admin so setShamans cannot be called with admin changes\"},\"lockGovernor()\":{\"notice\":\"Lock governor so setShamans cannot be called with governor changes\"},\"lockManager()\":{\"notice\":\"Lock manager so setShamans cannot be called with manager changes\"},\"mintLoot(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to mint loot.\"},\"mintShares(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to mint shares.\"},\"processProposal(uint32,bytes)\":{\"notice\":\"Process `proposal` & execute internal functions.\"},\"ragequit(address,uint256,uint256,address[])\":{\"notice\":\"Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\"},\"setAdminConfig(bool,bool)\":{\"notice\":\"Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\"},\"setAvatar(address)\":{\"notice\":\"Can only be called by the current owner.\"},\"setGovernanceConfig(bytes)\":{\"notice\":\"Baal-or-governance-only function to change periods.\"},\"setShamans(address[],uint256[])\":{\"notice\":\"Baal-only function to set shaman status.\"},\"setTarget(address)\":{\"notice\":\"Can only be called by the current owner.\"},\"setTrustedForwarder(address)\":{\"notice\":\"Baal-or-governance only function to set trusted forwarder for meta-transactions.\"},\"setUp(bytes)\":{\"notice\":\"Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\"},\"sponsorProposal(uint32)\":{\"notice\":\"Sponsor proposal to Baal `members` for approval within voting period.\"},\"state(uint32)\":{\"notice\":\"State helper to determine proposal state\"},\"submitProposal(bytes,uint32,uint256,string)\":{\"notice\":\"Submit proposal to Baal `members` for approval within given voting period.\"},\"submitVote(uint32,bool)\":{\"notice\":\"Submit vote - proposal must exist & voting period must not have ended.\"},\"submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)\":{\"notice\":\"Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\"},\"totalLoot()\":{\"notice\":\"Helper to check total supply of child loot contract\"},\"totalShares()\":{\"notice\":\"Helper to check total supply of child shares contract\"},\"totalSupply()\":{\"notice\":\"Helper to check total supply of loot and shares\"}},\"notice\":\"Flexible guild contract inspired by Moloch DAO framework.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Baal.sol\":\"Baal\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615bef80620000f46000396000f3fe6080604052600436106103a25760003560e01c80638009ba1f116101e7578063cf043df31161010d578063ed0cdf15116100a0578063f460124d1161006f578063f460124d14610b99578063f81cbd2614610bb9578063fab514c014610bcf578063fe47668614610bef57600080fd5b8063ed0cdf1514610b19578063ee4d88ed14610b39578063f2fde38b14610b59578063f3ae241514610b7957600080fd5b8063da35c664116100dc578063da35c66414610a95578063da74222814610ab9578063e19a9dd914610ad9578063e43581b814610af957600080fd5b8063cf043df3146109fa578063d33defc714610a1a578063d4b8399214610a55578063d61f27ae14610a7557600080fd5b8063a4f9edbf11610185578063b634e4e011610154578063b634e4e014610979578063c00d077514610996578063c4e931f6146109bd578063c9106389146109dc57600080fd5b8063a4f9edbf14610904578063acca30a214610924578063b1e3f40c14610939578063b3c98bbb1461095957600080fd5b806398a527cc116101c157806398a527cc1461088a5780639a2f747f146108aa578063a06db7dc146108c0578063a26ec96e146108e457600080fd5b80638009ba1f1461083657806383bf8459146108565780638da5cb5b1461086c57600080fd5b80634526d846116102cc5780635ec286961161026a578063715018a611610239578063715018a6146107c3578063776d1a01146107d85780637ceab3b1146107f85780637da0a8771461081857600080fd5b80635ec286961461074e578063635e99aa1461076e57806367f61f0714610783578063706a6e93146107a357600080fd5b806352ba1da7116102a657806352ba1da7146106a4578063572b6c05146106d15780635aef7de6146107005780635cfd6f7e1461073857600080fd5b80634526d846146106355780634630affc14610655578063486ff0cd1461068257600080fd5b8063136d731a11610344578063258bfe2f11610313578063258bfe2f146105c05780633232444c146105e05780633a82ffc81461060d5780633a98ef391461062057600080fd5b8063136d731a1461055357806316fd265d1461056857806318160ddd1461057d57806324d7806c146105a057600080fd5b8063056b0dcd11610380578063056b0dcd146104d1578063086cfca8146104f35780630a796e19146105135780630f656a211461053357600080fd5b8063013cf08b146103a7578063027cdf451461046e57806302a251a314610498575b600080fd5b3480156103b357600080fd5b5061044c6103c2366004614d28565b60d9602052600090815260409020805460018201546002830154600384015460048501546005860154600787015460089097015463ffffffff80881698600160201b8904821698600160401b8104831698600160601b8204841698600160801b8304851698600160a01b90930490941696909593949193909290916001600160a01b03909116908d565b6040516104659d9c9b9a99989796959493929190614d41565b60405180910390f35b34801561047a57600080fd5b5060d5546104889060ff1681565b6040519015158152602001610465565b3480156104a457600080fd5b5060d0546104bc90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610465565b3480156104dd57600080fd5b506104f16104ec366004614ded565b610c1c565b005b3480156104ff57600080fd5b506104f161050e366004614e4b565b611127565b34801561051f57600080fd5b506104f161052e366004614e7a565b611181565b34801561053f57600080fd5b506104f161054e366004614ee2565b6114b5565b34801561055f57600080fd5b506104f1611763565b34801561057457600080fd5b506104f16117f4565b34801561058957600080fd5b5061059261186e565b604051908152602001610465565b3480156105ac57600080fd5b506104886105bb366004614e4b565b61188f565b3480156105cc57600080fd5b506105926105db366004615010565b6118d4565b3480156105ec57600080fd5b506105926105fb366004614e4b565b60d66020526000908152604090205481565b61059261061b36600461508d565b611904565b34801561062c57600080fd5b50610592611f55565b34801561064157600080fd5b506104f1610650366004614ee2565b611fc3565b34801561066157600080fd5b50610675610670366004614e7a565b612092565b604051610465919061511a565b34801561068e57600080fd5b50610697612103565b60405161046591906151a9565b3480156106b057600080fd5b506105926106bf366004614e4b565b60d86020526000908152604090205481565b3480156106dd57600080fd5b506104886106ec366004614e4b565b60ce546001600160a01b0391821691161490565b34801561070c57600080fd5b50606654610720906001600160a01b031681565b6040516001600160a01b039091168152602001610465565b34801561074457600080fd5b5061059260d35481565b34801561075a57600080fd5b506104f1610769366004614ee2565b612191565b34801561077a57600080fd5b50610592612260565b34801561078f57600080fd5b506104f161079e3660046151bc565b6122aa565b3480156107af57600080fd5b506104f16107be3660046151da565b6122ce565b3480156107cf57600080fd5b506104f16126ba565b3480156107e457600080fd5b506104f16107f3366004614e4b565b6126ce565b34801561080457600080fd5b50606554610720906001600160a01b031681565b34801561082457600080fd5b5060ce546001600160a01b0316610720565b34801561084257600080fd5b5060d054610720906001600160a01b031681565b34801561086257600080fd5b5061059260d45481565b34801561087857600080fd5b506033546001600160a01b0316610720565b34801561089657600080fd5b506104f16108a5366004614ee2565b612728565b3480156108b657600080fd5b5061059260d15481565b3480156108cc57600080fd5b5060d0546104bc90600160c01b900463ffffffff1681565b3480156108f057600080fd5b5060d5546104889062010000900460ff1681565b34801561091057600080fd5b506104f161091f366004615010565b6127f7565b34801561093057600080fd5b506104f1612d49565b34801561094557600080fd5b506104f1610954366004614ee2565b612dce565b34801561096557600080fd5b506104f161097436600461522e565b612e9d565b34801561098557600080fd5b5060da546104bc9063ffffffff1681565b3480156109a257600080fd5b5060da5461072090600160201b90046001600160a01b031681565b3480156109c957600080fd5b5060d55461048890610100900460ff1681565b3480156109e857600080fd5b506065546001600160a01b0316610720565b348015610a0657600080fd5b506104f1610a1536600461527d565b612f7e565b348015610a2657600080fd5b50610488610a35366004615306565b60d760209081526000928352604080842090915290825290205460ff1681565b348015610a6157600080fd5b50606754610720906001600160a01b031681565b348015610a8157600080fd5b50610697610a90366004615334565b613249565b348015610aa157600080fd5b5060d0546104bc90600160e01b900463ffffffff1681565b348015610ac557600080fd5b506104f1610ad4366004614e4b565b613310565b348015610ae557600080fd5b506104f1610af4366004614e4b565b6133bf565b348015610b0557600080fd5b50610488610b14366004614e4b565b6134c1565b348015610b2557600080fd5b506104f1610b34366004615408565b613502565b348015610b4557600080fd5b506104f1610b54366004615010565b613611565b348015610b6557600080fd5b506104f1610b74366004614e4b565b61386f565b348015610b8557600080fd5b50610488610b94366004614e4b565b6138e5565b348015610ba557600080fd5b5060cf54610720906001600160a01b031681565b348015610bc557600080fd5b5061059260d25481565b348015610bdb57600080fd5b506104f1610bea366004614e7a565b613925565b348015610bfb57600080fd5b50610c0f610c0a366004614e7a565b613aea565b6040516104659190615487565b6066546001600160a01b0316610c30613cc6565b6001600160a01b03161480610c4b5750610c4b6105bb613cc6565b610c8d5760405162461bcd60e51b815260206004820152600e60248201526d10b130b0b610131010b0b236b4b760911b60448201526064015b60405180910390fd5b818015610d0e575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906154a1565b155b15610db55760d060009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b5050604051600181527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a1610ed8565b81158015610e35575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3591906154a1565b15610ed85760d060009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050604051600081527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a15b808015610f59575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906154a1565b155b156110005760cf60009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b5050604051600181527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb925060200190505b60405180910390a15050565b80158015611080575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108091906154a1565b156111235760cf60009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b5050604051600081527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb9250602001905060405180910390a15b5050565b61112f613cd0565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce34290600090a35050565b611189613d49565b63ffffffff8116600090815260d96020526040902060d35460d0546001600160a01b0316639ab24eb06111ba613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156111fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122291906154be565b101561125b5760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600161126683613aea565b600781111561127757611277615471565b146112b15760405162461bcd60e51b815260206004820152600a602482015269085cdd589b5a5d1d195960b21b6044820152606401610c84565b8054600160a01b900463ffffffff161580611307575060d05463ffffffff600160c01b82048116916112ec91600160a01b90910416426154ed565b6112f691906154ed565b8154600160a01b900463ffffffff16115b61133d5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b805463ffffffff42818116600160401b026bffffffff00000000000000001984168117855560d08054600160a01b90819004851684018516600160601b0263ffffffff60601b1990931667ffffffffffffffff60401b19909616959095179190911780865590549384048316909101600160c01b9093048216929092018116600160801b0263ffffffff60801b1983168117845560da54600160201b92169190910267ffffffff000000001990911673ffffffff0000000000000000ffffffff000000001990921691909117178155611414613cc6565b6007820180546001600160a01b0319166001600160a01b039290921691909117905561143e61186e565b600482015561144b611f55565b600582015560da805463ffffffff191663ffffffff84169081179091554290611472613cc6565b6001600160a01b03167fd45ad122361f16d6f50d7c4a73638f20ee48eff6186af15224e2a4a1f6d5017160405160405180910390a4506114b26001609c55565b50565b6066546001600160a01b03166114c9613cc6565b6001600160a01b0316146114ef5760405162461bcd60e51b8152600401610c8490615505565b82811461150e5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57600083838381811061152d5761152d61554b565b60d5546020909102929092013592505060ff16156115aa5780600114158015611557575080600314155b8015611564575080600514155b8015611571575080600714155b6115aa5760405162461bcd60e51b815260206004820152600a60248201526961646d696e206c6f636b60b01b6044820152606401610c84565b60d554610100900460ff161561162157806002141580156115cc575080600314155b80156115d9575080600614155b80156115e6575080600714155b6116215760405162461bcd60e51b815260206004820152600c60248201526b6d616e61676572206c6f636b60a01b6044820152606401610c84565b60d55462010000900460ff161561169a5780600414158015611644575080600514155b8015611651575080600614155b801561165e575080600714155b61169a5760405162461bcd60e51b815260206004820152600d60248201526c676f7665726e6f72206c6f636b60981b6044820152606401610c84565b8060d660008888868181106116b1576116b161554b565b90506020020160208101906116c69190614e4b565b6001600160a01b031681526020810191909152604001600020558585838181106116f2576116f261554b565b90506020020160208101906117079190614e4b565b6001600160a01b03167fc456d076c1245c6b9759b3cdcb169e14e00a7739897e501844c8fe5fca6cb2608260405161174191815260200190565b60405180910390a2508061175481615561565b915050611511565b5050505050565b6066546001600160a01b0316611777613cc6565b6001600160a01b03161461179d5760405162461bcd60e51b8152600401610c8490615505565b60d5805462ff0000191662010000908117918290556040517fd9574ee4ccdf21db87aa2c1d1fee3248522d79c07c54bde4a9edeb0620bef71f926117ea92900460ff161515815260200190565b60405180910390a1565b6066546001600160a01b0316611808613cc6565b6001600160a01b03161461182e5760405162461bcd60e51b8152600401610c8490615505565b60d5805460ff191660019081179091556040519081527f5e1c9f68365556a24387c25fd0922af31039bcfc65d36caac57401d310948e59906020016117ea565b6000611878611f55565b611880612260565b61188a91906154ed565b905090565b6001600160a01b038116600090815260d6602052604081205460018114806118b75750806003145b806118c25750806005145b806118cd5750806007145b9392505050565b6000816040516020016118e791906151a9565b604051602081830303815290604052805190602001209050919050565b600061190e613d49565b63ffffffff85161580611954575060d05463ffffffff600160c01b820481169161194191600160a01b90910416426154ed565b61194b91906154ed565b8563ffffffff16115b61198a5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b6301312d008411156119d05760405162461bcd60e51b815260206004820152600f60248201526e0c4c2c2d88ec2e640e8de40d0d2ced608b1b6044820152606401610c84565b60d35460d054600091906001600160a01b0316639ab24eb06119f0613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5891906154be565b10611a6557506001611b4c565b60d1543414611ab65760405162461bcd60e51b815260206004820152601960248201527f4261616c20726571756972657320616e206f66666572696e67000000000000006044820152606401610c84565b6067546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611b03576040519150601f19603f3d011682016040523d82523d6000602084013e611b08565b606091505b5050905080611b4a5760405162461bcd60e51b815260206004820152600e60248201526d18dbdd5b19081b9bdd081cd95b9960921b6044820152606401610c84565b505b6000611b8d89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b60d08054919250600160e01b90910463ffffffff1690601c611bae8361557c565b91906101000a81548163ffffffff021916908363ffffffff16021790555050604051806101c0016040528060d0601c9054906101000a900463ffffffff1663ffffffff16815260200183611c03576000611c0d565b60da5463ffffffff165b63ffffffff16815260200183611c24576000611c26565b425b63ffffffff16815260200183611c3d576000611c57565b60d054611c5790600160a01b900463ffffffff16426155a0565b63ffffffff16815260200183611c6e576000611c9d565b60d05463ffffffff600160c01b8204811691611c9391600160a01b90910416426155a0565b611c9d91906155a0565b63ffffffff1681526020018863ffffffff168152602001878152602001600081526020016000815260200183611cd4576000611cdc565b611cdc61186e565b815260200183611ced576000611cf5565b611cf5611f55565b8152604080516080810182526000808252602082810182905282840182905260608301919091528301520183611d2c576000611d34565b611d34613cc6565b6001600160a01b03168152602090810183905260d054600160e01b900463ffffffff908116600090815260d983526040908190208451815494860151928601516060870151608088015160a089015193871667ffffffffffffffff1990981697909717600160201b958716959095029490941767ffffffffffffffff60401b1916600160401b9186169190910263ffffffff60601b191617600160601b938516939093029290921767ffffffffffffffff60801b1916600160801b9484169490940263ffffffff60a01b191693909317600160a01b919092160217815560c0820151600182015560e0820151600282015561010082015160038201556101208201516004808301919091556101408301516005830155610160830151611e5f91600684019190614bef565b506101808201516007820180546001600160a01b0319166001600160a01b039092169190911790556101a0909101516008909101558115611ebf5760d05460da8054600160e01b90920463ffffffff1663ffffffff199092169190911790555b8060d0601c9054906101000a900463ffffffff1663ffffffff167fb9956173924f9c1204bae41dd3737d7ed1161846d13183879cdc03c4b9f8d01960d060149054906101000a900463ffffffff168c8c8c8c89428e8e604051611f2a999897969594939291906155f1565b60405180910390a3505060d0546001609c55600160e01b900463ffffffff1690509695505050505050565b60d054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188a91906154be565b6066546001600160a01b0316611fd7613cc6565b6001600160a01b03161480611ff25750611ff2610b94613cc6565b61200e5760405162461bcd60e51b8152600401610c8490615652565b82811461202d5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761208085858381811061204d5761204d61554b565b90506020020160208101906120629190614e4b565b8484848181106120745761207461554b565b90506020020135613daa565b8061208a81615561565b915050612030565b61209a614c81565b63ffffffff8216600090815260d9602052604080822081516080810192839052926006909101916004918390855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116120c8575094979650505050505050565b60db80546121109061567c565b80601f016020809104026020016040519081016040528092919081815260200182805461213c9061567c565b80156121895780601f1061215e57610100808354040283529160200191612189565b820191906000526020600020905b81548152906001019060200180831161216c57829003601f168201915b505050505081565b6066546001600160a01b03166121a5613cc6565b6001600160a01b031614806121c057506121c0610b94613cc6565b6121dc5760405162461bcd60e51b8152600401610c8490615652565b8281146121fb5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761224e85858381811061221b5761221b61554b565b90506020020160208101906122309190614e4b565b8484848181106122425761224261554b565b90506020020135613e15565b8061225881615561565b9150506121fe565b60cf54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b6122b2613d49565b6122c46122bd613cc6565b8383613e4e565b6111236001609c55565b6122d6613d49565b63ffffffff8316600090815260d96020526040902060078101546001600160a01b03166123305760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600561233b85613aea565b600781111561234c5761234c615471565b146123825760405162461bcd60e51b815260206004820152600660248201526521726561647960d01b6044820152606401610c84565b805460009061239d90600160201b900463ffffffff16613aea565b905060068160078111156123b3576123b3615471565b14806123d0575060038160078111156123ce576123ce615471565b145b806123ec575060078160078111156123ea576123ea615471565b145b806124085750600081600781111561240657612406615471565b145b6124455760405162461bcd60e51b815260206004820152600e60248201526d1c1c995d885c1c9bd8d95cdcd95960921b6044820152606401610c84565b816008015461248985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b146124cb5760405162461bcd60e51b8152602060048201526012602482015271696e636f72726563742063616c6c6461746160701b6044820152606401610c84565b600182015415806124e0575081600101545a10155b61251d5760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420656e6f7567682067617360901b6044820152606401610c84565b60068201805461ff0019166101001790558154600190600160a01b900463ffffffff161580159061255c5750825442600160a01b90910463ffffffff16105b15612565575060005b8080156125915750826005015460d25461257f91906156b1565b600284015461258f9060646156b1565b105b1561259a575060005b8080156125ca5750606460d45484600401546125b691906156b1565b6125c091906156d0565b6125c861186e565b105b156125d3575060005b801561264c5760068301805462ff0000191662010000179055604080516020601f870181900481028201810190925285815260009161262d919088908890819084018382808284376000920191909152506140a292505050565b90508061264a5760068401805463ff000000191663010000001790555b505b60068301546040805160ff62010000840481161515825263010000009093049092161515602083015263ffffffff8816917fb4571f7e4e2c2b6e6185e47ab5caa5fe34087299bd49fbae945a4583101ee3f0910160405180910390a25050506126b56001609c55565b505050565b6126c2613cd0565b6126cc60006140cb565b565b6126d6613cd0565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b6066546001600160a01b031661273c613cc6565b6001600160a01b031614806127575750612757610b94613cc6565b6127735760405162461bcd60e51b8152600401610c8490615652565b8281146127925760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c576127e58585838181106127b2576127b261554b565b90506020020160208101906127c79190614e4b565b8484848181106127d9576127d961554b565b9050602002013561411d565b806127ef81615561565b915050612795565b600054610100900460ff16158080156128175750600054600160ff909116105b806128315750303b158015612831575060005460ff166001145b6128945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c84565b6000805460ff1916600117905580156128b7576000805461ff0019166101001790555b6128bf613d49565b600080600080600080878060200190518101906128dc9190615742565b95509550955095509550955060006001600160a01b0316846001600160a01b03161415801561291357506001600160a01b03831615155b61294d5760405162461bcd60e51b815260206004820152600b60248201526a0c081859191c881d5cd95960aa1b6044820152606401610c84565b6040518060600160405280602d8152602001615b8d602d9139805161297a9160db91602090910190614c9f565b50612983614156565b61298b614185565b6129ca60405180604001604052806004815260200163566f746560e01b815250604051806040016040528060018152602001600d60fa1b8152506141b4565b6129d38361386f565b606680546001600160a01b0385166001600160a01b03199182168117909255606780549091169091179055612a07826141e5565b60cf80546001600160a01b03199081166001600160a01b038981169190911790925560d0805490911687831617905560da8054640100000000600160c01b031916600160201b87841681029190911791829055612a6b929104166000836001614207565b612aac5760405162461bcd60e51b8152602060048201526012602482015271063616c6c206661696c7572652073657475760741b6044820152606401610c84565b60cf5460408051635c975abb60e01b815290517f916f812584e0b001e8c6ab604fa549cc16c9d0b2f60b17aa0b4ff5eefe3e7725926001600160a01b031691635c975abb9160048083019260209291908290030181865afa158015612b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3991906154a1565b60d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb091906154a1565b60d05460d15460d25460d35460d454604080516306fdde0360e01b8152905163ffffffff600160c01b8804811697600160a01b810490911696959493926001600160a01b03909116916306fdde03916004808201926000929091908290030181865afa158015612c24573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4c91908101906157df565b60d060009054906101000a90046001600160a01b03166001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cc791908101906157df565b612ccf611f55565b612cd7612260565b604051612cef9c9b9a99989796959493929190615827565b60405180910390a1505050505050612d076001609c55565b8015611123576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610ff4565b6066546001600160a01b0316612d5d613cc6565b6001600160a01b031614612d835760405162461bcd60e51b8152600401610c8490615505565b60d5805461ff001916610100908117918290556040517fb496b9628e839102454d8b483ba451c4be96675009b637273a00e4ab6a59db72926117ea92900460ff161515815260200190565b6066546001600160a01b0316612de2613cc6565b6001600160a01b03161480612dfd5750612dfd610b94613cc6565b612e195760405162461bcd60e51b8152600401610c8490615652565b828114612e385760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57612e8b858583818110612e5857612e5861554b565b9050602002016020810190612e6d9190614e4b565b848484818110612e7f57612e7f61554b565b9050602002013561421f565b80612e9581615561565b915050612e3b565b6066546001600160a01b0316612eb1613cc6565b6001600160a01b031614612ed75760405162461bcd60e51b8152600401610c8490615505565b6000846001600160a01b0316848484604051612ef49291906158ad565b60006040518083038185875af1925050503d8060008114612f31576040519150601f19603f3d011682016040523d82523d6000602084013e612f36565b606091505b505090508061175c5760405162461bcd60e51b815260206004820152601460248201527363616c6c206661696c757265206578656375746560601b6044820152606401610c84565b612f86613d49565b86421115612fd65760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610c84565b6001600160a01b038816600090815260d8602052604090205486146130265760405162461bcd60e51b8152602060048201526006602482015265216e6f6e636560d01b6044820152606401610c84565b60007f8698fbcc7273f96a670eb203cb707d8ec171123f24eaf075b1e754b71119e59e60d060009054906101000a90046001600160a01b03166001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561309c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c491908101906157df565b6040516020016130d491906158bd565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905263ffffffff871660c082015285151560e082015261010001604051602081830303815290604052805190602001209050600061315182614258565b90506000613161828787876142a6565b90508a6001600160a01b0316816001600160a01b0316146131b85760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610c84565b6001600160a01b0381166131f85760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b6044820152606401610c84565b6001600160a01b038b16600090815260d8602052604081208054600192906132219084906154ed565b909155506132329050818989613e4e565b50505061323f6001609c55565b5050505050505050565b60608060005b84518110156132cc578160008560008885815181106132705761327061554b565b60200260200101515189868151811061328b5761328b61554b565b60200260200101516040516020016132a8969594939291906158d9565b604051602081830303815290604052915080806132c490615561565b91505061324f565b50806040516024016132de91906151a9565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b6066546001600160a01b0316613324613cc6565b6001600160a01b0316148061333f575061333f610b14613cc6565b61337f5760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b613388816141e5565b6040516001600160a01b038216907f8c2bee8063bb4464870b7dfa415ebb2fe80bfa73ba20d6fbf0d42791274667ff90600090a250565b6133c7613cd0565b6001600160a01b0381161561346d576040516301ffc9a760e01b815263736bd41d60e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015613421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061344591906154a1565b61346d576040516358b7533f60e11b81526001600160a01b0382166004820152602401610c84565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa29060200160405180910390a150565b6001600160a01b038116600090815260d6602052604081205460048114806134e95750806005145b806118c2575080600614806118cd575060071492915050565b61350a613d49565b60015b818110156135c7578282613522600184615943565b8181106135315761353161554b565b90506020020160208101906135469190614e4b565b6001600160a01b03168383838181106135615761356161554b565b90506020020160208101906135769190614e4b565b6001600160a01b0316116135b55760405162461bcd60e51b815260206004820152600660248201526510b7b93232b960d11b6044820152606401610c84565b806135bf81615561565b91505061350d565b506136078585858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506142c492505050565b61175c6001609c55565b6066546001600160a01b0316613625613cc6565b6001600160a01b031614806136405750613640610b14613cc6565b6136805760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b6000806000806000808680602001905181019061369d919061595a565b949a5092985090965094509250905060648111156136ea5760405162461bcd60e51b815260206004820152600a6024820152696261642071756f72756d60b01b6044820152606401610c84565b606481111561372e5760405162461bcd60e51b815260206004820152601060248201526f3130b21036b4b72932ba32b73a34b7b760811b6044820152606401610c84565b600060d35411801561374a575060d0546001600160a01b031615155b1561379f57613757611f55565b82111561379f5760405162461bcd60e51b815260206004820152601660248201527573706f6e736f72203e20736861726573537570706c7960501b6044820152606401610c84565b63ffffffff8616156137ca5760d0805463ffffffff60a01b1916600160a01b63ffffffff8916021790555b63ffffffff8516156137f55760d0805463ffffffff60c01b1916600160c01b63ffffffff8816021790555b60d184905560d283905560d382905560d48190556040805163ffffffff808916825287166020820152908101859052606081018490526080810183905260a081018290527fc10758ccd7d1dd3330e7bbe13a1a1d6bbb414967932376ee24989bad95edcdc19060c00160405180910390a150505050505050565b613877613cd0565b6001600160a01b0381166138dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c84565b6114b2816140cb565b6001600160a01b038116600090815260d6602052604081205460028114806134e9575080600314806118c2575080600614806118cd575060071492915050565b61392d613d49565b63ffffffff8116600090815260d960205260409020600261394d83613aea565b600781111561395e5761395e615471565b146139955760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60078101546001600160a01b03166139ab613cc6565b6001600160a01b03161480613a53575060d35460d05460078301546001600160a01b0391821691633a46b1a891166139e4600142615943565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015613a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5191906154be565b105b80613a645750613a64610b14613cc6565b613a9f5760405162461bcd60e51b815260206004820152600c60248201526b2163616e63656c6c61626c6560a01b6044820152606401610c84565b60068101805460ff1916600117905560405163ffffffff8316907f8896f24cff41b54acf76c2560861f33cd20fd76c4df0b68a3515c354e4b6c81a90600090a2506114b26001609c55565b63ffffffff818116600090815260d96020908152604080832081516101c08101835281548087168252600160201b8104871694820194909452600160401b8404861681840152600160601b840486166060820152600160801b84048616608080830191909152600160a01b90940490951660a0860152600181015460c0860152600281015460e08601526003810154610100860152600480820154610120870152600582015461014087015282519384019283905293948594909391926101608501929160068501918288855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411613bb75750505092845250505060078201546001600160a01b03166020820152600890910154604090910152805190915063ffffffff16613c255750600092915050565b6101608101515115613c3a5750600392915050565b604081015163ffffffff16613c525750600192915050565b806060015163ffffffff164211613c6c5750600292915050565b806080015163ffffffff164211613c865750600492915050565b8060e0015181610100015110613c9f5750600792915050565b6101608101516020015115613cb75750600692915050565b50600592915050565b50919050565b600061188a614540565b613cd8613cc6565b6001600160a01b0316613cf36033546001600160a01b031690565b6001600160a01b0316146126cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c84565b6002609c541415613d9c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c84565b6002609c55565b6001609c55565b60cf546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f19906044015b600060405180830381600087803b158015613df957600080fd5b505af1158015613e0d573d6000803e3d6000fd5b505050505050565b60cf54604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b63ffffffff8216600090815260d9602052604090206002613e6e84613aea565b6007811115613e7f57613e7f615471565b14613eb65760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60d0548154604051630748d63560e31b81526001600160a01b038781166004830152600160401b90920463ffffffff1660248201526000929190911690633a46b1a890604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d91906154be565b905060008111613f795760405162461bcd60e51b815260206004820152600760248201526610b6b2b6b132b960c91b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff8816845290915290205460ff1615613fdb5760405162461bcd60e51b81526020600482015260056024820152641d9bdd195960da1b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff881684529091528120805460ff1916600117905561401761186e565b9050826004015481111561402d57600483018190555b8315614042576002830180548301905561404d565b600383018054830190555b8315158563ffffffff16876001600160a01b03167f786755545a7e27c12c90cc7f0934514d03fdacfe3684a340b8c4100531e7ecd58560405161409291815260200190565b60405180910390a4505050505050565b60da546000906140c590600160201b90046001600160a01b031682846001614207565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d054604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b600054610100900460ff1661417d5760405162461bcd60e51b8152600401610c84906159b8565b6126cc614574565b600054610100900460ff166141ac5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145ab565b600054610100900460ff166141db5760405162461bcd60e51b8152600401610c84906159b8565b61112382826145d2565b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b600061421585858585614613565b5095945050505050565b60d0546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401613ddf565b60006140c5614265614812565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006142b78787878761488d565b9150915061421581614951565b60006142ce61186e565b905082156142e7576142e76142e1613cc6565b84613e15565b83156142fe576142fe6142f8613cc6565b8561411d565b60005b82518110156144ec57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031684838151811061433c5761433c61554b565b60200260200101516001600160a01b0316141561436657506067546001600160a01b031631614434565b600084838151811061437a5761437a61554b565b602090810291909101810151606754604080516001600160a01b03928316602480830191909152825180830390910181526044909101825293840180516001600160e01b03166370a0823160e01b179052519116916143d8916158bd565b600060405180830381855afa9150503d8060008114614413576040519150601f19603f3d011682016040523d82523d6000602084013e614418565b606091505b509150508080602001905181019061443091906154be565b9150505b6000838261444289896154ed565b61444c91906156b1565b61445691906156d0565b905080156144d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031685848151811061448e5761448e61554b565b60200260200101516001600160a01b0316146144cd576144c88584815181106144b9576144b961554b565b60200260200101518983614a9f565b6144d7565b6144d78882614b6e565b505080806144e490615561565b915050614301565b5083836144f7613cc6565b6001600160a01b03167fa21c268847f2b8adac3751ed0683330abe9fdd6cc4a7a8fc6787633d4126e0d48886604051614531929190615a03565b60405180910390a45050505050565b60006014361080159061455d575060ce546001600160a01b031633145b1561456f575060131936013560601c90565b503390565b600054610100900460ff1661459b5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145a6613cc6565b6140cb565b600054610100900460ff16613da35760405162461bcd60e51b8152600401610c84906159b8565b600054610100900460ff166145f95760405162461bcd60e51b8152600401610c84906159b8565b815160209283012081519190920120606891909155606955565b6065546000906060906001600160a01b0316801561478557604051633af85da960e11b81526001600160a01b038216906375f0bb529061466a908a908a908a908a9060009081908190819081903390600401615a73565b600060405180830381600087803b15801561468457600080fd5b505af1158015614698573d6000803e3d6000fd5b5050606754604051635229073f60e01b81526001600160a01b039091169250635229073f91506146d2908a908a908a908a90600401615afd565b6000604051808303816000875af11580156146f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526147199190810190615b3c565b604051631264e26d60e31b815260006004820152821515602482015291945092506001600160a01b03821690639327136890604401600060405180830381600087803b15801561476857600080fd5b505af115801561477c573d6000803e3d6000fd5b50505050614808565b606754604051635229073f60e01b81526001600160a01b0390911690635229073f906147bb908a908a908a908a90600401615afd565b6000604051808303816000875af11580156147da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526148029190810190615b3c565b90935091505b5094509492505050565b600061188a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61484160685490565b6069546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156148c45750600090506003614948565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614918573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661494157600060019250925050614948565b9150600090505b94509492505050565b600081600481111561496557614965615471565b141561496e5750565b600181600481111561498257614982615471565b14156149d05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c84565b60028160048111156149e4576149e4615471565b1415614a325760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c84565b6003816004811115614a4657614a46615471565b14156114b25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c84565b600080614b0785600063a9059cbb8787604051602401614ad49291906001600160a01b03929092168252602082015260400190565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506000614bd2565b91509150818015614b30575080511580614b30575080806020019051810190614b3091906154a1565b61175c5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610c84565b6000614b8c8383604051806020016040528060008152506000614bd2565b509050806126b55760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610c84565b60006060614be286868686614613565b9097909650945050505050565b600183019183908215614c715791602002820160005b83821115614c4257835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614c05565b8015614c6f5782816101000a81549060ff0219169055600101602081600001049283019260010302614c42565b505b50614c7d929150614d13565b5090565b60405180608001604052806004906020820280368337509192915050565b828054614cab9061567c565b90600052602060002090601f016020900481019282614ccd5760008555614c71565b82601f10614ce657805160ff1916838001178555614c71565b82800160010185558215614c71579182015b82811115614c71578251825591602001919060010190614cf8565b5b80821115614c7d5760008155600101614d14565b600060208284031215614d3a57600080fd5b5035919050565b60006101a08201905063ffffffff8f16825263ffffffff8e16602083015263ffffffff8d16604083015263ffffffff8c16606083015263ffffffff8b16608083015263ffffffff8a1660a08301528860c08301528760e0830152866101008301528561012083015284610140830152614dc66101608301856001600160a01b03169052565b826101808301529e9d5050505050505050505050505050565b80151581146114b257600080fd5b60008060408385031215614e0057600080fd5b8235614e0b81614ddf565b91506020830135614e1b81614ddf565b809150509250929050565b6001600160a01b03811681146114b257600080fd5b8035614e4681614e26565b919050565b600060208284031215614e5d57600080fd5b81356118cd81614e26565b63ffffffff811681146114b257600080fd5b600060208284031215614e8c57600080fd5b81356118cd81614e68565b60008083601f840112614ea957600080fd5b5081356001600160401b03811115614ec057600080fd5b6020830191508360208260051b8501011115614edb57600080fd5b9250929050565b60008060008060408587031215614ef857600080fd5b84356001600160401b0380821115614f0f57600080fd5b614f1b88838901614e97565b90965094506020870135915080821115614f3457600080fd5b50614f4187828801614e97565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614f8b57614f8b614f4d565b604052919050565b60006001600160401b03821115614fac57614fac614f4d565b50601f01601f191660200190565b600082601f830112614fcb57600080fd5b8135614fde614fd982614f93565b614f63565b818152846020838601011115614ff357600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561502257600080fd5b81356001600160401b0381111561503857600080fd5b61504484828501614fba565b949350505050565b60008083601f84011261505e57600080fd5b5081356001600160401b0381111561507557600080fd5b602083019150836020828501011115614edb57600080fd5b600080600080600080608087890312156150a657600080fd5b86356001600160401b03808211156150bd57600080fd5b6150c98a838b0161504c565b9098509650602089013591506150de82614e68565b90945060408801359350606088013590808211156150fb57600080fd5b5061510889828a0161504c565b979a9699509497509295939492505050565b60808101818360005b60048110156151445781511515835260209283019290910190600101615123565b50505092915050565b60005b83811015615168578181015183820152602001615150565b83811115615177576000848401525b50505050565b6000815180845261519581602086016020860161514d565b601f01601f19169290920160200192915050565b6020815260006118cd602083018461517d565b600080604083850312156151cf57600080fd5b8235614e0b81614e68565b6000806000604084860312156151ef57600080fd5b83356151fa81614e68565b925060208401356001600160401b0381111561521557600080fd5b6152218682870161504c565b9497909650939450505050565b6000806000806060858703121561524457600080fd5b843561524f81614e26565b93506020850135925060408501356001600160401b0381111561527157600080fd5b614f418782880161504c565b600080600080600080600080610100898b03121561529a57600080fd5b88356152a581614e26565b9750602089013596506040890135955060608901356152c381614e68565b945060808901356152d381614ddf565b935060a089013560ff811681146152e957600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806040838503121561531957600080fd5b823561532481614e26565b91506020830135614e1b81614e68565b6000806040838503121561534757600080fd5b82356001600160401b038082111561535e57600080fd5b818501915085601f83011261537257600080fd5b813560208282111561538657615386614f4d565b8160051b615395828201614f63565b928352848101820192828101908a8511156153af57600080fd5b83870192505b848310156153eb578235868111156153cd5760008081fd5b6153db8c86838b0101614fba565b83525091830191908301906153b5565b97506153fb915050878201614e3b565b9450505050509250929050565b60008060008060006080868803121561542057600080fd5b853561542b81614e26565b9450602086013593506040860135925060608601356001600160401b0381111561545457600080fd5b61546088828901614e97565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b602081016008831061549b5761549b615471565b91905290565b6000602082840312156154b357600080fd5b81516118cd81614ddf565b6000602082840312156154d057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615500576155006154d7565b500190565b602080825260059082015264085898585b60da1b604082015260600190565b6020808252600d908201526c2161727261792070617269747960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415615575576155756154d7565b5060010190565b600063ffffffff80831681811415615596576155966154d7565b6001019392505050565b600063ffffffff8083168185168083038211156155bf576155bf6154d7565b01949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600063ffffffff808c16835260e0602084015261561260e084018b8d6155c8565b818a16604085015288606085015287151560808501528660a085015283810360c08501526156418186886155c8565b9d9c50505050505050505050505050565b60208082526010908201526f10b130b0b610131010b6b0b730b3b2b960811b604082015260600190565b600181811c9082168061569057607f821691505b60208210811415613cc057634e487b7160e01b600052602260045260246000fd5b60008160001904831182151516156156cb576156cb6154d7565b500290565b6000826156ed57634e487b7160e01b600052601260045260246000fd5b500490565b6000615700614fd984614f93565b905082815283838301111561571457600080fd5b6118cd83602083018461514d565b600082601f83011261573357600080fd5b6118cd838351602085016156f2565b60008060008060008060c0878903121561575b57600080fd5b865161576681614e26565b602088015190965061577781614e26565b604088015190955061578881614e26565b606088015190945061579981614e26565b60808801519093506157aa81614e26565b60a08801519092506001600160401b038111156157c657600080fd5b6157d289828a01615722565b9150509295509295509295565b6000602082840312156157f157600080fd5b81516001600160401b0381111561580757600080fd5b8201601f8101841361581857600080fd5b615044848251602084016156f2565b60006101808e151583528d1515602084015263ffffffff808e166040850152808d166060850152508a60808401528960a08401528860c08401528760e08401528061010084015261587a8184018861517d565b905082810361012084015261588f818761517d565b610140840195909552505061016001529a9950505050505050505050565b8183823760009101908152919050565b600082516158cf81846020870161514d565b9190910192915050565b600087516158eb818460208c0161514d565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b166001820152856015820152846035820152835161593381605584016020880161514d565b0160550198975050505050505050565b600082821015615955576159556154d7565b500390565b60008060008060008060c0878903121561597357600080fd5b865161597e81614e68565b602088015190965061598f81614e68565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b81811015615a51578551851683529483019491830191600101615a33565b509098975050505050505050565b60028110615a6f57615a6f615471565b9052565b6001600160a01b038b81168252602082018b905261016060408301819052600091615aa08483018d61517d565b9150615aaf606085018c615a5f565b608084019990995260a08301979097525060c081019490945291851660e084015284166101008301528183036101208301526000835290921661014090920191909152602001949350505050565b60018060a01b0385168152836020820152608060408201526000615b24608083018561517d565b9050615b336060830184615a5f565b95945050505050565b60008060408385031215615b4f57600080fd5b8251615b5a81614ddf565b60208401519092506001600160401b03811115615b7657600080fd5b615b8285828601615722565b915050925092905056fe322e322e352b6f70656e67736e2e70617961626c65776974686261616c2e6972656c6179726563697069656e74a2646970667358221220e7f7a8af70f47c4c0a43ae70fdb50ef5f9643adc80e4e50e8e0c3ddc18ff5f7f64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106103a25760003560e01c80638009ba1f116101e7578063cf043df31161010d578063ed0cdf15116100a0578063f460124d1161006f578063f460124d14610b99578063f81cbd2614610bb9578063fab514c014610bcf578063fe47668614610bef57600080fd5b8063ed0cdf1514610b19578063ee4d88ed14610b39578063f2fde38b14610b59578063f3ae241514610b7957600080fd5b8063da35c664116100dc578063da35c66414610a95578063da74222814610ab9578063e19a9dd914610ad9578063e43581b814610af957600080fd5b8063cf043df3146109fa578063d33defc714610a1a578063d4b8399214610a55578063d61f27ae14610a7557600080fd5b8063a4f9edbf11610185578063b634e4e011610154578063b634e4e014610979578063c00d077514610996578063c4e931f6146109bd578063c9106389146109dc57600080fd5b8063a4f9edbf14610904578063acca30a214610924578063b1e3f40c14610939578063b3c98bbb1461095957600080fd5b806398a527cc116101c157806398a527cc1461088a5780639a2f747f146108aa578063a06db7dc146108c0578063a26ec96e146108e457600080fd5b80638009ba1f1461083657806383bf8459146108565780638da5cb5b1461086c57600080fd5b80634526d846116102cc5780635ec286961161026a578063715018a611610239578063715018a6146107c3578063776d1a01146107d85780637ceab3b1146107f85780637da0a8771461081857600080fd5b80635ec286961461074e578063635e99aa1461076e57806367f61f0714610783578063706a6e93146107a357600080fd5b806352ba1da7116102a657806352ba1da7146106a4578063572b6c05146106d15780635aef7de6146107005780635cfd6f7e1461073857600080fd5b80634526d846146106355780634630affc14610655578063486ff0cd1461068257600080fd5b8063136d731a11610344578063258bfe2f11610313578063258bfe2f146105c05780633232444c146105e05780633a82ffc81461060d5780633a98ef391461062057600080fd5b8063136d731a1461055357806316fd265d1461056857806318160ddd1461057d57806324d7806c146105a057600080fd5b8063056b0dcd11610380578063056b0dcd146104d1578063086cfca8146104f35780630a796e19146105135780630f656a211461053357600080fd5b8063013cf08b146103a7578063027cdf451461046e57806302a251a314610498575b600080fd5b3480156103b357600080fd5b5061044c6103c2366004614d28565b60d9602052600090815260409020805460018201546002830154600384015460048501546005860154600787015460089097015463ffffffff80881698600160201b8904821698600160401b8104831698600160601b8204841698600160801b8304851698600160a01b90930490941696909593949193909290916001600160a01b03909116908d565b6040516104659d9c9b9a99989796959493929190614d41565b60405180910390f35b34801561047a57600080fd5b5060d5546104889060ff1681565b6040519015158152602001610465565b3480156104a457600080fd5b5060d0546104bc90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610465565b3480156104dd57600080fd5b506104f16104ec366004614ded565b610c1c565b005b3480156104ff57600080fd5b506104f161050e366004614e4b565b611127565b34801561051f57600080fd5b506104f161052e366004614e7a565b611181565b34801561053f57600080fd5b506104f161054e366004614ee2565b6114b5565b34801561055f57600080fd5b506104f1611763565b34801561057457600080fd5b506104f16117f4565b34801561058957600080fd5b5061059261186e565b604051908152602001610465565b3480156105ac57600080fd5b506104886105bb366004614e4b565b61188f565b3480156105cc57600080fd5b506105926105db366004615010565b6118d4565b3480156105ec57600080fd5b506105926105fb366004614e4b565b60d66020526000908152604090205481565b61059261061b36600461508d565b611904565b34801561062c57600080fd5b50610592611f55565b34801561064157600080fd5b506104f1610650366004614ee2565b611fc3565b34801561066157600080fd5b50610675610670366004614e7a565b612092565b604051610465919061511a565b34801561068e57600080fd5b50610697612103565b60405161046591906151a9565b3480156106b057600080fd5b506105926106bf366004614e4b565b60d86020526000908152604090205481565b3480156106dd57600080fd5b506104886106ec366004614e4b565b60ce546001600160a01b0391821691161490565b34801561070c57600080fd5b50606654610720906001600160a01b031681565b6040516001600160a01b039091168152602001610465565b34801561074457600080fd5b5061059260d35481565b34801561075a57600080fd5b506104f1610769366004614ee2565b612191565b34801561077a57600080fd5b50610592612260565b34801561078f57600080fd5b506104f161079e3660046151bc565b6122aa565b3480156107af57600080fd5b506104f16107be3660046151da565b6122ce565b3480156107cf57600080fd5b506104f16126ba565b3480156107e457600080fd5b506104f16107f3366004614e4b565b6126ce565b34801561080457600080fd5b50606554610720906001600160a01b031681565b34801561082457600080fd5b5060ce546001600160a01b0316610720565b34801561084257600080fd5b5060d054610720906001600160a01b031681565b34801561086257600080fd5b5061059260d45481565b34801561087857600080fd5b506033546001600160a01b0316610720565b34801561089657600080fd5b506104f16108a5366004614ee2565b612728565b3480156108b657600080fd5b5061059260d15481565b3480156108cc57600080fd5b5060d0546104bc90600160c01b900463ffffffff1681565b3480156108f057600080fd5b5060d5546104889062010000900460ff1681565b34801561091057600080fd5b506104f161091f366004615010565b6127f7565b34801561093057600080fd5b506104f1612d49565b34801561094557600080fd5b506104f1610954366004614ee2565b612dce565b34801561096557600080fd5b506104f161097436600461522e565b612e9d565b34801561098557600080fd5b5060da546104bc9063ffffffff1681565b3480156109a257600080fd5b5060da5461072090600160201b90046001600160a01b031681565b3480156109c957600080fd5b5060d55461048890610100900460ff1681565b3480156109e857600080fd5b506065546001600160a01b0316610720565b348015610a0657600080fd5b506104f1610a1536600461527d565b612f7e565b348015610a2657600080fd5b50610488610a35366004615306565b60d760209081526000928352604080842090915290825290205460ff1681565b348015610a6157600080fd5b50606754610720906001600160a01b031681565b348015610a8157600080fd5b50610697610a90366004615334565b613249565b348015610aa157600080fd5b5060d0546104bc90600160e01b900463ffffffff1681565b348015610ac557600080fd5b506104f1610ad4366004614e4b565b613310565b348015610ae557600080fd5b506104f1610af4366004614e4b565b6133bf565b348015610b0557600080fd5b50610488610b14366004614e4b565b6134c1565b348015610b2557600080fd5b506104f1610b34366004615408565b613502565b348015610b4557600080fd5b506104f1610b54366004615010565b613611565b348015610b6557600080fd5b506104f1610b74366004614e4b565b61386f565b348015610b8557600080fd5b50610488610b94366004614e4b565b6138e5565b348015610ba557600080fd5b5060cf54610720906001600160a01b031681565b348015610bc557600080fd5b5061059260d25481565b348015610bdb57600080fd5b506104f1610bea366004614e7a565b613925565b348015610bfb57600080fd5b50610c0f610c0a366004614e7a565b613aea565b6040516104659190615487565b6066546001600160a01b0316610c30613cc6565b6001600160a01b03161480610c4b5750610c4b6105bb613cc6565b610c8d5760405162461bcd60e51b815260206004820152600e60248201526d10b130b0b610131010b0b236b4b760911b60448201526064015b60405180910390fd5b818015610d0e575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906154a1565b155b15610db55760d060009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b5050604051600181527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a1610ed8565b81158015610e35575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3591906154a1565b15610ed85760d060009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050604051600081527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a15b808015610f59575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906154a1565b155b156110005760cf60009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b5050604051600181527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb925060200190505b60405180910390a15050565b80158015611080575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108091906154a1565b156111235760cf60009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b5050604051600081527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb9250602001905060405180910390a15b5050565b61112f613cd0565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce34290600090a35050565b611189613d49565b63ffffffff8116600090815260d96020526040902060d35460d0546001600160a01b0316639ab24eb06111ba613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156111fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122291906154be565b101561125b5760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600161126683613aea565b600781111561127757611277615471565b146112b15760405162461bcd60e51b815260206004820152600a602482015269085cdd589b5a5d1d195960b21b6044820152606401610c84565b8054600160a01b900463ffffffff161580611307575060d05463ffffffff600160c01b82048116916112ec91600160a01b90910416426154ed565b6112f691906154ed565b8154600160a01b900463ffffffff16115b61133d5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b805463ffffffff42818116600160401b026bffffffff00000000000000001984168117855560d08054600160a01b90819004851684018516600160601b0263ffffffff60601b1990931667ffffffffffffffff60401b19909616959095179190911780865590549384048316909101600160c01b9093048216929092018116600160801b0263ffffffff60801b1983168117845560da54600160201b92169190910267ffffffff000000001990911673ffffffff0000000000000000ffffffff000000001990921691909117178155611414613cc6565b6007820180546001600160a01b0319166001600160a01b039290921691909117905561143e61186e565b600482015561144b611f55565b600582015560da805463ffffffff191663ffffffff84169081179091554290611472613cc6565b6001600160a01b03167fd45ad122361f16d6f50d7c4a73638f20ee48eff6186af15224e2a4a1f6d5017160405160405180910390a4506114b26001609c55565b50565b6066546001600160a01b03166114c9613cc6565b6001600160a01b0316146114ef5760405162461bcd60e51b8152600401610c8490615505565b82811461150e5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57600083838381811061152d5761152d61554b565b60d5546020909102929092013592505060ff16156115aa5780600114158015611557575080600314155b8015611564575080600514155b8015611571575080600714155b6115aa5760405162461bcd60e51b815260206004820152600a60248201526961646d696e206c6f636b60b01b6044820152606401610c84565b60d554610100900460ff161561162157806002141580156115cc575080600314155b80156115d9575080600614155b80156115e6575080600714155b6116215760405162461bcd60e51b815260206004820152600c60248201526b6d616e61676572206c6f636b60a01b6044820152606401610c84565b60d55462010000900460ff161561169a5780600414158015611644575080600514155b8015611651575080600614155b801561165e575080600714155b61169a5760405162461bcd60e51b815260206004820152600d60248201526c676f7665726e6f72206c6f636b60981b6044820152606401610c84565b8060d660008888868181106116b1576116b161554b565b90506020020160208101906116c69190614e4b565b6001600160a01b031681526020810191909152604001600020558585838181106116f2576116f261554b565b90506020020160208101906117079190614e4b565b6001600160a01b03167fc456d076c1245c6b9759b3cdcb169e14e00a7739897e501844c8fe5fca6cb2608260405161174191815260200190565b60405180910390a2508061175481615561565b915050611511565b5050505050565b6066546001600160a01b0316611777613cc6565b6001600160a01b03161461179d5760405162461bcd60e51b8152600401610c8490615505565b60d5805462ff0000191662010000908117918290556040517fd9574ee4ccdf21db87aa2c1d1fee3248522d79c07c54bde4a9edeb0620bef71f926117ea92900460ff161515815260200190565b60405180910390a1565b6066546001600160a01b0316611808613cc6565b6001600160a01b03161461182e5760405162461bcd60e51b8152600401610c8490615505565b60d5805460ff191660019081179091556040519081527f5e1c9f68365556a24387c25fd0922af31039bcfc65d36caac57401d310948e59906020016117ea565b6000611878611f55565b611880612260565b61188a91906154ed565b905090565b6001600160a01b038116600090815260d6602052604081205460018114806118b75750806003145b806118c25750806005145b806118cd5750806007145b9392505050565b6000816040516020016118e791906151a9565b604051602081830303815290604052805190602001209050919050565b600061190e613d49565b63ffffffff85161580611954575060d05463ffffffff600160c01b820481169161194191600160a01b90910416426154ed565b61194b91906154ed565b8563ffffffff16115b61198a5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b6301312d008411156119d05760405162461bcd60e51b815260206004820152600f60248201526e0c4c2c2d88ec2e640e8de40d0d2ced608b1b6044820152606401610c84565b60d35460d054600091906001600160a01b0316639ab24eb06119f0613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5891906154be565b10611a6557506001611b4c565b60d1543414611ab65760405162461bcd60e51b815260206004820152601960248201527f4261616c20726571756972657320616e206f66666572696e67000000000000006044820152606401610c84565b6067546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611b03576040519150601f19603f3d011682016040523d82523d6000602084013e611b08565b606091505b5050905080611b4a5760405162461bcd60e51b815260206004820152600e60248201526d18dbdd5b19081b9bdd081cd95b9960921b6044820152606401610c84565b505b6000611b8d89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b60d08054919250600160e01b90910463ffffffff1690601c611bae8361557c565b91906101000a81548163ffffffff021916908363ffffffff16021790555050604051806101c0016040528060d0601c9054906101000a900463ffffffff1663ffffffff16815260200183611c03576000611c0d565b60da5463ffffffff165b63ffffffff16815260200183611c24576000611c26565b425b63ffffffff16815260200183611c3d576000611c57565b60d054611c5790600160a01b900463ffffffff16426155a0565b63ffffffff16815260200183611c6e576000611c9d565b60d05463ffffffff600160c01b8204811691611c9391600160a01b90910416426155a0565b611c9d91906155a0565b63ffffffff1681526020018863ffffffff168152602001878152602001600081526020016000815260200183611cd4576000611cdc565b611cdc61186e565b815260200183611ced576000611cf5565b611cf5611f55565b8152604080516080810182526000808252602082810182905282840182905260608301919091528301520183611d2c576000611d34565b611d34613cc6565b6001600160a01b03168152602090810183905260d054600160e01b900463ffffffff908116600090815260d983526040908190208451815494860151928601516060870151608088015160a089015193871667ffffffffffffffff1990981697909717600160201b958716959095029490941767ffffffffffffffff60401b1916600160401b9186169190910263ffffffff60601b191617600160601b938516939093029290921767ffffffffffffffff60801b1916600160801b9484169490940263ffffffff60a01b191693909317600160a01b919092160217815560c0820151600182015560e0820151600282015561010082015160038201556101208201516004808301919091556101408301516005830155610160830151611e5f91600684019190614bef565b506101808201516007820180546001600160a01b0319166001600160a01b039092169190911790556101a0909101516008909101558115611ebf5760d05460da8054600160e01b90920463ffffffff1663ffffffff199092169190911790555b8060d0601c9054906101000a900463ffffffff1663ffffffff167fb9956173924f9c1204bae41dd3737d7ed1161846d13183879cdc03c4b9f8d01960d060149054906101000a900463ffffffff168c8c8c8c89428e8e604051611f2a999897969594939291906155f1565b60405180910390a3505060d0546001609c55600160e01b900463ffffffff1690509695505050505050565b60d054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188a91906154be565b6066546001600160a01b0316611fd7613cc6565b6001600160a01b03161480611ff25750611ff2610b94613cc6565b61200e5760405162461bcd60e51b8152600401610c8490615652565b82811461202d5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761208085858381811061204d5761204d61554b565b90506020020160208101906120629190614e4b565b8484848181106120745761207461554b565b90506020020135613daa565b8061208a81615561565b915050612030565b61209a614c81565b63ffffffff8216600090815260d9602052604080822081516080810192839052926006909101916004918390855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116120c8575094979650505050505050565b60db80546121109061567c565b80601f016020809104026020016040519081016040528092919081815260200182805461213c9061567c565b80156121895780601f1061215e57610100808354040283529160200191612189565b820191906000526020600020905b81548152906001019060200180831161216c57829003601f168201915b505050505081565b6066546001600160a01b03166121a5613cc6565b6001600160a01b031614806121c057506121c0610b94613cc6565b6121dc5760405162461bcd60e51b8152600401610c8490615652565b8281146121fb5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761224e85858381811061221b5761221b61554b565b90506020020160208101906122309190614e4b565b8484848181106122425761224261554b565b90506020020135613e15565b8061225881615561565b9150506121fe565b60cf54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b6122b2613d49565b6122c46122bd613cc6565b8383613e4e565b6111236001609c55565b6122d6613d49565b63ffffffff8316600090815260d96020526040902060078101546001600160a01b03166123305760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600561233b85613aea565b600781111561234c5761234c615471565b146123825760405162461bcd60e51b815260206004820152600660248201526521726561647960d01b6044820152606401610c84565b805460009061239d90600160201b900463ffffffff16613aea565b905060068160078111156123b3576123b3615471565b14806123d0575060038160078111156123ce576123ce615471565b145b806123ec575060078160078111156123ea576123ea615471565b145b806124085750600081600781111561240657612406615471565b145b6124455760405162461bcd60e51b815260206004820152600e60248201526d1c1c995d885c1c9bd8d95cdcd95960921b6044820152606401610c84565b816008015461248985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b146124cb5760405162461bcd60e51b8152602060048201526012602482015271696e636f72726563742063616c6c6461746160701b6044820152606401610c84565b600182015415806124e0575081600101545a10155b61251d5760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420656e6f7567682067617360901b6044820152606401610c84565b60068201805461ff0019166101001790558154600190600160a01b900463ffffffff161580159061255c5750825442600160a01b90910463ffffffff16105b15612565575060005b8080156125915750826005015460d25461257f91906156b1565b600284015461258f9060646156b1565b105b1561259a575060005b8080156125ca5750606460d45484600401546125b691906156b1565b6125c091906156d0565b6125c861186e565b105b156125d3575060005b801561264c5760068301805462ff0000191662010000179055604080516020601f870181900481028201810190925285815260009161262d919088908890819084018382808284376000920191909152506140a292505050565b90508061264a5760068401805463ff000000191663010000001790555b505b60068301546040805160ff62010000840481161515825263010000009093049092161515602083015263ffffffff8816917fb4571f7e4e2c2b6e6185e47ab5caa5fe34087299bd49fbae945a4583101ee3f0910160405180910390a25050506126b56001609c55565b505050565b6126c2613cd0565b6126cc60006140cb565b565b6126d6613cd0565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b6066546001600160a01b031661273c613cc6565b6001600160a01b031614806127575750612757610b94613cc6565b6127735760405162461bcd60e51b8152600401610c8490615652565b8281146127925760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c576127e58585838181106127b2576127b261554b565b90506020020160208101906127c79190614e4b565b8484848181106127d9576127d961554b565b9050602002013561411d565b806127ef81615561565b915050612795565b600054610100900460ff16158080156128175750600054600160ff909116105b806128315750303b158015612831575060005460ff166001145b6128945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c84565b6000805460ff1916600117905580156128b7576000805461ff0019166101001790555b6128bf613d49565b600080600080600080878060200190518101906128dc9190615742565b95509550955095509550955060006001600160a01b0316846001600160a01b03161415801561291357506001600160a01b03831615155b61294d5760405162461bcd60e51b815260206004820152600b60248201526a0c081859191c881d5cd95960aa1b6044820152606401610c84565b6040518060600160405280602d8152602001615b8d602d9139805161297a9160db91602090910190614c9f565b50612983614156565b61298b614185565b6129ca60405180604001604052806004815260200163566f746560e01b815250604051806040016040528060018152602001600d60fa1b8152506141b4565b6129d38361386f565b606680546001600160a01b0385166001600160a01b03199182168117909255606780549091169091179055612a07826141e5565b60cf80546001600160a01b03199081166001600160a01b038981169190911790925560d0805490911687831617905560da8054640100000000600160c01b031916600160201b87841681029190911791829055612a6b929104166000836001614207565b612aac5760405162461bcd60e51b8152602060048201526012602482015271063616c6c206661696c7572652073657475760741b6044820152606401610c84565b60cf5460408051635c975abb60e01b815290517f916f812584e0b001e8c6ab604fa549cc16c9d0b2f60b17aa0b4ff5eefe3e7725926001600160a01b031691635c975abb9160048083019260209291908290030181865afa158015612b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3991906154a1565b60d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb091906154a1565b60d05460d15460d25460d35460d454604080516306fdde0360e01b8152905163ffffffff600160c01b8804811697600160a01b810490911696959493926001600160a01b03909116916306fdde03916004808201926000929091908290030181865afa158015612c24573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4c91908101906157df565b60d060009054906101000a90046001600160a01b03166001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cc791908101906157df565b612ccf611f55565b612cd7612260565b604051612cef9c9b9a99989796959493929190615827565b60405180910390a1505050505050612d076001609c55565b8015611123576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610ff4565b6066546001600160a01b0316612d5d613cc6565b6001600160a01b031614612d835760405162461bcd60e51b8152600401610c8490615505565b60d5805461ff001916610100908117918290556040517fb496b9628e839102454d8b483ba451c4be96675009b637273a00e4ab6a59db72926117ea92900460ff161515815260200190565b6066546001600160a01b0316612de2613cc6565b6001600160a01b03161480612dfd5750612dfd610b94613cc6565b612e195760405162461bcd60e51b8152600401610c8490615652565b828114612e385760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57612e8b858583818110612e5857612e5861554b565b9050602002016020810190612e6d9190614e4b565b848484818110612e7f57612e7f61554b565b9050602002013561421f565b80612e9581615561565b915050612e3b565b6066546001600160a01b0316612eb1613cc6565b6001600160a01b031614612ed75760405162461bcd60e51b8152600401610c8490615505565b6000846001600160a01b0316848484604051612ef49291906158ad565b60006040518083038185875af1925050503d8060008114612f31576040519150601f19603f3d011682016040523d82523d6000602084013e612f36565b606091505b505090508061175c5760405162461bcd60e51b815260206004820152601460248201527363616c6c206661696c757265206578656375746560601b6044820152606401610c84565b612f86613d49565b86421115612fd65760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610c84565b6001600160a01b038816600090815260d8602052604090205486146130265760405162461bcd60e51b8152602060048201526006602482015265216e6f6e636560d01b6044820152606401610c84565b60007f8698fbcc7273f96a670eb203cb707d8ec171123f24eaf075b1e754b71119e59e60d060009054906101000a90046001600160a01b03166001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561309c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c491908101906157df565b6040516020016130d491906158bd565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905263ffffffff871660c082015285151560e082015261010001604051602081830303815290604052805190602001209050600061315182614258565b90506000613161828787876142a6565b90508a6001600160a01b0316816001600160a01b0316146131b85760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610c84565b6001600160a01b0381166131f85760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b6044820152606401610c84565b6001600160a01b038b16600090815260d8602052604081208054600192906132219084906154ed565b909155506132329050818989613e4e565b50505061323f6001609c55565b5050505050505050565b60608060005b84518110156132cc578160008560008885815181106132705761327061554b565b60200260200101515189868151811061328b5761328b61554b565b60200260200101516040516020016132a8969594939291906158d9565b604051602081830303815290604052915080806132c490615561565b91505061324f565b50806040516024016132de91906151a9565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b6066546001600160a01b0316613324613cc6565b6001600160a01b0316148061333f575061333f610b14613cc6565b61337f5760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b613388816141e5565b6040516001600160a01b038216907f8c2bee8063bb4464870b7dfa415ebb2fe80bfa73ba20d6fbf0d42791274667ff90600090a250565b6133c7613cd0565b6001600160a01b0381161561346d576040516301ffc9a760e01b815263736bd41d60e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015613421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061344591906154a1565b61346d576040516358b7533f60e11b81526001600160a01b0382166004820152602401610c84565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa29060200160405180910390a150565b6001600160a01b038116600090815260d6602052604081205460048114806134e95750806005145b806118c2575080600614806118cd575060071492915050565b61350a613d49565b60015b818110156135c7578282613522600184615943565b8181106135315761353161554b565b90506020020160208101906135469190614e4b565b6001600160a01b03168383838181106135615761356161554b565b90506020020160208101906135769190614e4b565b6001600160a01b0316116135b55760405162461bcd60e51b815260206004820152600660248201526510b7b93232b960d11b6044820152606401610c84565b806135bf81615561565b91505061350d565b506136078585858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506142c492505050565b61175c6001609c55565b6066546001600160a01b0316613625613cc6565b6001600160a01b031614806136405750613640610b14613cc6565b6136805760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b6000806000806000808680602001905181019061369d919061595a565b949a5092985090965094509250905060648111156136ea5760405162461bcd60e51b815260206004820152600a6024820152696261642071756f72756d60b01b6044820152606401610c84565b606481111561372e5760405162461bcd60e51b815260206004820152601060248201526f3130b21036b4b72932ba32b73a34b7b760811b6044820152606401610c84565b600060d35411801561374a575060d0546001600160a01b031615155b1561379f57613757611f55565b82111561379f5760405162461bcd60e51b815260206004820152601660248201527573706f6e736f72203e20736861726573537570706c7960501b6044820152606401610c84565b63ffffffff8616156137ca5760d0805463ffffffff60a01b1916600160a01b63ffffffff8916021790555b63ffffffff8516156137f55760d0805463ffffffff60c01b1916600160c01b63ffffffff8816021790555b60d184905560d283905560d382905560d48190556040805163ffffffff808916825287166020820152908101859052606081018490526080810183905260a081018290527fc10758ccd7d1dd3330e7bbe13a1a1d6bbb414967932376ee24989bad95edcdc19060c00160405180910390a150505050505050565b613877613cd0565b6001600160a01b0381166138dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c84565b6114b2816140cb565b6001600160a01b038116600090815260d6602052604081205460028114806134e9575080600314806118c2575080600614806118cd575060071492915050565b61392d613d49565b63ffffffff8116600090815260d960205260409020600261394d83613aea565b600781111561395e5761395e615471565b146139955760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60078101546001600160a01b03166139ab613cc6565b6001600160a01b03161480613a53575060d35460d05460078301546001600160a01b0391821691633a46b1a891166139e4600142615943565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015613a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5191906154be565b105b80613a645750613a64610b14613cc6565b613a9f5760405162461bcd60e51b815260206004820152600c60248201526b2163616e63656c6c61626c6560a01b6044820152606401610c84565b60068101805460ff1916600117905560405163ffffffff8316907f8896f24cff41b54acf76c2560861f33cd20fd76c4df0b68a3515c354e4b6c81a90600090a2506114b26001609c55565b63ffffffff818116600090815260d96020908152604080832081516101c08101835281548087168252600160201b8104871694820194909452600160401b8404861681840152600160601b840486166060820152600160801b84048616608080830191909152600160a01b90940490951660a0860152600181015460c0860152600281015460e08601526003810154610100860152600480820154610120870152600582015461014087015282519384019283905293948594909391926101608501929160068501918288855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411613bb75750505092845250505060078201546001600160a01b03166020820152600890910154604090910152805190915063ffffffff16613c255750600092915050565b6101608101515115613c3a5750600392915050565b604081015163ffffffff16613c525750600192915050565b806060015163ffffffff164211613c6c5750600292915050565b806080015163ffffffff164211613c865750600492915050565b8060e0015181610100015110613c9f5750600792915050565b6101608101516020015115613cb75750600692915050565b50600592915050565b50919050565b600061188a614540565b613cd8613cc6565b6001600160a01b0316613cf36033546001600160a01b031690565b6001600160a01b0316146126cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c84565b6002609c541415613d9c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c84565b6002609c55565b6001609c55565b60cf546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f19906044015b600060405180830381600087803b158015613df957600080fd5b505af1158015613e0d573d6000803e3d6000fd5b505050505050565b60cf54604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b63ffffffff8216600090815260d9602052604090206002613e6e84613aea565b6007811115613e7f57613e7f615471565b14613eb65760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60d0548154604051630748d63560e31b81526001600160a01b038781166004830152600160401b90920463ffffffff1660248201526000929190911690633a46b1a890604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d91906154be565b905060008111613f795760405162461bcd60e51b815260206004820152600760248201526610b6b2b6b132b960c91b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff8816845290915290205460ff1615613fdb5760405162461bcd60e51b81526020600482015260056024820152641d9bdd195960da1b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff881684529091528120805460ff1916600117905561401761186e565b9050826004015481111561402d57600483018190555b8315614042576002830180548301905561404d565b600383018054830190555b8315158563ffffffff16876001600160a01b03167f786755545a7e27c12c90cc7f0934514d03fdacfe3684a340b8c4100531e7ecd58560405161409291815260200190565b60405180910390a4505050505050565b60da546000906140c590600160201b90046001600160a01b031682846001614207565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d054604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b600054610100900460ff1661417d5760405162461bcd60e51b8152600401610c84906159b8565b6126cc614574565b600054610100900460ff166141ac5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145ab565b600054610100900460ff166141db5760405162461bcd60e51b8152600401610c84906159b8565b61112382826145d2565b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b600061421585858585614613565b5095945050505050565b60d0546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401613ddf565b60006140c5614265614812565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006142b78787878761488d565b9150915061421581614951565b60006142ce61186e565b905082156142e7576142e76142e1613cc6565b84613e15565b83156142fe576142fe6142f8613cc6565b8561411d565b60005b82518110156144ec57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031684838151811061433c5761433c61554b565b60200260200101516001600160a01b0316141561436657506067546001600160a01b031631614434565b600084838151811061437a5761437a61554b565b602090810291909101810151606754604080516001600160a01b03928316602480830191909152825180830390910181526044909101825293840180516001600160e01b03166370a0823160e01b179052519116916143d8916158bd565b600060405180830381855afa9150503d8060008114614413576040519150601f19603f3d011682016040523d82523d6000602084013e614418565b606091505b509150508080602001905181019061443091906154be565b9150505b6000838261444289896154ed565b61444c91906156b1565b61445691906156d0565b905080156144d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031685848151811061448e5761448e61554b565b60200260200101516001600160a01b0316146144cd576144c88584815181106144b9576144b961554b565b60200260200101518983614a9f565b6144d7565b6144d78882614b6e565b505080806144e490615561565b915050614301565b5083836144f7613cc6565b6001600160a01b03167fa21c268847f2b8adac3751ed0683330abe9fdd6cc4a7a8fc6787633d4126e0d48886604051614531929190615a03565b60405180910390a45050505050565b60006014361080159061455d575060ce546001600160a01b031633145b1561456f575060131936013560601c90565b503390565b600054610100900460ff1661459b5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145a6613cc6565b6140cb565b600054610100900460ff16613da35760405162461bcd60e51b8152600401610c84906159b8565b600054610100900460ff166145f95760405162461bcd60e51b8152600401610c84906159b8565b815160209283012081519190920120606891909155606955565b6065546000906060906001600160a01b0316801561478557604051633af85da960e11b81526001600160a01b038216906375f0bb529061466a908a908a908a908a9060009081908190819081903390600401615a73565b600060405180830381600087803b15801561468457600080fd5b505af1158015614698573d6000803e3d6000fd5b5050606754604051635229073f60e01b81526001600160a01b039091169250635229073f91506146d2908a908a908a908a90600401615afd565b6000604051808303816000875af11580156146f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526147199190810190615b3c565b604051631264e26d60e31b815260006004820152821515602482015291945092506001600160a01b03821690639327136890604401600060405180830381600087803b15801561476857600080fd5b505af115801561477c573d6000803e3d6000fd5b50505050614808565b606754604051635229073f60e01b81526001600160a01b0390911690635229073f906147bb908a908a908a908a90600401615afd565b6000604051808303816000875af11580156147da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526148029190810190615b3c565b90935091505b5094509492505050565b600061188a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61484160685490565b6069546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156148c45750600090506003614948565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614918573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661494157600060019250925050614948565b9150600090505b94509492505050565b600081600481111561496557614965615471565b141561496e5750565b600181600481111561498257614982615471565b14156149d05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c84565b60028160048111156149e4576149e4615471565b1415614a325760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c84565b6003816004811115614a4657614a46615471565b14156114b25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c84565b600080614b0785600063a9059cbb8787604051602401614ad49291906001600160a01b03929092168252602082015260400190565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506000614bd2565b91509150818015614b30575080511580614b30575080806020019051810190614b3091906154a1565b61175c5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610c84565b6000614b8c8383604051806020016040528060008152506000614bd2565b509050806126b55760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610c84565b60006060614be286868686614613565b9097909650945050505050565b600183019183908215614c715791602002820160005b83821115614c4257835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614c05565b8015614c6f5782816101000a81549060ff0219169055600101602081600001049283019260010302614c42565b505b50614c7d929150614d13565b5090565b60405180608001604052806004906020820280368337509192915050565b828054614cab9061567c565b90600052602060002090601f016020900481019282614ccd5760008555614c71565b82601f10614ce657805160ff1916838001178555614c71565b82800160010185558215614c71579182015b82811115614c71578251825591602001919060010190614cf8565b5b80821115614c7d5760008155600101614d14565b600060208284031215614d3a57600080fd5b5035919050565b60006101a08201905063ffffffff8f16825263ffffffff8e16602083015263ffffffff8d16604083015263ffffffff8c16606083015263ffffffff8b16608083015263ffffffff8a1660a08301528860c08301528760e0830152866101008301528561012083015284610140830152614dc66101608301856001600160a01b03169052565b826101808301529e9d5050505050505050505050505050565b80151581146114b257600080fd5b60008060408385031215614e0057600080fd5b8235614e0b81614ddf565b91506020830135614e1b81614ddf565b809150509250929050565b6001600160a01b03811681146114b257600080fd5b8035614e4681614e26565b919050565b600060208284031215614e5d57600080fd5b81356118cd81614e26565b63ffffffff811681146114b257600080fd5b600060208284031215614e8c57600080fd5b81356118cd81614e68565b60008083601f840112614ea957600080fd5b5081356001600160401b03811115614ec057600080fd5b6020830191508360208260051b8501011115614edb57600080fd5b9250929050565b60008060008060408587031215614ef857600080fd5b84356001600160401b0380821115614f0f57600080fd5b614f1b88838901614e97565b90965094506020870135915080821115614f3457600080fd5b50614f4187828801614e97565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614f8b57614f8b614f4d565b604052919050565b60006001600160401b03821115614fac57614fac614f4d565b50601f01601f191660200190565b600082601f830112614fcb57600080fd5b8135614fde614fd982614f93565b614f63565b818152846020838601011115614ff357600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561502257600080fd5b81356001600160401b0381111561503857600080fd5b61504484828501614fba565b949350505050565b60008083601f84011261505e57600080fd5b5081356001600160401b0381111561507557600080fd5b602083019150836020828501011115614edb57600080fd5b600080600080600080608087890312156150a657600080fd5b86356001600160401b03808211156150bd57600080fd5b6150c98a838b0161504c565b9098509650602089013591506150de82614e68565b90945060408801359350606088013590808211156150fb57600080fd5b5061510889828a0161504c565b979a9699509497509295939492505050565b60808101818360005b60048110156151445781511515835260209283019290910190600101615123565b50505092915050565b60005b83811015615168578181015183820152602001615150565b83811115615177576000848401525b50505050565b6000815180845261519581602086016020860161514d565b601f01601f19169290920160200192915050565b6020815260006118cd602083018461517d565b600080604083850312156151cf57600080fd5b8235614e0b81614e68565b6000806000604084860312156151ef57600080fd5b83356151fa81614e68565b925060208401356001600160401b0381111561521557600080fd5b6152218682870161504c565b9497909650939450505050565b6000806000806060858703121561524457600080fd5b843561524f81614e26565b93506020850135925060408501356001600160401b0381111561527157600080fd5b614f418782880161504c565b600080600080600080600080610100898b03121561529a57600080fd5b88356152a581614e26565b9750602089013596506040890135955060608901356152c381614e68565b945060808901356152d381614ddf565b935060a089013560ff811681146152e957600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806040838503121561531957600080fd5b823561532481614e26565b91506020830135614e1b81614e68565b6000806040838503121561534757600080fd5b82356001600160401b038082111561535e57600080fd5b818501915085601f83011261537257600080fd5b813560208282111561538657615386614f4d565b8160051b615395828201614f63565b928352848101820192828101908a8511156153af57600080fd5b83870192505b848310156153eb578235868111156153cd5760008081fd5b6153db8c86838b0101614fba565b83525091830191908301906153b5565b97506153fb915050878201614e3b565b9450505050509250929050565b60008060008060006080868803121561542057600080fd5b853561542b81614e26565b9450602086013593506040860135925060608601356001600160401b0381111561545457600080fd5b61546088828901614e97565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b602081016008831061549b5761549b615471565b91905290565b6000602082840312156154b357600080fd5b81516118cd81614ddf565b6000602082840312156154d057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615500576155006154d7565b500190565b602080825260059082015264085898585b60da1b604082015260600190565b6020808252600d908201526c2161727261792070617269747960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415615575576155756154d7565b5060010190565b600063ffffffff80831681811415615596576155966154d7565b6001019392505050565b600063ffffffff8083168185168083038211156155bf576155bf6154d7565b01949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600063ffffffff808c16835260e0602084015261561260e084018b8d6155c8565b818a16604085015288606085015287151560808501528660a085015283810360c08501526156418186886155c8565b9d9c50505050505050505050505050565b60208082526010908201526f10b130b0b610131010b6b0b730b3b2b960811b604082015260600190565b600181811c9082168061569057607f821691505b60208210811415613cc057634e487b7160e01b600052602260045260246000fd5b60008160001904831182151516156156cb576156cb6154d7565b500290565b6000826156ed57634e487b7160e01b600052601260045260246000fd5b500490565b6000615700614fd984614f93565b905082815283838301111561571457600080fd5b6118cd83602083018461514d565b600082601f83011261573357600080fd5b6118cd838351602085016156f2565b60008060008060008060c0878903121561575b57600080fd5b865161576681614e26565b602088015190965061577781614e26565b604088015190955061578881614e26565b606088015190945061579981614e26565b60808801519093506157aa81614e26565b60a08801519092506001600160401b038111156157c657600080fd5b6157d289828a01615722565b9150509295509295509295565b6000602082840312156157f157600080fd5b81516001600160401b0381111561580757600080fd5b8201601f8101841361581857600080fd5b615044848251602084016156f2565b60006101808e151583528d1515602084015263ffffffff808e166040850152808d166060850152508a60808401528960a08401528860c08401528760e08401528061010084015261587a8184018861517d565b905082810361012084015261588f818761517d565b610140840195909552505061016001529a9950505050505050505050565b8183823760009101908152919050565b600082516158cf81846020870161514d565b9190910192915050565b600087516158eb818460208c0161514d565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b166001820152856015820152846035820152835161593381605584016020880161514d565b0160550198975050505050505050565b600082821015615955576159556154d7565b500390565b60008060008060008060c0878903121561597357600080fd5b865161597e81614e68565b602088015190965061598f81614e68565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b81811015615a51578551851683529483019491830191600101615a33565b509098975050505050505050565b60028110615a6f57615a6f615471565b9052565b6001600160a01b038b81168252602082018b905261016060408301819052600091615aa08483018d61517d565b9150615aaf606085018c615a5f565b608084019990995260a08301979097525060c081019490945291851660e084015284166101008301528183036101208301526000835290921661014090920191909152602001949350505050565b60018060a01b0385168152836020820152608060408201526000615b24608083018561517d565b9050615b336060830184615a5f565b95945050505050565b60008060408385031215615b4f57600080fd5b8251615b5a81614ddf565b60208401519092506001600160401b03811115615b7657600080fd5b615b8285828601615722565b915050925092905056fe322e322e352b6f70656e67736e2e70617961626c65776974686261616c2e6972656c6179726563697069656e74a2646970667358221220e7f7a8af70f47c4c0a43ae70fdb50ef5f9643adc80e4e50e8e0c3ddc18ff5f7f64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "burnLoot(address[],uint256[])": { + "params": { + "amount": "Array of amounts to burn", + "from": "Array of addresses to lose loot" + } + }, + "burnShares(address[],uint256[])": { + "params": { + "amount": "Array of amounts to burn", + "from": "Array of addresses to lose shares" + } + }, + "cancelProposal(uint32)": { + "details": "Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold", + "params": { + "id": "Number of proposal in `proposals` mapping to process for execution." + } + }, + "executeAsBaal(address,uint256,bytes)": { + "details": "Function to Execute arbitrary code as baal - useful if funds are accidentally sent here", + "params": { + "_data": "arbitrary transaction data", + "_to": "address to call", + "_value": "value to include in wei" + } + }, + "getProposalStatus(uint32)": { + "params": { + "id": "Number of proposal in proposals" + }, + "returns": { + "_0": "[cancelled, processed, passed, actionFailed]" + } + }, + "isAdmin(address)": { + "params": { + "shaman": "Address attempting to execute admin permissioned functions" + } + }, + "isGovernor(address)": { + "params": { + "shaman": "Address attempting to execute governor permissioned functions" + } + }, + "isManager(address)": { + "params": { + "shaman": "Address attempting to execute manager permissioned functions" + } + }, + "mintLoot(address[],uint256[])": { + "params": { + "amount": "Array of amounts to mint", + "to": "Array of addresses to mint loot" + } + }, + "mintShares(address[],uint256[])": { + "params": { + "amount": "Array of amounts to mint", + "to": "Array of addresses to receive shares" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "processProposal(uint32,bytes)": { + "details": "Proposal must have succeeded, not been processed, not expired, retention threshold must be met", + "params": { + "id": "Number of proposal in `proposals` mapping to process for execution.", + "proposalData": "Packed multisend data to execute via Gnosis multisend library" + } + }, + "ragequit(address,uint256,uint256,address[])": { + "params": { + "lootToBurn": "Baal pure economic weight to burn.", + "sharesToBurn": "Baal voting weight to burn.", + "to": "Account that receives 'fair share'.", + "tokens": "Array of tokens to include in rage quit calculation" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAdminConfig(bool,bool)": { + "params": { + "pauseLoot": "Turn loot transfers on or off", + "pauseShares": "Turn share transfers on or off" + } + }, + "setAvatar(address)": { + "details": "Sets the avatar to a new avatar (`newAvatar`)." + }, + "setGovernanceConfig(bytes)": { + "params": { + "_governanceConfig": "Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound" + } + }, + "setGuard(address)": { + "details": "Set a guard that checks transactions before execution.", + "params": { + "_guard": "The address of the guard to be used or the 0 address to disable the guard." + } + }, + "setShamans(address[],uint256[])": { + "params": { + "_permissions": "Permission level of each shaman in _shamans", + "_shamans": "Addresses of shaman contracts" + } + }, + "setTarget(address)": { + "details": "Sets the target to a new target (`newTarget`)." + }, + "setTrustedForwarder(address)": { + "params": { + "_trustedForwarderAddress": "Trusted forwarder's address" + } + }, + "setUp(bytes)": { + "params": { + "_initializationParams": "Encoded setup information." + } + }, + "sponsorProposal(uint32)": { + "params": { + "id": "Number of proposal in `proposals` mapping to sponsor." + } + }, + "state(uint32)": { + "params": { + "id": "Number of proposal in proposals" + }, + "returns": { + "_0": "Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed \\-> Cancelled \\-> Defeated" + } + }, + "submitProposal(bytes,uint32,uint256,string)": { + "params": { + "details": "Context for proposal.", + "proposalData": "Multisend encoded transactions or proposal data" + }, + "returns": { + "_0": "proposal Count for submitted proposal." + } + }, + "submitVote(uint32,bool)": { + "params": { + "approved": "If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.", + "id": "Number of proposal in `proposals` mapping to cast vote on." + } + }, + "submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)": { + "params": { + "approved": "If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.", + "expiry": "Expiration of signature.", + "id": "Number of proposal in `proposals` mapping to cast vote on.", + "r": "r in signature", + "s": "s in signature", + "v": "v in signature", + "voter": "Address of member who submitted vote." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Baal ';_;'.", + "version": 1 + }, + "userdoc": { + "errors": { + "NotIERC165Compliant(address)": [ + { + "notice": "`guard_` does not implement IERC165." + } + ] + }, + "kind": "user", + "methods": { + "burnLoot(address[],uint256[])": { + "notice": "Baal-or-manager-only function to burn loot." + }, + "burnShares(address[],uint256[])": { + "notice": "Baal-or-manager-only function to burn shares." + }, + "cancelProposal(uint32)": { + "notice": "Cancel proposal prior to execution" + }, + "executeAsBaal(address,uint256,bytes)": { + "notice": "Can only be called by the avatar which means this can only be called if passed by another proposal or by a delegated signer on the Safe" + }, + "getProposalStatus(uint32)": { + "notice": "Helper to get recorded proposal flags" + }, + "hashOperation(bytes)": { + "notice": "Returns the keccak256 hash of calldata" + }, + "isAdmin(address)": { + "notice": "Helper to check if shaman permission contains admin capabilities" + }, + "isGovernor(address)": { + "notice": "Helper to check if shaman permission contains governor capabilities" + }, + "isManager(address)": { + "notice": "Helper to check if shaman permission contains manager capabilities" + }, + "isTrustedForwarder(address)": { + "notice": "return if the forwarder is trusted to forward relayed transactions to us. the forwarder is required to verify the sender's signature, and verify the call is not a replay." + }, + "lockAdmin()": { + "notice": "Lock admin so setShamans cannot be called with admin changes" + }, + "lockGovernor()": { + "notice": "Lock governor so setShamans cannot be called with governor changes" + }, + "lockManager()": { + "notice": "Lock manager so setShamans cannot be called with manager changes" + }, + "mintLoot(address[],uint256[])": { + "notice": "Baal-or-manager-only function to mint loot." + }, + "mintShares(address[],uint256[])": { + "notice": "Baal-or-manager-only function to mint shares." + }, + "processProposal(uint32,bytes)": { + "notice": "Process `proposal` & execute internal functions." + }, + "ragequit(address,uint256,uint256,address[])": { + "notice": "Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`" + }, + "setAdminConfig(bool,bool)": { + "notice": "Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token" + }, + "setAvatar(address)": { + "notice": "Can only be called by the current owner." + }, + "setGovernanceConfig(bytes)": { + "notice": "Baal-or-governance-only function to change periods." + }, + "setShamans(address[],uint256[])": { + "notice": "Baal-only function to set shaman status." + }, + "setTarget(address)": { + "notice": "Can only be called by the current owner." + }, + "setTrustedForwarder(address)": { + "notice": "Baal-or-governance only function to set trusted forwarder for meta-transactions." + }, + "setUp(bytes)": { + "notice": "Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights." + }, + "sponsorProposal(uint32)": { + "notice": "Sponsor proposal to Baal `members` for approval within voting period." + }, + "state(uint32)": { + "notice": "State helper to determine proposal state" + }, + "submitProposal(bytes,uint32,uint256,string)": { + "notice": "Submit proposal to Baal `members` for approval within given voting period." + }, + "submitVote(uint32,bool)": { + "notice": "Submit vote - proposal must exist & voting period must not have ended." + }, + "submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)": { + "notice": "Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended." + }, + "totalLoot()": { + "notice": "Helper to check total supply of child loot contract" + }, + "totalShares()": { + "notice": "Helper to check total supply of child shares contract" + }, + "totalSupply()": { + "notice": "Helper to check total supply of loot and shares" + } + }, + "notice": "Flexible guild contract inspired by Moloch DAO framework.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/Baal.sol:Baal", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/Baal.sol:Baal", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/Baal.sol:Baal", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3614, + "contract": "contracts/Baal.sol:Baal", + "label": "guard", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 3191, + "contract": "contracts/Baal.sol:Baal", + "label": "avatar", + "offset": 0, + "slot": "102", + "type": "t_address" + }, + { + "astId": 3194, + "contract": "contracts/Baal.sol:Baal", + "label": "target", + "offset": 0, + "slot": "103", + "type": "t_address" + }, + { + "astId": 7403, + "contract": "contracts/Baal.sol:Baal", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "104", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/Baal.sol:Baal", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "105", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "106", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4893, + "contract": "contracts/Baal.sol:Baal", + "label": "_status", + "offset": 0, + "slot": "156", + "type": "t_uint256" + }, + { + "astId": 4951, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "157", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3804, + "contract": "contracts/Baal.sol:Baal", + "label": "_trustedForwarder", + "offset": 0, + "slot": "206", + "type": "t_address" + }, + { + "astId": 10058, + "contract": "contracts/Baal.sol:Baal", + "label": "lootToken", + "offset": 0, + "slot": "207", + "type": "t_contract(IBaalToken)14080" + }, + { + "astId": 10061, + "contract": "contracts/Baal.sol:Baal", + "label": "sharesToken", + "offset": 0, + "slot": "208", + "type": "t_contract(IBaalToken)14080" + }, + { + "astId": 10066, + "contract": "contracts/Baal.sol:Baal", + "label": "votingPeriod", + "offset": 20, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10068, + "contract": "contracts/Baal.sol:Baal", + "label": "gracePeriod", + "offset": 24, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10070, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalCount", + "offset": 28, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10072, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalOffering", + "offset": 0, + "slot": "209", + "type": "t_uint256" + }, + { + "astId": 10074, + "contract": "contracts/Baal.sol:Baal", + "label": "quorumPercent", + "offset": 0, + "slot": "210", + "type": "t_uint256" + }, + { + "astId": 10076, + "contract": "contracts/Baal.sol:Baal", + "label": "sponsorThreshold", + "offset": 0, + "slot": "211", + "type": "t_uint256" + }, + { + "astId": 10078, + "contract": "contracts/Baal.sol:Baal", + "label": "minRetentionPercent", + "offset": 0, + "slot": "212", + "type": "t_uint256" + }, + { + "astId": 10080, + "contract": "contracts/Baal.sol:Baal", + "label": "adminLock", + "offset": 0, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10082, + "contract": "contracts/Baal.sol:Baal", + "label": "managerLock", + "offset": 1, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10084, + "contract": "contracts/Baal.sol:Baal", + "label": "governorLock", + "offset": 2, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10088, + "contract": "contracts/Baal.sol:Baal", + "label": "shamans", + "offset": 0, + "slot": "214", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 10094, + "contract": "contracts/Baal.sol:Baal", + "label": "memberVoted", + "offset": 0, + "slot": "215", + "type": "t_mapping(t_address,t_mapping(t_uint32,t_bool))" + }, + { + "astId": 10098, + "contract": "contracts/Baal.sol:Baal", + "label": "votingNonces", + "offset": 0, + "slot": "216", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 10103, + "contract": "contracts/Baal.sol:Baal", + "label": "proposals", + "offset": 0, + "slot": "217", + "type": "t_mapping(t_uint256,t_struct(Proposal)10146_storage)" + }, + { + "astId": 10105, + "contract": "contracts/Baal.sol:Baal", + "label": "latestSponsoredProposalId", + "offset": 0, + "slot": "218", + "type": "t_uint32" + }, + { + "astId": 10107, + "contract": "contracts/Baal.sol:Baal", + "label": "multisendLibrary", + "offset": 4, + "slot": "218", + "type": "t_address" + }, + { + "astId": 10110, + "contract": "contracts/Baal.sol:Baal", + "label": "versionRecipient", + "offset": 0, + "slot": "219", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bool)4_storage": { + "base": "t_bool", + "encoding": "inplace", + "label": "bool[4]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IBaalToken)14080": { + "encoding": "inplace", + "label": "contract IBaalToken", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint32,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint32 => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint32,t_bool)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_struct(Proposal)10146_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Baal.Proposal)", + "numberOfBytes": "32", + "value": "t_struct(Proposal)10146_storage" + }, + "t_mapping(t_uint32,t_bool)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Proposal)10146_storage": { + "encoding": "inplace", + "label": "struct Baal.Proposal", + "members": [ + { + "astId": 10117, + "contract": "contracts/Baal.sol:Baal", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10119, + "contract": "contracts/Baal.sol:Baal", + "label": "prevProposalId", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10121, + "contract": "contracts/Baal.sol:Baal", + "label": "votingStarts", + "offset": 8, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10123, + "contract": "contracts/Baal.sol:Baal", + "label": "votingEnds", + "offset": 12, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10125, + "contract": "contracts/Baal.sol:Baal", + "label": "graceEnds", + "offset": 16, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10127, + "contract": "contracts/Baal.sol:Baal", + "label": "expiration", + "offset": 20, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10129, + "contract": "contracts/Baal.sol:Baal", + "label": "baalGas", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 10131, + "contract": "contracts/Baal.sol:Baal", + "label": "yesVotes", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10133, + "contract": "contracts/Baal.sol:Baal", + "label": "noVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10135, + "contract": "contracts/Baal.sol:Baal", + "label": "maxTotalSharesAndLootAtVote", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 10137, + "contract": "contracts/Baal.sol:Baal", + "label": "maxTotalSharesAtSponsor", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10141, + "contract": "contracts/Baal.sol:Baal", + "label": "status", + "offset": 0, + "slot": "6", + "type": "t_array(t_bool)4_storage" + }, + { + "astId": 10143, + "contract": "contracts/Baal.sol:Baal", + "label": "sponsor", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 10145, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalDataHash", + "offset": 0, + "slot": "8", + "type": "t_bytes32" + } + ], + "numberOfBytes": "288" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAdvTokenSummoner.json b/lib/Baal/deployments/base/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..b6a38ba --- /dev/null +++ b/lib/Baal/deployments/base/BaalAdvTokenSummoner.json @@ -0,0 +1,375 @@ +{ + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "transactionIndex": 5, + "gasUsed": "333334", + "logsBloom": "0x00000000000000000000000000000000400000000000200000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000500000000000000000000000000000000000004000a00080000000000000000400000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000200000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f", + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000d69e5b8f6fa0e5d94b93848700655a78df24e387" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + }, + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 7, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + }, + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 8, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + } + ], + "blockNumber": 7428979, + "cumulativeGasUsed": "695117", + "status": 1, + "byzantium": true + }, + "args": [ + "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/base/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..cc4041a --- /dev/null +++ b/lib/Baal/deployments/base/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,455 @@ +{ + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x28b90921b1d0ef5e696bf0c3c761cf29ace436fc6cbd105b78228638a2cbbec4", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "transactionIndex": 3, + "gasUsed": "2166814", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000002000000000000000000000000000000000000002000000000000000000200000000000000000000", + "blockHash": "0xff76e1472dea2d468c1b509a166e2eac29508d2baf5484f6f9dd1a03db7fc3c1", + "transactionHash": "0x28b90921b1d0ef5e696bf0c3c761cf29ace436fc6cbd105b78228638a2cbbec4", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 7428977, + "transactionHash": "0x28b90921b1d0ef5e696bf0c3c761cf29ace436fc6cbd105b78228638a2cbbec4", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 8, + "blockHash": "0xff76e1472dea2d468c1b509a166e2eac29508d2baf5484f6f9dd1a03db7fc3c1" + } + ], + "blockNumber": 7428977, + "cumulativeGasUsed": "3288349", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_safeAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_forwarderAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initializationMintParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"initializationTokenParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"postInitializationActions\",\"type\":\"bytes[]\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setSummonerAddr(address)\":{\"details\":\"Sets the address of the BaalSummoner contract\",\"params\":{\"baalSummoner\":\"The address of the BaalSummoner contract\"}},\"summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])\":{\"details\":\"Summon a new Baal contract with a new set of tokens\",\"params\":{\"_forwarderAddr\":\"The address of the forwarder to be used, 0x0 if not set\",\"_safeAddr\":\"The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\",\"_saltNonce\":\"The salt nonce to be used for the Safe contract\",\"initializationMintParams\":\"The parameters for minting the tokens\",\"initializationTokenParams\":\"The parameters for deploying the tokens\",\"postInitializationActions\":\"The actions to be performed after the initialization\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":\"BaalAdvTokenSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../Baal.sol\\\";\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\ncontract BaalAdvTokenSummoner is\\n Initializable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n IBaalSummoner public _baalSummoner;\\n\\n event setSummoner(address summoner);\\n\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize() public initializer {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /**\\n * @dev Sets the address of the BaalSummoner contract\\n * @param baalSummoner The address of the BaalSummoner contract\\n */\\n function setSummonerAddr(address baalSummoner) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /**\\n * @dev Summon a new Baal contract with a new set of tokens\\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\\n * @param _saltNonce The salt nonce to be used for the Safe contract\\n * @param initializationMintParams The parameters for minting the tokens\\n * @param initializationTokenParams The parameters for deploying the tokens\\n * @param postInitializationActions The actions to be performed after the initialization\\n */\\n function summonBaalFromReferrer(\\n address _safeAddr,\\n address _forwarderAddr,\\n uint256 _saltNonce,\\n bytes calldata initializationMintParams,\\n bytes calldata initializationTokenParams,\\n bytes[] calldata postInitializationActions\\n ) external {\\n // summon tokens\\n (address _lootToken, address _sharesToken) = deployTokens(\\n initializationTokenParams\\n );\\n\\n // mint shares loot tokens\\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\\n\\n // summon baal with new tokens\\n address _baal = _baalSummoner.summonBaalFromReferrer(\\n abi.encode(\\n IBaalToken(_sharesToken).name(), \\n IBaalToken(_sharesToken).symbol(),\\n _safeAddr,\\n _forwarderAddr,\\n _lootToken,\\n _sharesToken\\n ),\\n postInitializationActions,\\n _saltNonce,\\n bytes32(bytes(\\\"DHAdvTokenSummoner\\\")) // referrer\\n );\\n\\n // change token ownership to baal\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n }\\n\\n /**\\n * @dev mintTokens\\n * @param initializationTokens The parameters for minting the tokens\\n * @param _lootToken The loot token address\\n * @param _sharesToken The shares token address\\n */\\n function mintTokens(\\n bytes calldata initializationTokens,\\n address _lootToken,\\n address _sharesToken\\n ) internal {\\n (\\n address[] memory summoners, // The address to mint initial tokens to\\n uint256[] memory summonerShares, // The amount of shares to mint\\n uint256[] memory summonerLoot // The amount of loot to mint\\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\\n\\n require(\\n summoners.length == summonerShares.length &&\\n summoners.length == summonerLoot.length,\\n \\\"!array parity\\\"\\n ); /*check array lengths match*/\\n\\n for (uint256 i = 0; i < summoners.length; i++) {\\n if (summonerLoot[i] > 0) {\\n IBaalToken(_lootToken).mint(\\n summoners[i],\\n summonerLoot[i]\\n ); /*grant `to` `amount` `loot`*/\\n }\\n if (summonerShares[i] > 0) {\\n IBaalToken(_sharesToken).mint(\\n summoners[i],\\n summonerShares[i]\\n ); /*grant `to` `amount` `shares`*/\\n }\\n }\\n }\\n\\n /**\\n * @dev deployTokens\\n * @param initializationParams The parameters for deploying the tokens\\n */\\n function deployTokens(\\n bytes calldata initializationParams\\n ) internal returns (address lootToken, address sharesToken) {\\n (\\n string\\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\\n string\\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\\n string\\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\\n string\\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\\n bool _transferableShares /* if shares is transferable */,\\n bool _transferableLoot /* if loot is transferable */\\n ) = abi.decode(\\n initializationParams,\\n (string, string, string, string, bool, bool)\\n );\\n\\n address lootSingleton = _baalSummoner.lootSingleton();\\n address sharesSingleton = _baalSummoner.sharesSingleton();\\n\\n lootToken = address(\\n new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector,\\n _lootName,\\n _lootSymbol\\n )\\n )\\n );\\n\\n sharesToken = address(\\n new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector,\\n _name,\\n _symbol\\n )\\n )\\n );\\n if (!_transferableShares) {\\n IBaalToken(sharesToken).pause();\\n }\\n if (!_transferableLoot) {\\n IBaalToken(lootToken).pause();\\n }\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n }\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x006b6737392584aee27cae0cad838ca0d07004a77b10600884a3813318775807\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b50610020610025565b6100e5565b600054610100900460ff16156100915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6125de61011f600039600081816104ec01528181610538015281816105e10152818161062401526106c001526125de6000f3fe6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setSummonerAddr(address)": { + "details": "Sets the address of the BaalSummoner contract", + "params": { + "baalSummoner": "The address of the BaalSummoner contract" + } + }, + "summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])": { + "details": "Summon a new Baal contract with a new set of tokens", + "params": { + "_forwarderAddr": "The address of the forwarder to be used, 0x0 if not set", + "_safeAddr": "The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe", + "_saltNonce": "The salt nonce to be used for the Safe contract", + "initializationMintParams": "The parameters for minting the tokens", + "initializationTokenParams": "The parameters for deploying the tokens", + "postInitializationActions": "The actions to be performed after the initialization" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 13087, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)14323" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)14323": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/base/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..edf2cde --- /dev/null +++ b/lib/Baal/deployments/base/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "transactionIndex": 5, + "gasUsed": "333334", + "logsBloom": "0x00000000000000000000000000000000400000000000200000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000500000000000000000000000000000000000004000a00080000000000000000400000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000200000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f", + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000d69e5b8f6fa0e5d94b93848700655a78df24e387" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + }, + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 7, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + }, + { + "transactionIndex": 5, + "blockNumber": 7428979, + "transactionHash": "0x1814134e85ab94ac9e6c605a36c97c314fc525e89d807ceb4fcf825010e785d7", + "address": "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 8, + "blockHash": "0xa383616aa7df3547d94adf01e5b8e1c8307966b7c2ed1aa196253247038a169f" + } + ], + "blockNumber": 7428979, + "cumulativeGasUsed": "695117", + "status": 1, + "byzantium": true + }, + "args": [ + "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAndVaultSummoner.json b/lib/Baal/deployments/base/BaalAndVaultSummoner.json new file mode 100644 index 0000000..ab84b5b --- /dev/null +++ b/lib/Baal/deployments/base/BaalAndVaultSummoner.json @@ -0,0 +1,593 @@ +{ + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "transactionIndex": 1, + "gasUsed": "335553", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000010000000000400010000000000000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000008000000000000000000000000020000004000000000000040000000000000000000000000000000020000000200000008000000000000000000000000000000000000000000000000000", + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3", + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000763f5c2e59f997a6cc48bf1228abf61325244702" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + }, + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + }, + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + } + ], + "blockNumber": 7428951, + "cumulativeGasUsed": "399566", + "status": 1, + "byzantium": true + }, + "args": [ + "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/base/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..e9e2666 --- /dev/null +++ b/lib/Baal/deployments/base/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,747 @@ +{ + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x2cce33aadf476374be498982568b514bf7048dce9222be3b2b0c7135ac6f359c", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "transactionIndex": 1, + "gasUsed": "1561244", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x87c94a70ac75a14f4a19bfd4b8ea85c296db428077e109c9ed21ab4c4af66291", + "transactionHash": "0x2cce33aadf476374be498982568b514bf7048dce9222be3b2b0c7135ac6f359c", + "logs": [], + "blockNumber": 7428948, + "cumulativeGasUsed": "1608157", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"SetDelegate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"indexed\":false,\"internalType\":\"struct BaalAndVaultSummoner.Vault\",\"name\":\"vault\",\"type\":\"tuple\"}],\"name\":\"SetVault\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"}],\"name\":\"deactivateVaultAsDao\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"setDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setNewVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"}],\"name\":\"setVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"summonBaalAndVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"summonVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaultIdx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vaults\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deactivateVaultAsDao(uint256,address)\":{\"notice\":\"A DAO can set a Vault as inactive \"},\"setDelegate(address,address)\":{\"notice\":\"Allow a Dao to set a delegate that can manage vault enteries \"},\"setNewVault(address,address,string)\":{\"notice\":\"set a new Vault as active on existing dao (owner only) \"},\"setVault(uint256,bool)\":{\"notice\":\"set a Vault as active or not on existing dao (owner only) \"},\"summonBaalAndVault(bytes,bytes[],uint256,bytes32,string)\":{\"notice\":\"Summon a new baal and add a Vault \"},\"summonVault(address,string)\":{\"notice\":\"create and add a Vault(Safe) to an existing DAO \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAndVaultSummoner.sol\":\"BaalAndVaultSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAndVaultSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\n/*\\nSummon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)\\nCan summon a dao with a new Vault.\\nCan summon a new vault for a dao after initial dao setup.\\nActs as a register and the owner of the contract or DAO can deactivate\\nregister is primarily a helper for UIs\\nOwner of the contract can add new vaults, and set current vaults\\nContract is upgradable and should be owned by a DAO\\n*/\\ncontract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\\n\\n IBaalSummoner public _baalSummoner;\\n uint256 public vaultIdx;\\n\\n struct Vault{\\n uint256 id;\\n bool active;\\n address daoAddress;\\n address vaultAddress;\\n string name;\\n }\\n mapping(uint256 => Vault) public vaults;\\n mapping(address => address) public delegates;\\n\\n event SetVault(\\n Vault vault\\n );\\n\\n event SetDelegate(\\n address daoAddress,\\n address delegate\\n );\\n\\n event setSummoner(\\n address summoner\\n );\\n\\n function initialize() initializer public {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n vaultIdx = 0;\\n }\\n\\n function setSummonerAddr(\\n address baalSummoner\\n ) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /** Summon a new baal and add a Vault */\\n function summonBaalAndVault(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 saltNonce,\\n bytes32 referrer,\\n string memory name\\n ) external returns (address _daoAddress, address _vaultAddress) {\\n _daoAddress = _baalSummoner.summonBaalFromReferrer(\\n initializationParams,\\n initializationActions,\\n saltNonce,\\n referrer\\n );\\n _vaultAddress = summonVault(_daoAddress, name);\\n }\\n\\n /** create and add a Vault(Safe) to an existing DAO */\\n function summonVault(\\n address daoAddress,\\n string memory name\\n ) public returns (address _vaultAddress) {\\n _vaultAddress = _baalSummoner.deployAndSetupSafe(\\n daoAddress\\n );\\n _setNewVault(name, daoAddress, _vaultAddress);\\n }\\n\\n /** set a Vault as active or not on existing dao (owner only) */\\n // Admin functions to help maintain the registry.\\n function setVault(\\n uint256 id,\\n bool active\\n ) public onlyOwner\\n {\\n _setVault(id, active);\\n }\\n\\n /** set a new Vault as active on existing dao (owner only) */\\n // Admin functions to help maintain the registry.\\n function setNewVault(\\n address daoAddress, \\n address vaultAddress,\\n string memory name\\n ) public onlyOwner\\n {\\n _setNewVault(name, daoAddress, vaultAddress);\\n }\\n\\n /** \\n A DAO can set a Vault as inactive \\n */\\n function deactivateVaultAsDao(\\n uint256 id,\\n address daoAddress\\n ) external\\n {\\n require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], \\\"not DAO or delegate\\\");\\n require(vaults[id].daoAddress == daoAddress && vaults[id].active,\\\"!not active DAO vault\\\");\\n _setVault(id, false);\\n }\\n\\n /** Allow a Dao to set a delegate that can manage vault enteries */\\n function setDelegate(\\n address daoAddress,\\n address delegate\\n ) external\\n {\\n require(msg.sender == daoAddress, \\\"!DAO\\\");\\n delegates[daoAddress] = delegate;\\n emit SetDelegate(daoAddress, delegate);\\n }\\n\\n\\n function _setVault(\\n uint256 id, \\n bool active\\n ) internal \\n {\\n vaults[id].active = active;\\n emit SetVault(vaults[id]);\\n }\\n\\n function _setNewVault(\\n string memory name,\\n address daoAddress, \\n address vaultAddress\\n ) internal \\n {\\n vaultIdx += 1;\\n vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);\\n emit SetVault(vaults[vaultIdx]);\\n }\\n\\n function _authorizeUpgrade(address newImplementation)\\n internal\\n onlyOwner\\n override\\n {}\\n}\\n\",\"keccak256\":\"0x5519dacfb28e1a8ec59e4653d8d85f18a2ecf32a9ec00627d4575c94c2c27553\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b5060805160601c611b4c6100526000396000818161049f015281816104df0152818161057f015281816105bf015261064e0152611b4c6000f3fe6080604052600436106101095760003560e01c80638129fc1c11610095578063ac06a9a911610064578063ac06a9a9146102f2578063b395f08614610312578063bb6decc814610332578063bedfb8d414610352578063f2fde38b1461036857600080fd5b80638129fc1c1461024e5780638c64ea4a146102635780638da5cb5b14610294578063a156d863146102b257600080fd5b806352d1902d116100dc57806352d1902d146101a0578063587cde1e146101c35780635c873849146101f9578063619dd5d414610219578063715018a61461023957600080fd5b8063133afcc01461010e57806314b630f9146101305780633659cfe61461016d5780634f1ef2861461018d575b600080fd5b34801561011a57600080fd5b5061012e610129366004611678565b610388565b005b34801561013c57600080fd5b5060c954610150906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017957600080fd5b5061012e6101883660046113f5565b610494565b61012e61019b3660046114ca565b610574565b3480156101ac57600080fd5b506101b5610641565b604051908152602001610164565b3480156101cf57600080fd5b506101506101de3660046113f5565b60cc602052600090815260409020546001600160a01b031681565b34801561020557600080fd5b5061012e61021436600461142f565b6106f4565b34801561022557600080fd5b5061012e61023436600461169d565b6107a1565b34801561024557600080fd5b5061012e6107b3565b34801561025a57600080fd5b5061012e6107c7565b34801561026f57600080fd5b5061028361027e36600461165f565b6108e5565b6040516101649594939291906119d2565b3480156102a057600080fd5b506033546001600160a01b0316610150565b3480156102be57600080fd5b506102d26102cd36600461158d565b6109b0565b604080516001600160a01b03938416815292909116602083015201610164565b3480156102fe57600080fd5b5061015061030d36600461152e565b610a5b565b34801561031e57600080fd5b5061012e61032d366004611468565b610aee565b34801561033e57600080fd5b5061012e61034d3660046113f5565b610b06565b34801561035e57600080fd5b506101b560ca5481565b34801561037457600080fd5b5061012e6103833660046113f5565b610ba1565b336001600160a01b03821614806103b857506001600160a01b03818116600090815260cc60205260409020541633145b6103ff5760405162461bcd60e51b81526020600482015260136024820152726e6f742044414f206f722064656c656761746560681b60448201526064015b60405180910390fd5b600082815260cb60205260409020600101546001600160a01b03828116610100909204161480156104415750600082815260cb602052604090206001015460ff165b6104855760405162461bcd60e51b8152602060048201526015602482015274085b9bdd081858dd1a5d9948111053c81d985d5b1d605a1b60448201526064016103f6565b610490826000610c17565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156104dd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610526600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461054c5760405162461bcd60e51b81526004016103f690611852565b61055581610c64565b6040805160008082526020820190925261057191839190610c6c565b50565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156105bd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610606600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461062c5760405162461bcd60e51b81526004016103f690611852565b61063582610c64565b61049082826001610c6c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106e15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f6565b50600080516020611ad083398151915290565b336001600160a01b038316146107355760405162461bcd60e51b81526004016103f6906020808252600490820152632144414f60e01b604082015260600190565b6001600160a01b03828116600081815260cc602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fbeebfeebc9d1af8057ca45af36b2171fea34cb5b251e394f0bc5fcabde119d7f91015b60405180910390a15050565b6107a9610de6565b6104908282610c17565b6107bb610de6565b6107c56000610e40565b565b600054610100900460ff16158080156107e75750600054600160ff909116105b806108015750303b158015610801575060005460ff166001145b6108645760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f6565b6000805460ff191660011790558015610887576000805461ff0019166101001790555b61088f610e92565b610897610ec1565b600060ca558015610571576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b60cb602052600090815260409020805460018201546002830154600384018054939460ff8416946101009094046001600160a01b039081169493169290919061092d90611a69565b80601f016020809104026020016040519081016040528092919081815260200182805461095990611a69565b80156109a65780601f1061097b576101008083540402835291602001916109a6565b820191906000526020600020905b81548152906001019060200180831161098957829003601f168201915b5050505050905085565b60c95460405163209f369560e01b815260009182916001600160a01b039091169063209f3695906109ef908c908c908c908c908c908c90600401611738565b602060405180830381600087803b158015610a0957600080fd5b505af1158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190611412565b9150610a4d8284610a5b565b905097509795505050505050565b60c954604051633e2108c760e21b81526001600160a01b038481166004830152600092169063f884231c90602401602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adb9190611412565b9050610ae8828483610ee8565b92915050565b610af6610de6565b610b01818484610ee8565b505050565b610b0e610de6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f6565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016108da565b610ba9610de6565b6001600160a01b038116610c0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b61057181610e40565b600082815260cb60205260409081902060018101805460ff191684151517905590517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f7891610795916118e9565b610571610de6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c9f57610b0183611005565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd857600080fd5b505afa925050508015610d08575060408051601f3d908101601f19168201909252610d0591810190611574565b60015b610d6b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f6565b600080516020611ad08339815191528114610dda5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f6565b50610b018383836110a1565b6033546001600160a01b031633146107c55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f6565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610eb95760405162461bcd60e51b81526004016103f69061189e565b6107c56110cc565b600054610100900460ff166107c55760405162461bcd60e51b81526004016103f69061189e565b600160ca6000828254610efb9190611a17565b90915550506040805160a08101825260ca54808252600160208084018281526001600160a01b0388811686880190815288821660608801908152608088018c8152600097885260cb865298909620875181559251948301805491516001600160a81b0319909216951515610100600160a81b03191695909517610100918316919091021790935592516002840180546001600160a01b03191691909316179091559251805192939192610fb4926003850192019061127a565b505060ca54600090815260cb60205260409081902090517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f789250610ff891906118e9565b60405180910390a1505050565b6001600160a01b0381163b6110725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f6565b600080516020611ad083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6110aa836110fc565b6000825111806110b75750805b15610b01576110c6838361113c565b50505050565b600054610100900460ff166110f35760405162461bcd60e51b81526004016103f69061189e565b6107c533610e40565b61110581611005565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6111a45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016103f6565b600080846001600160a01b0316846040516111bf919061171c565b600060405180830381855af49150503d80600081146111fa576040519150601f19603f3d011682016040523d82523d6000602084013e6111ff565b606091505b50915091506112278282604051806060016040528060278152602001611af060279139611230565b95945050505050565b6060831561123f575081611249565b6112498383611250565b9392505050565b8151156112605781518083602001fd5b8060405162461bcd60e51b81526004016103f691906117f3565b82805461128690611a69565b90600052602060002090601f0160209004810192826112a857600085556112ee565b82601f106112c157805160ff19168380011785556112ee565b828001600101855582156112ee579182015b828111156112ee5782518255916020019190600101906112d3565b506112fa9291506112fe565b5090565b5b808211156112fa57600081556001016112ff565b600067ffffffffffffffff8084111561132e5761132e611aa4565b604051601f8501601f19908116603f0116810190828211818310171561135657611356611aa4565b8160405280935085815286868601111561136f57600080fd5b858560208301376000602087830101525050509392505050565b60008083601f84011261139b57600080fd5b50813567ffffffffffffffff8111156113b357600080fd5b6020830191508360208260051b85010111156113ce57600080fd5b9250929050565b600082601f8301126113e657600080fd5b61124983833560208501611313565b60006020828403121561140757600080fd5b813561124981611aba565b60006020828403121561142457600080fd5b815161124981611aba565b6000806040838503121561144257600080fd5b823561144d81611aba565b9150602083013561145d81611aba565b809150509250929050565b60008060006060848603121561147d57600080fd5b833561148881611aba565b9250602084013561149881611aba565b9150604084013567ffffffffffffffff8111156114b457600080fd5b6114c0868287016113d5565b9150509250925092565b600080604083850312156114dd57600080fd5b82356114e881611aba565b9150602083013567ffffffffffffffff81111561150457600080fd5b8301601f8101851361151557600080fd5b61152485823560208401611313565b9150509250929050565b6000806040838503121561154157600080fd5b823561154c81611aba565b9150602083013567ffffffffffffffff81111561156857600080fd5b611524858286016113d5565b60006020828403121561158657600080fd5b5051919050565b600080600080600080600060a0888a0312156115a857600080fd5b873567ffffffffffffffff808211156115c057600080fd5b818a0191508a601f8301126115d457600080fd5b8135818111156115e357600080fd5b8b60208285010111156115f557600080fd5b60209283019950975090890135908082111561161057600080fd5b61161c8b838c01611389565b909750955060408a0135945060608a0135935060808a013591508082111561164357600080fd5b506116508a828b016113d5565b91505092959891949750929550565b60006020828403121561167157600080fd5b5035919050565b6000806040838503121561168b57600080fd5b82359150602083013561145d81611aba565b600080604083850312156116b057600080fd5b823591506020830135801515811461145d57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452611708816020860160208601611a3d565b601f01601f19169290920160200192915050565b6000825161172e818460208701611a3d565b9190910192915050565b60808152600061174c60808301888a6116c7565b602083820381850152818783528183019050818860051b8401018960005b8a8110156117d957858303601f190184528135368d9003601e1901811261179057600080fd5b8c01803567ffffffffffffffff8111156117a957600080fd5b8036038e13156117b857600080fd5b6117c585828985016116c7565b95870195945050509084019060010161176a565b505060408601979097525050505060600152949350505050565b60208152600061124960208301846116f0565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b602080825282548282015260018084015460ff81161515604085015260081c6001600160a01b039081166060850152600285015416608084015260a080840152600384018054600093929190849080841c8185168061194957607f821691505b86821081141561196757634e487b7160e01b84526022600452602484fd5b60c0890182905260e089018180156119865760018114611997576119c2565b60ff198516825288820195506119c2565b60008781526020902060005b858110156119bc57815484820152908901908a016119a3565b83019650505b50939a9950505050505050505050565b85815284151560208201526001600160a01b0384811660408301528316606082015260a060808201819052600090611a0c908301846116f0565b979650505050505050565b60008219821115611a3857634e487b7160e01b600052601160045260246000fd5b500190565b60005b83811015611a58578181015183820152602001611a40565b838111156110c65750506000910152565b600181811c90821680611a7d57607f821691505b60208210811415611a9e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461057157600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a147e58c05b20357cb3919a570b985d63b405a5c57197b71f94854fda882a9a64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101095760003560e01c80638129fc1c11610095578063ac06a9a911610064578063ac06a9a9146102f2578063b395f08614610312578063bb6decc814610332578063bedfb8d414610352578063f2fde38b1461036857600080fd5b80638129fc1c1461024e5780638c64ea4a146102635780638da5cb5b14610294578063a156d863146102b257600080fd5b806352d1902d116100dc57806352d1902d146101a0578063587cde1e146101c35780635c873849146101f9578063619dd5d414610219578063715018a61461023957600080fd5b8063133afcc01461010e57806314b630f9146101305780633659cfe61461016d5780634f1ef2861461018d575b600080fd5b34801561011a57600080fd5b5061012e610129366004611678565b610388565b005b34801561013c57600080fd5b5060c954610150906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017957600080fd5b5061012e6101883660046113f5565b610494565b61012e61019b3660046114ca565b610574565b3480156101ac57600080fd5b506101b5610641565b604051908152602001610164565b3480156101cf57600080fd5b506101506101de3660046113f5565b60cc602052600090815260409020546001600160a01b031681565b34801561020557600080fd5b5061012e61021436600461142f565b6106f4565b34801561022557600080fd5b5061012e61023436600461169d565b6107a1565b34801561024557600080fd5b5061012e6107b3565b34801561025a57600080fd5b5061012e6107c7565b34801561026f57600080fd5b5061028361027e36600461165f565b6108e5565b6040516101649594939291906119d2565b3480156102a057600080fd5b506033546001600160a01b0316610150565b3480156102be57600080fd5b506102d26102cd36600461158d565b6109b0565b604080516001600160a01b03938416815292909116602083015201610164565b3480156102fe57600080fd5b5061015061030d36600461152e565b610a5b565b34801561031e57600080fd5b5061012e61032d366004611468565b610aee565b34801561033e57600080fd5b5061012e61034d3660046113f5565b610b06565b34801561035e57600080fd5b506101b560ca5481565b34801561037457600080fd5b5061012e6103833660046113f5565b610ba1565b336001600160a01b03821614806103b857506001600160a01b03818116600090815260cc60205260409020541633145b6103ff5760405162461bcd60e51b81526020600482015260136024820152726e6f742044414f206f722064656c656761746560681b60448201526064015b60405180910390fd5b600082815260cb60205260409020600101546001600160a01b03828116610100909204161480156104415750600082815260cb602052604090206001015460ff165b6104855760405162461bcd60e51b8152602060048201526015602482015274085b9bdd081858dd1a5d9948111053c81d985d5b1d605a1b60448201526064016103f6565b610490826000610c17565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156104dd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610526600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461054c5760405162461bcd60e51b81526004016103f690611852565b61055581610c64565b6040805160008082526020820190925261057191839190610c6c565b50565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156105bd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610606600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461062c5760405162461bcd60e51b81526004016103f690611852565b61063582610c64565b61049082826001610c6c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106e15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f6565b50600080516020611ad083398151915290565b336001600160a01b038316146107355760405162461bcd60e51b81526004016103f6906020808252600490820152632144414f60e01b604082015260600190565b6001600160a01b03828116600081815260cc602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fbeebfeebc9d1af8057ca45af36b2171fea34cb5b251e394f0bc5fcabde119d7f91015b60405180910390a15050565b6107a9610de6565b6104908282610c17565b6107bb610de6565b6107c56000610e40565b565b600054610100900460ff16158080156107e75750600054600160ff909116105b806108015750303b158015610801575060005460ff166001145b6108645760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f6565b6000805460ff191660011790558015610887576000805461ff0019166101001790555b61088f610e92565b610897610ec1565b600060ca558015610571576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b60cb602052600090815260409020805460018201546002830154600384018054939460ff8416946101009094046001600160a01b039081169493169290919061092d90611a69565b80601f016020809104026020016040519081016040528092919081815260200182805461095990611a69565b80156109a65780601f1061097b576101008083540402835291602001916109a6565b820191906000526020600020905b81548152906001019060200180831161098957829003601f168201915b5050505050905085565b60c95460405163209f369560e01b815260009182916001600160a01b039091169063209f3695906109ef908c908c908c908c908c908c90600401611738565b602060405180830381600087803b158015610a0957600080fd5b505af1158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190611412565b9150610a4d8284610a5b565b905097509795505050505050565b60c954604051633e2108c760e21b81526001600160a01b038481166004830152600092169063f884231c90602401602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adb9190611412565b9050610ae8828483610ee8565b92915050565b610af6610de6565b610b01818484610ee8565b505050565b610b0e610de6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f6565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016108da565b610ba9610de6565b6001600160a01b038116610c0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b61057181610e40565b600082815260cb60205260409081902060018101805460ff191684151517905590517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f7891610795916118e9565b610571610de6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c9f57610b0183611005565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd857600080fd5b505afa925050508015610d08575060408051601f3d908101601f19168201909252610d0591810190611574565b60015b610d6b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f6565b600080516020611ad08339815191528114610dda5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f6565b50610b018383836110a1565b6033546001600160a01b031633146107c55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f6565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610eb95760405162461bcd60e51b81526004016103f69061189e565b6107c56110cc565b600054610100900460ff166107c55760405162461bcd60e51b81526004016103f69061189e565b600160ca6000828254610efb9190611a17565b90915550506040805160a08101825260ca54808252600160208084018281526001600160a01b0388811686880190815288821660608801908152608088018c8152600097885260cb865298909620875181559251948301805491516001600160a81b0319909216951515610100600160a81b03191695909517610100918316919091021790935592516002840180546001600160a01b03191691909316179091559251805192939192610fb4926003850192019061127a565b505060ca54600090815260cb60205260409081902090517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f789250610ff891906118e9565b60405180910390a1505050565b6001600160a01b0381163b6110725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f6565b600080516020611ad083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6110aa836110fc565b6000825111806110b75750805b15610b01576110c6838361113c565b50505050565b600054610100900460ff166110f35760405162461bcd60e51b81526004016103f69061189e565b6107c533610e40565b61110581611005565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6111a45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016103f6565b600080846001600160a01b0316846040516111bf919061171c565b600060405180830381855af49150503d80600081146111fa576040519150601f19603f3d011682016040523d82523d6000602084013e6111ff565b606091505b50915091506112278282604051806060016040528060278152602001611af060279139611230565b95945050505050565b6060831561123f575081611249565b6112498383611250565b9392505050565b8151156112605781518083602001fd5b8060405162461bcd60e51b81526004016103f691906117f3565b82805461128690611a69565b90600052602060002090601f0160209004810192826112a857600085556112ee565b82601f106112c157805160ff19168380011785556112ee565b828001600101855582156112ee579182015b828111156112ee5782518255916020019190600101906112d3565b506112fa9291506112fe565b5090565b5b808211156112fa57600081556001016112ff565b600067ffffffffffffffff8084111561132e5761132e611aa4565b604051601f8501601f19908116603f0116810190828211818310171561135657611356611aa4565b8160405280935085815286868601111561136f57600080fd5b858560208301376000602087830101525050509392505050565b60008083601f84011261139b57600080fd5b50813567ffffffffffffffff8111156113b357600080fd5b6020830191508360208260051b85010111156113ce57600080fd5b9250929050565b600082601f8301126113e657600080fd5b61124983833560208501611313565b60006020828403121561140757600080fd5b813561124981611aba565b60006020828403121561142457600080fd5b815161124981611aba565b6000806040838503121561144257600080fd5b823561144d81611aba565b9150602083013561145d81611aba565b809150509250929050565b60008060006060848603121561147d57600080fd5b833561148881611aba565b9250602084013561149881611aba565b9150604084013567ffffffffffffffff8111156114b457600080fd5b6114c0868287016113d5565b9150509250925092565b600080604083850312156114dd57600080fd5b82356114e881611aba565b9150602083013567ffffffffffffffff81111561150457600080fd5b8301601f8101851361151557600080fd5b61152485823560208401611313565b9150509250929050565b6000806040838503121561154157600080fd5b823561154c81611aba565b9150602083013567ffffffffffffffff81111561156857600080fd5b611524858286016113d5565b60006020828403121561158657600080fd5b5051919050565b600080600080600080600060a0888a0312156115a857600080fd5b873567ffffffffffffffff808211156115c057600080fd5b818a0191508a601f8301126115d457600080fd5b8135818111156115e357600080fd5b8b60208285010111156115f557600080fd5b60209283019950975090890135908082111561161057600080fd5b61161c8b838c01611389565b909750955060408a0135945060608a0135935060808a013591508082111561164357600080fd5b506116508a828b016113d5565b91505092959891949750929550565b60006020828403121561167157600080fd5b5035919050565b6000806040838503121561168b57600080fd5b82359150602083013561145d81611aba565b600080604083850312156116b057600080fd5b823591506020830135801515811461145d57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452611708816020860160208601611a3d565b601f01601f19169290920160200192915050565b6000825161172e818460208701611a3d565b9190910192915050565b60808152600061174c60808301888a6116c7565b602083820381850152818783528183019050818860051b8401018960005b8a8110156117d957858303601f190184528135368d9003601e1901811261179057600080fd5b8c01803567ffffffffffffffff8111156117a957600080fd5b8036038e13156117b857600080fd5b6117c585828985016116c7565b95870195945050509084019060010161176a565b505060408601979097525050505060600152949350505050565b60208152600061124960208301846116f0565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b602080825282548282015260018084015460ff81161515604085015260081c6001600160a01b039081166060850152600285015416608084015260a080840152600384018054600093929190849080841c8185168061194957607f821691505b86821081141561196757634e487b7160e01b84526022600452602484fd5b60c0890182905260e089018180156119865760018114611997576119c2565b60ff198516825288820195506119c2565b60008781526020902060005b858110156119bc57815484820152908901908a016119a3565b83019650505b50939a9950505050505050505050565b85815284151560208201526001600160a01b0384811660408301528316606082015260a060808201819052600090611a0c908301846116f0565b979650505050505050565b60008219821115611a3857634e487b7160e01b600052601160045260246000fd5b500190565b60005b83811015611a58578181015183820152602001611a40565b838111156110c65750506000910152565b600181811c90821680611a7d57607f821691505b60208210811415611a9e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461057157600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a147e58c05b20357cb3919a570b985d63b405a5c57197b71f94854fda882a9a64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "deactivateVaultAsDao(uint256,address)": { + "notice": "A DAO can set a Vault as inactive " + }, + "setDelegate(address,address)": { + "notice": "Allow a Dao to set a delegate that can manage vault enteries " + }, + "setNewVault(address,address,string)": { + "notice": "set a new Vault as active on existing dao (owner only) " + }, + "setVault(uint256,bool)": { + "notice": "set a Vault as active or not on existing dao (owner only) " + }, + "summonBaalAndVault(bytes,bytes[],uint256,bytes32,string)": { + "notice": "Summon a new baal and add a Vault " + }, + "summonVault(address,string)": { + "notice": "create and add a Vault(Safe) to an existing DAO " + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 13477, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)14323" + }, + { + "astId": 13479, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaultIdx", + "offset": 0, + "slot": "202", + "type": "t_uint256" + }, + { + "astId": 13495, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaults", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_uint256,t_struct(Vault)13490_storage)" + }, + { + "astId": 13499, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "delegates", + "offset": 0, + "slot": "204", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)14323": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_struct(Vault)13490_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct BaalAndVaultSummoner.Vault)", + "numberOfBytes": "32", + "value": "t_struct(Vault)13490_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Vault)13490_storage": { + "encoding": "inplace", + "label": "struct BaalAndVaultSummoner.Vault", + "members": [ + { + "astId": 13481, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 13483, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "active", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 13485, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "daoAddress", + "offset": 1, + "slot": "1", + "type": "t_address" + }, + { + "astId": 13487, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaultAddress", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 13489, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/base/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..7eb61d2 --- /dev/null +++ b/lib/Baal/deployments/base/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "transactionIndex": 1, + "gasUsed": "335553", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000010000000000400010000000000000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000008000000000000000000000000020000004000000000000040000000000000000000000000000000020000000200000008000000000000000000000000000000000000000000000000000", + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3", + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000763f5c2e59f997a6cc48bf1228abf61325244702" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + }, + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + }, + { + "transactionIndex": 1, + "blockNumber": 7428951, + "transactionHash": "0xdc524ed14d46eb30f4e339ea0084d130a8d14cff11eec0c57438f5f570fbb596", + "address": "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x6ccca453d75661c943489c69d14f70e1cc25a0e31b3049712908c6caff0a1bd3" + } + ], + "blockNumber": 7428951, + "cumulativeGasUsed": "399566", + "status": 1, + "byzantium": true + }, + "args": [ + "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalSummoner.json b/lib/Baal/deployments/base/BaalSummoner.json new file mode 100644 index 0000000..e945508 --- /dev/null +++ b/lib/Baal/deployments/base/BaalSummoner.json @@ -0,0 +1,666 @@ +{ + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "transactionIndex": 5, + "gasUsed": "333434", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000080000000000000000004004000080000000000000000400000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000200000000000000000000000040000000000000000000000000002000000", + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a", + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000b2b3909661552942ae1115e9fc99df0bc93d71d0" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + }, + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + }, + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + } + ], + "blockNumber": 7428902, + "cumulativeGasUsed": "562179", + "status": 1, + "byzantium": true + }, + "args": [ + "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalSummoner_Implementation.json b/lib/Baal/deployments/base/BaalSummoner_Implementation.json new file mode 100644 index 0000000..c14cae9 --- /dev/null +++ b/lib/Baal/deployments/base/BaalSummoner_Implementation.json @@ -0,0 +1,785 @@ +{ + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x3bcb945187d39306ba5de319a824d9ccf2461d521fd02bb10522ba4843ff7112", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "transactionIndex": 2, + "gasUsed": "2540948", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x321fab5959a3459d5cfe0d2a82e4b351e9cf85ce8dc0b01ab41915a550839017", + "transactionHash": "0x3bcb945187d39306ba5de319a824d9ccf2461d521fd02bb10522ba4843ff7112", + "logs": [], + "blockNumber": 7428900, + "cumulativeGasUsed": "2702897", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "928daf6847beb441da40e990eb20d125", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"}],\"name\":\"DaoReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"baalSafe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"moduleAddr\",\"type\":\"address\"}],\"name\":\"DeployBaalSafe\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"SetAddrsVersion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loot\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"shares\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"existingAddrs\",\"type\":\"uint256\"}],\"name\":\"SummonBaal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addrsVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_moduleAddr\",\"type\":\"address\"}],\"name\":\"deployAndSetupSafe\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"name\":\"deployTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_calls\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"encodeMultisend\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedMultisend\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisFallbackLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisMultisendLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lootSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_template\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisFallbackLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisMultisendLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSafeProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_moduleProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_lootSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sharesSingleton\",\"type\":\"address\"}],\"name\":\"setAddrs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharesSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"summonBaal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"template\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/BaalSummoner.sol\":\"BaalSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/BaalSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"./Baal.sol\\\";\\n\\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\\n // when some of the init addresses are updated\\n uint256 public addrsVersion;\\n\\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\\n\\n // Template contract to use for new Gnosis safe proxies\\n address public gnosisSingleton;\\n\\n // Library to use for EIP1271 compatability\\n address public gnosisFallbackLibrary;\\n\\n // Library to use for all safe transaction executions\\n address public gnosisMultisendLibrary;\\n\\n // template contract to clone for loot ERC20 token\\n address public lootSingleton;\\n\\n // template contract to clone for shares ERC20 token\\n address public sharesSingleton;\\n\\n // Proxy summoners\\n //\\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\\n ModuleProxyFactory moduleProxyFactory;\\n\\n event SetAddrsVersion(\\n uint256 version\\n );\\n\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n\\n event DaoReferral(\\n bytes32 referrer,\\n address daoAddress\\n );\\n\\n event DeployBaalTokens(\\n address lootToken, \\n address sharesToken\\n );\\n\\n event DeployBaalSafe(\\n address baalSafe,\\n address moduleAddr\\n );\\n\\n function initialize() initializer public {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n // must be called after deploy to set libraries\\n function setAddrs(\\n address payable _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) public onlyOwner {\\n require(_lootSingleton != address(0), \\\"!lootSingleton\\\");\\n require(_sharesSingleton != address(0), \\\"!sharesSingleton\\\");\\n require(_gnosisSingleton != address(0), \\\"!gnosisSingleton\\\");\\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\\n\\n template = _template;\\n gnosisSingleton = _gnosisSingleton;\\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\\n lootSingleton = _lootSingleton;\\n sharesSingleton = _sharesSingleton;\\n\\n emit SetAddrsVersion(\\n addrsVersion++\\n );\\n \\n }\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n public\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n function summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) external returns (address) {\\n \\n return\\n _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n }\\n\\n // Add a referrer to help keep track of where deploies are coming from\\n function summonBaalFromReferrer(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address) {\\n address daoAddress;\\n\\n daoAddress = _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n\\n emit DaoReferral(referrer, daoAddress);\\n return daoAddress;\\n }\\n\\n // deploy new share and loot contracts\\n function deployTokens(string memory _name, string memory _symbol) \\n public \\n returns (address lootToken, address sharesToken) \\n {\\n lootToken = address(new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector, \\n string(abi.encodePacked(_name, \\\" LOOT\\\")), \\n string(abi.encodePacked(_symbol, \\\"-LOOT\\\")))\\n ));\\n\\n sharesToken = address(new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector, \\n _name, \\n _symbol)\\n ));\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n\\n }\\n\\n // deploy a safe with module and single module signer setup\\n function deployAndSetupSafe(address _moduleAddr)\\n public\\n returns (address)\\n {\\n // Deploy new safe but do not set it up yet\\n GnosisSafe _safe = GnosisSafe(\\n payable(\\n gnosisSafeProxyFactory.createProxy(\\n gnosisSingleton,\\n bytes(\\\"\\\")\\n )\\n )\\n );\\n // Generate delegate calls so the safe calls enableModule on itself during setup\\n bytes memory _enableBaal = abi.encodeWithSignature(\\n \\\"enableModule(address)\\\",\\n address(_moduleAddr)\\n );\\n bytes memory _enableBaalMultisend = abi.encodePacked(\\n uint8(0),\\n address(_safe),\\n uint256(0),\\n uint256(_enableBaal.length),\\n bytes(_enableBaal)\\n );\\n\\n bytes memory _multisendAction = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n _enableBaalMultisend\\n );\\n\\n // Workaround for solidity dynamic memory array\\n address[] memory _owners = new address[](1);\\n _owners[0] = address(_moduleAddr);\\n\\n // Call setup on safe to enable our new module and set the module as the only signer\\n _safe.setup(\\n _owners,\\n 1,\\n gnosisMultisendLibrary,\\n _multisendAction,\\n gnosisFallbackLibrary,\\n address(0),\\n 0,\\n payable(address(0))\\n );\\n\\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\\n\\n return address(_safe);\\n }\\n\\n // advanced summon baal with different configurations\\n // name and symbol can be blank if bringing own baal tokens\\n // zero address for either loot or shares token will summon new ones\\n // if bringing own tokens the ownership must be transfered to the new DAO\\n // zero address for Safe with summon and setup a new Safe\\n // if bringing existing safe the new dao must be enabled as a module\\n // todo: add a simple summon that just creates a dao with a single summoner\\n function _summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) internal returns (address) {\\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\\n (\\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\\n address _safeAddr, /*address of safe, 0 addr if new*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\\n address _lootToken, /*predeployed loot token, 0 addr if new*/\\n address _sharesToken /*predeployed shares token, 0 addr if new*/\\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\\n\\n Baal _baal = Baal(\\n moduleProxyFactory.deployModule(\\n template, \\n abi.encodeWithSignature(\\\"avatar()\\\"), \\n _saltNonce\\n )\\n );\\n\\n // if loot or shares are zero address new tokens are deployed\\n // tokens need to be baalTokens\\n if(_lootToken == address(0) || _sharesToken == address(0)){\\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\\n // pause tokens by default and transfer to the DAO\\n IBaalToken(_lootToken).pause();\\n IBaalToken(_sharesToken).pause();\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n } else {\\n existingAddrs += 1;\\n }\\n\\n // if zero address deploy a new safe\\n // Needs to be a valid zodiac treasury\\n if(_safeAddr == address(0)){\\n _safeAddr = deployAndSetupSafe(address(_baal));\\n } else {\\n existingAddrs += 2;\\n }\\n\\n bytes memory _initializationMultisendData = encodeMultisend(\\n initializationActions,\\n address(_baal)\\n );\\n bytes memory _initializer = abi.encode(\\n _lootToken,\\n _sharesToken,\\n gnosisMultisendLibrary,\\n _safeAddr,\\n _forwarder,\\n _initializationMultisendData\\n );\\n // can run the actions now because we have a baal\\n _baal.setUp(_initializer);\\n\\n emit SummonBaal(\\n address(_baal),\\n address(_baal.lootToken()),\\n address(_baal.sharesToken()),\\n _safeAddr,\\n _forwarder,\\n existingAddrs\\n );\\n\\n return (address(_baal));\\n }\\n\\n function _authorizeUpgrade(address newImplementation)\\n internal\\n onlyOwner\\n override\\n {}\\n}\\n\",\"keccak256\":\"0x4053036af806c618440986e05da32008fd83cfee2e631fd3bed8b581045ee913\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b50608051612d2161004c60003960008181610483015281816104cf01528181610593015281816105d601526106720152612d216000f3fe608060405260043610620001375760003560e01c8063881e4ea411620000ad578063d9118ce7116200006c578063d9118ce71462000364578063ebfb8a431462000386578063f0fa28b914620003ab578063f2fde38b14620003cd578063f884231c14620003f257600080fd5b8063881e4ea414620002865780638da5cb5b14620002a857806397fc9fbb14620002c8578063a2346618146200030e578063d61f27ae146200033057600080fd5b80634f1ef28611620000fa5780634f1ef286146200020557806352d1902d146200021c5780636f2ddd931462000234578063715018a614620002565780638129fc1c146200026e57600080fd5b8063209f3695146200013c57806321d56a43146200017057806323626b4514620001925780633659cfe614620001b95780634a8b0b3214620001e0575b600080fd5b620001536200014d36600462001b6e565b62000417565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017d57600080fd5b5060cb5462000153906001600160a01b031681565b3480156200019f57600080fd5b50620001aa60c95481565b60405190815260200162000167565b348015620001c657600080fd5b50620001de620001d836600462001c09565b62000478565b005b348015620001ed57600080fd5b5062000153620001ff36600462001c29565b6200056d565b620001de6200021636600462001d65565b62000588565b3480156200022957600080fd5b50620001aa62000665565b3480156200024157600080fd5b5060ca5462000153906001600160a01b031681565b3480156200026357600080fd5b50620001de6200071b565b3480156200027b57600080fd5b50620001de62000733565b3480156200029357600080fd5b5060cd5462000153906001600160a01b031681565b348015620002b557600080fd5b506033546001600160a01b031662000153565b348015620002d557600080fd5b50620002ed620002e736600462001dbb565b62000856565b604080516001600160a01b0393841681529290911660208301520162000167565b3480156200031b57600080fd5b5060cf5462000153906001600160a01b031681565b3480156200033d57600080fd5b50620003556200034f36600462001eac565b62000a17565b60405162000167919062001f76565b3480156200037157600080fd5b5060ce5462000153906001600160a01b031681565b3480156200039357600080fd5b50620001de620003a536600462001f8b565b62000aec565b348015620003b857600080fd5b5060cc5462000153906001600160a01b031681565b348015620003da57600080fd5b50620001de620003ec36600462001c09565b62000df0565b348015620003ff57600080fd5b50620001536200041136600462001c09565b62000e6c565b600080620004298888888888620010c4565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004cd5760405162461bcd60e51b8152600401620004c49062002045565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200051860008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620005415760405162461bcd60e51b8152600401620004c49062002091565b6200054c81620015a4565b604080516000808252602082019092526200056a91839190620015ae565b50565b60006200057e8686868686620010c4565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005d45760405162461bcd60e51b8152600401620004c49062002045565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061f60008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620006485760405162461bcd60e51b8152600401620004c49062002091565b6200065382620015a4565b6200066182826001620015ae565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007075760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004c4565b5060008051602062002ca583398151915290565b620007256200172b565b62000731600062001787565b565b600054610100900460ff1615808015620007545750600054600160ff909116105b80620007705750303b15801562000770575060005460ff166001145b620007d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004c4565b6000805460ff191660011790558015620007f9576000805461ff0019166101001790555b62000803620017d9565b6200080d6200180d565b80156200056a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b9062000886908790602001620020dd565b60405160208183030381529060405285604051602001620008a8919062002108565b60408051601f1981840301815290829052620008c8929160240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009079062001acc565b620009149291906200215c565b604051809103906000f08015801562000931573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b9062000960908790879060240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516200099f9062001acc565b620009ac9291906200215c565b604051809103906000f080158015620009c9573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000aa65781600085600088858151811062000a425762000a426200218a565b60200260200101515189868151811062000a605762000a606200218a565b602002602001015160405160200162000a7f96959493929190620021a0565b6040516020818303038152906040529150808062000a9d9062002224565b91505062000a1d565b508060405160240162000aba919062001f76565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000af66200172b565b6001600160a01b03821662000b3f5760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004c4565b6001600160a01b03811662000b8a5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03871662000bd55760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03861662000c265760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004c4565b6001600160a01b03851662000c7e5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004c4565b6001600160a01b03841662000cd65760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004c4565b6001600160a01b03831662000d245760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004c4565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000dd18362002224565b9091555060405190815260200160405180910390a15050505050505050565b62000dfa6200172b565b6001600160a01b03811662000e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004c4565b6200056a8162001787565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000eb69390921691906004016200215c565b6020604051808303816000875af115801562000ed6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000efc919062002242565b6040516001600160a01b038516602482015290915060009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b1790528251915192935060009262000f61928492879284929188910162002262565b604051602081830303815290604052905060008160405160240162000f87919062001f76565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b1790528151600180825281840190935292935060009291908281019080368337019050509050868160008151811062000fec5762000fec6200218a565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001041938793600193928316928a92169060009081908190600401620022ba565b600060405180830381600087803b1580156200105c57600080fd5b505af115801562001071573d6000803e3d6000fd5b5050604080516001600160a01b03808a1682528b1660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0935001905060405180910390a1509295945050505050565b600080808080808080620010db8c8e018e6200237c565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b815260040162001184939291906200243a565b6020604051808303816000875af1158015620011a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011ca919062002242565b90506001600160a01b0383161580620011ea57506001600160a01b038216155b156200136e57620011fc878762000856565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200124057600080fd5b505af115801562001255573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200129557600080fd5b505af1158015620012aa573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b158015620012f257600080fd5b505af115801562001307573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b1580156200134f57600080fd5b505af115801562001364573d6000803e3d6000fd5b505050506200137e565b6200137b60018962002470565b97505b6001600160a01b038516620013a057620013988162000e6c565b9450620013b0565b620013ad60028962002470565b97505b6000620013c9620013c28d8f6200248b565b8362000a17565b60cd54604051919250600091620013f791879187916001600160a01b0316908b908b9088906020016200249a565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf906200143590849060040162001f76565b600060405180830381600087803b1580156200145057600080fd5b505af115801562001465573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014a8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014ce919062002242565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001516573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200153c919062002242565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200056a6200172b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620015e957620015e48362001837565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562001646575060408051601f3d908101601f191682019092526200164391810190620024ec565b60015b620016ab5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004c4565b60008051602062002ca583398151915281146200171d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004c4565b50620015e4838383620018d6565b6033546001600160a01b03163314620007315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004c4565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620018035760405162461bcd60e51b8152600401620004c49062002506565b6200073162001907565b600054610100900460ff16620007315760405162461bcd60e51b8152600401620004c49062002506565b6001600160a01b0381163b620018a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004c4565b60008051602062002ca583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620018e1836200193c565b600082511180620018ef5750805b15620015e4576200190183836200197e565b50505050565b600054610100900460ff16620019315760405162461bcd60e51b8152600401620004c49062002506565b620007313362001787565b620019478162001837565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620019e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004c4565b600080846001600160a01b03168460405162001a05919062002551565b600060405180830381855af49150503d806000811462001a42576040519150601f19603f3d011682016040523d82523d6000602084013e62001a47565b606091505b509150915062001a72828260405180606001604052806027815260200162002cc56027913962001a7b565b95945050505050565b6060831562001a8c57508162001a98565b62001a98838362001a9f565b9392505050565b81511562001ab05781518083602001fd5b8060405162461bcd60e51b8152600401620004c4919062001f76565b610735806200257083390190565b60008083601f84011262001aed57600080fd5b50813567ffffffffffffffff81111562001b0657600080fd5b60208301915083602082850101111562001b1f57600080fd5b9250929050565b60008083601f84011262001b3957600080fd5b50813567ffffffffffffffff81111562001b5257600080fd5b6020830191508360208260051b850101111562001b1f57600080fd5b6000806000806000806080878903121562001b8857600080fd5b863567ffffffffffffffff8082111562001ba157600080fd5b62001baf8a838b0162001ada565b9098509650602089013591508082111562001bc957600080fd5b5062001bd889828a0162001b26565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200056a57600080fd5b60006020828403121562001c1c57600080fd5b813562001a988162001bf3565b60008060008060006060868803121562001c4257600080fd5b853567ffffffffffffffff8082111562001c5b57600080fd5b62001c6989838a0162001ada565b9097509550602088013591508082111562001c8357600080fd5b5062001c928882890162001b26565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001ce65762001ce662001ca4565b604052919050565b600082601f83011262001d0057600080fd5b813567ffffffffffffffff81111562001d1d5762001d1d62001ca4565b62001d32601f8201601f191660200162001cba565b81815284602083860101111562001d4857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001d7957600080fd5b823562001d868162001bf3565b9150602083013567ffffffffffffffff81111562001da357600080fd5b62001db18582860162001cee565b9150509250929050565b6000806040838503121562001dcf57600080fd5b823567ffffffffffffffff8082111562001de857600080fd5b62001df68683870162001cee565b9350602085013591508082111562001e0d57600080fd5b5062001db18582860162001cee565b600067ffffffffffffffff8084111562001e3a5762001e3a62001ca4565b8360051b602062001e4d81830162001cba565b8681529350908401908084018783111562001e6757600080fd5b855b8381101562001ea05780358581111562001e835760008081fd5b62001e918a828a0162001cee565b83525090820190820162001e69565b50505050509392505050565b6000806040838503121562001ec057600080fd5b823567ffffffffffffffff81111562001ed857600080fd5b8301601f8101851362001eea57600080fd5b62001efb8582356020840162001e1c565b925050602083013562001f0e8162001bf3565b809150509250929050565b60005b8381101562001f3657818101518382015260200162001f1c565b83811115620019015750506000910152565b6000815180845262001f6281602086016020860162001f19565b601f01601f19169290920160200192915050565b60208152600062001a98602083018462001f48565b600080600080600080600080610100898b03121562001fa957600080fd5b883562001fb68162001bf3565b9750602089013562001fc88162001bf3565b9650604089013562001fda8162001bf3565b9550606089013562001fec8162001bf3565b9450608089013562001ffe8162001bf3565b935060a0890135620020108162001bf3565b925060c0890135620020228162001bf3565b915060e0890135620020348162001bf3565b809150509295985092959890939650565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008251620020f181846020870162001f19565b64081313d3d560da1b920191825250600501919050565b600082516200211c81846020870162001f19565b640b5313d3d560da1b920191825250600501919050565b60408152600062002148604083018562001f48565b828103602084015262001a72818562001f48565b6001600160a01b0383168152604060208201819052600090620021829083018462001f48565b949350505050565b634e487b7160e01b600052603260045260246000fd5b60008751620021b4818460208c0162001f19565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351620021fe81605584016020880162001f19565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156200223b576200223b6200220e565b5060010190565b6000602082840312156200225557600080fd5b815162001a988162001bf3565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620022a981605585016020870162001f19565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b82811015620023005781516001600160a01b031685529383019390830190600101620022d9565b50505083018a90526001600160a01b038916604084015282810360608401526200232b818962001f48565b9150506200234460808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200236f60e08301846001600160a01b03169052565b9998505050505050505050565b60008060008060008060c087890312156200239657600080fd5b863567ffffffffffffffff80821115620023af57600080fd5b620023bd8a838b0162001cee565b97506020890135915080821115620023d457600080fd5b50620023e389828a0162001cee565b9550506040870135620023f68162001bf3565b93506060870135620024088162001bf3565b925060808701356200241a8162001bf3565b915060a08701356200242c8162001bf3565b809150509295509295509295565b6001600160a01b0384168152606060208201819052600090620024609083018562001f48565b9050826040830152949350505050565b600082198211156200248657620024866200220e565b500190565b600062001a9836848462001e1c565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a08201819052600090620024e09083018462001f48565b98975050505050505050565b600060208284031215620024ff57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516200256581846020870162001f19565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220bc2877b2a93adc52a277122972e8c6137b7c0334e3648c825f4d4baaefb717c364736f6c634300080a0033", + "deployedBytecode": "0x608060405260043610620001375760003560e01c8063881e4ea411620000ad578063d9118ce7116200006c578063d9118ce71462000364578063ebfb8a431462000386578063f0fa28b914620003ab578063f2fde38b14620003cd578063f884231c14620003f257600080fd5b8063881e4ea414620002865780638da5cb5b14620002a857806397fc9fbb14620002c8578063a2346618146200030e578063d61f27ae146200033057600080fd5b80634f1ef28611620000fa5780634f1ef286146200020557806352d1902d146200021c5780636f2ddd931462000234578063715018a614620002565780638129fc1c146200026e57600080fd5b8063209f3695146200013c57806321d56a43146200017057806323626b4514620001925780633659cfe614620001b95780634a8b0b3214620001e0575b600080fd5b620001536200014d36600462001b6e565b62000417565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017d57600080fd5b5060cb5462000153906001600160a01b031681565b3480156200019f57600080fd5b50620001aa60c95481565b60405190815260200162000167565b348015620001c657600080fd5b50620001de620001d836600462001c09565b62000478565b005b348015620001ed57600080fd5b5062000153620001ff36600462001c29565b6200056d565b620001de6200021636600462001d65565b62000588565b3480156200022957600080fd5b50620001aa62000665565b3480156200024157600080fd5b5060ca5462000153906001600160a01b031681565b3480156200026357600080fd5b50620001de6200071b565b3480156200027b57600080fd5b50620001de62000733565b3480156200029357600080fd5b5060cd5462000153906001600160a01b031681565b348015620002b557600080fd5b506033546001600160a01b031662000153565b348015620002d557600080fd5b50620002ed620002e736600462001dbb565b62000856565b604080516001600160a01b0393841681529290911660208301520162000167565b3480156200031b57600080fd5b5060cf5462000153906001600160a01b031681565b3480156200033d57600080fd5b50620003556200034f36600462001eac565b62000a17565b60405162000167919062001f76565b3480156200037157600080fd5b5060ce5462000153906001600160a01b031681565b3480156200039357600080fd5b50620001de620003a536600462001f8b565b62000aec565b348015620003b857600080fd5b5060cc5462000153906001600160a01b031681565b348015620003da57600080fd5b50620001de620003ec36600462001c09565b62000df0565b348015620003ff57600080fd5b50620001536200041136600462001c09565b62000e6c565b600080620004298888888888620010c4565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004cd5760405162461bcd60e51b8152600401620004c49062002045565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200051860008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620005415760405162461bcd60e51b8152600401620004c49062002091565b6200054c81620015a4565b604080516000808252602082019092526200056a91839190620015ae565b50565b60006200057e8686868686620010c4565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005d45760405162461bcd60e51b8152600401620004c49062002045565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061f60008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620006485760405162461bcd60e51b8152600401620004c49062002091565b6200065382620015a4565b6200066182826001620015ae565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007075760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004c4565b5060008051602062002ca583398151915290565b620007256200172b565b62000731600062001787565b565b600054610100900460ff1615808015620007545750600054600160ff909116105b80620007705750303b15801562000770575060005460ff166001145b620007d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004c4565b6000805460ff191660011790558015620007f9576000805461ff0019166101001790555b62000803620017d9565b6200080d6200180d565b80156200056a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b9062000886908790602001620020dd565b60405160208183030381529060405285604051602001620008a8919062002108565b60408051601f1981840301815290829052620008c8929160240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009079062001acc565b620009149291906200215c565b604051809103906000f08015801562000931573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b9062000960908790879060240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516200099f9062001acc565b620009ac9291906200215c565b604051809103906000f080158015620009c9573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000aa65781600085600088858151811062000a425762000a426200218a565b60200260200101515189868151811062000a605762000a606200218a565b602002602001015160405160200162000a7f96959493929190620021a0565b6040516020818303038152906040529150808062000a9d9062002224565b91505062000a1d565b508060405160240162000aba919062001f76565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000af66200172b565b6001600160a01b03821662000b3f5760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004c4565b6001600160a01b03811662000b8a5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03871662000bd55760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03861662000c265760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004c4565b6001600160a01b03851662000c7e5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004c4565b6001600160a01b03841662000cd65760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004c4565b6001600160a01b03831662000d245760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004c4565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000dd18362002224565b9091555060405190815260200160405180910390a15050505050505050565b62000dfa6200172b565b6001600160a01b03811662000e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004c4565b6200056a8162001787565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000eb69390921691906004016200215c565b6020604051808303816000875af115801562000ed6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000efc919062002242565b6040516001600160a01b038516602482015290915060009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b1790528251915192935060009262000f61928492879284929188910162002262565b604051602081830303815290604052905060008160405160240162000f87919062001f76565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b1790528151600180825281840190935292935060009291908281019080368337019050509050868160008151811062000fec5762000fec6200218a565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001041938793600193928316928a92169060009081908190600401620022ba565b600060405180830381600087803b1580156200105c57600080fd5b505af115801562001071573d6000803e3d6000fd5b5050604080516001600160a01b03808a1682528b1660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0935001905060405180910390a1509295945050505050565b600080808080808080620010db8c8e018e6200237c565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b815260040162001184939291906200243a565b6020604051808303816000875af1158015620011a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011ca919062002242565b90506001600160a01b0383161580620011ea57506001600160a01b038216155b156200136e57620011fc878762000856565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200124057600080fd5b505af115801562001255573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200129557600080fd5b505af1158015620012aa573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b158015620012f257600080fd5b505af115801562001307573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b1580156200134f57600080fd5b505af115801562001364573d6000803e3d6000fd5b505050506200137e565b6200137b60018962002470565b97505b6001600160a01b038516620013a057620013988162000e6c565b9450620013b0565b620013ad60028962002470565b97505b6000620013c9620013c28d8f6200248b565b8362000a17565b60cd54604051919250600091620013f791879187916001600160a01b0316908b908b9088906020016200249a565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf906200143590849060040162001f76565b600060405180830381600087803b1580156200145057600080fd5b505af115801562001465573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014a8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014ce919062002242565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001516573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200153c919062002242565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200056a6200172b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620015e957620015e48362001837565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562001646575060408051601f3d908101601f191682019092526200164391810190620024ec565b60015b620016ab5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004c4565b60008051602062002ca583398151915281146200171d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004c4565b50620015e4838383620018d6565b6033546001600160a01b03163314620007315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004c4565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620018035760405162461bcd60e51b8152600401620004c49062002506565b6200073162001907565b600054610100900460ff16620007315760405162461bcd60e51b8152600401620004c49062002506565b6001600160a01b0381163b620018a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004c4565b60008051602062002ca583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620018e1836200193c565b600082511180620018ef5750805b15620015e4576200190183836200197e565b50505050565b600054610100900460ff16620019315760405162461bcd60e51b8152600401620004c49062002506565b620007313362001787565b620019478162001837565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620019e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004c4565b600080846001600160a01b03168460405162001a05919062002551565b600060405180830381855af49150503d806000811462001a42576040519150601f19603f3d011682016040523d82523d6000602084013e62001a47565b606091505b509150915062001a72828260405180606001604052806027815260200162002cc56027913962001a7b565b95945050505050565b6060831562001a8c57508162001a98565b62001a98838362001a9f565b9392505050565b81511562001ab05781518083602001fd5b8060405162461bcd60e51b8152600401620004c4919062001f76565b610735806200257083390190565b60008083601f84011262001aed57600080fd5b50813567ffffffffffffffff81111562001b0657600080fd5b60208301915083602082850101111562001b1f57600080fd5b9250929050565b60008083601f84011262001b3957600080fd5b50813567ffffffffffffffff81111562001b5257600080fd5b6020830191508360208260051b850101111562001b1f57600080fd5b6000806000806000806080878903121562001b8857600080fd5b863567ffffffffffffffff8082111562001ba157600080fd5b62001baf8a838b0162001ada565b9098509650602089013591508082111562001bc957600080fd5b5062001bd889828a0162001b26565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200056a57600080fd5b60006020828403121562001c1c57600080fd5b813562001a988162001bf3565b60008060008060006060868803121562001c4257600080fd5b853567ffffffffffffffff8082111562001c5b57600080fd5b62001c6989838a0162001ada565b9097509550602088013591508082111562001c8357600080fd5b5062001c928882890162001b26565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001ce65762001ce662001ca4565b604052919050565b600082601f83011262001d0057600080fd5b813567ffffffffffffffff81111562001d1d5762001d1d62001ca4565b62001d32601f8201601f191660200162001cba565b81815284602083860101111562001d4857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001d7957600080fd5b823562001d868162001bf3565b9150602083013567ffffffffffffffff81111562001da357600080fd5b62001db18582860162001cee565b9150509250929050565b6000806040838503121562001dcf57600080fd5b823567ffffffffffffffff8082111562001de857600080fd5b62001df68683870162001cee565b9350602085013591508082111562001e0d57600080fd5b5062001db18582860162001cee565b600067ffffffffffffffff8084111562001e3a5762001e3a62001ca4565b8360051b602062001e4d81830162001cba565b8681529350908401908084018783111562001e6757600080fd5b855b8381101562001ea05780358581111562001e835760008081fd5b62001e918a828a0162001cee565b83525090820190820162001e69565b50505050509392505050565b6000806040838503121562001ec057600080fd5b823567ffffffffffffffff81111562001ed857600080fd5b8301601f8101851362001eea57600080fd5b62001efb8582356020840162001e1c565b925050602083013562001f0e8162001bf3565b809150509250929050565b60005b8381101562001f3657818101518382015260200162001f1c565b83811115620019015750506000910152565b6000815180845262001f6281602086016020860162001f19565b601f01601f19169290920160200192915050565b60208152600062001a98602083018462001f48565b600080600080600080600080610100898b03121562001fa957600080fd5b883562001fb68162001bf3565b9750602089013562001fc88162001bf3565b9650604089013562001fda8162001bf3565b9550606089013562001fec8162001bf3565b9450608089013562001ffe8162001bf3565b935060a0890135620020108162001bf3565b925060c0890135620020228162001bf3565b915060e0890135620020348162001bf3565b809150509295985092959890939650565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008251620020f181846020870162001f19565b64081313d3d560da1b920191825250600501919050565b600082516200211c81846020870162001f19565b640b5313d3d560da1b920191825250600501919050565b60408152600062002148604083018562001f48565b828103602084015262001a72818562001f48565b6001600160a01b0383168152604060208201819052600090620021829083018462001f48565b949350505050565b634e487b7160e01b600052603260045260246000fd5b60008751620021b4818460208c0162001f19565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351620021fe81605584016020880162001f19565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156200223b576200223b6200220e565b5060010190565b6000602082840312156200225557600080fd5b815162001a988162001bf3565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620022a981605585016020870162001f19565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b82811015620023005781516001600160a01b031685529383019390830190600101620022d9565b50505083018a90526001600160a01b038916604084015282810360608401526200232b818962001f48565b9150506200234460808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200236f60e08301846001600160a01b03169052565b9998505050505050505050565b60008060008060008060c087890312156200239657600080fd5b863567ffffffffffffffff80821115620023af57600080fd5b620023bd8a838b0162001cee565b97506020890135915080821115620023d457600080fd5b50620023e389828a0162001cee565b9550506040870135620023f68162001bf3565b93506060870135620024088162001bf3565b925060808701356200241a8162001bf3565b915060a08701356200242c8162001bf3565b809150509295509295509295565b6001600160a01b0384168152606060208201819052600090620024609083018562001f48565b9050826040830152949350505050565b600082198211156200248657620024866200220e565b500190565b600062001a9836848462001e1c565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a08201819052600090620024e09083018462001f48565b98975050505050505050565b600060208284031215620024ff57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516200256581846020870162001f19565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220bc2877b2a93adc52a277122972e8c6137b7c0334e3648c825f4d4baaefb717c364736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 12611, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "addrsVersion", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 12613, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "template", + "offset": 0, + "slot": "202", + "type": "t_address_payable" + }, + { + "astId": 12615, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSingleton", + "offset": 0, + "slot": "203", + "type": "t_address" + }, + { + "astId": 12617, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisFallbackLibrary", + "offset": 0, + "slot": "204", + "type": "t_address" + }, + { + "astId": 12619, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisMultisendLibrary", + "offset": 0, + "slot": "205", + "type": "t_address" + }, + { + "astId": 12621, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "lootSingleton", + "offset": 0, + "slot": "206", + "type": "t_address" + }, + { + "astId": 12623, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "sharesSingleton", + "offset": 0, + "slot": "207", + "type": "t_address" + }, + { + "astId": 12626, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSafeProxyFactory", + "offset": 0, + "slot": "208", + "type": "t_contract(GnosisSafeProxyFactory)3163" + }, + { + "astId": 12629, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "moduleProxyFactory", + "offset": 0, + "slot": "209", + "type": "t_contract(ModuleProxyFactory)3539" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(GnosisSafeProxyFactory)3163": { + "encoding": "inplace", + "label": "contract GnosisSafeProxyFactory", + "numberOfBytes": "20" + }, + "t_contract(ModuleProxyFactory)3539": { + "encoding": "inplace", + "label": "contract ModuleProxyFactory", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/BaalSummoner_Proxy.json b/lib/Baal/deployments/base/BaalSummoner_Proxy.json new file mode 100644 index 0000000..edd6579 --- /dev/null +++ b/lib/Baal/deployments/base/BaalSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "transactionIndex": 5, + "gasUsed": "333434", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000080000000000000000004004000080000000000000000400000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000200000000000000000000000040000000000000000000000000002000000", + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a", + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000b2b3909661552942ae1115e9fc99df0bc93d71d0" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + }, + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + }, + { + "transactionIndex": 5, + "blockNumber": 7428902, + "transactionHash": "0x44d0039e9fd488577e6793307bf48e14ba5948a94fe6408baadfc964952c9ff5", + "address": "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xdb1f7057466f3523855d11ce19a22de844b85fc07e24ef8913024bfbc0d7302a" + } + ], + "blockNumber": 7428902, + "cumulativeGasUsed": "562179", + "status": 1, + "byzantium": true + }, + "args": [ + "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/Loot.json b/lib/Baal/deployments/base/Loot.json new file mode 100644 index 0000000..82e7a66 --- /dev/null +++ b/lib/Baal/deployments/base/Loot.json @@ -0,0 +1,1186 @@ +{ + "address": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x07b4a0525ce7b8a1ac2990f43405948e4980006fdcc9c98fec7eeb332da7eb11", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "transactionIndex": 11, + "gasUsed": "2319965", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000004000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x30ac0fe0b50f2549e3d893b2e68221d9e6c9a952967ec21bd48ed6528b9691e1", + "transactionHash": "0x07b4a0525ce7b8a1ac2990f43405948e4980006fdcc9c98fec7eeb332da7eb11", + "logs": [ + { + "transactionIndex": 11, + "blockNumber": 7428449, + "transactionHash": "0x07b4a0525ce7b8a1ac2990f43405948e4980006fdcc9c98fec7eeb332da7eb11", + "address": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 42, + "blockHash": "0x30ac0fe0b50f2549e3d893b2e68221d9e6c9a952967ec21bd48ed6528b9691e1" + } + ], + "blockNumber": 7428449, + "cumulativeGasUsed": "3726160", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSnapshotId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"balanceOfAt(address,uint256)\":{\"details\":\"Retrieves the balance of `account` at the time `snapshotId` was created.\"},\"burn(address,uint256)\":{\"params\":{\"account\":\"Address to lose loot\",\"amount\":\"Amount to burn\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"mint(address,uint256)\":{\"params\":{\"amount\":\"Amount to mint\",\"recipient\":\"Address to receive loot\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setUp(string,string)\":{\"details\":\"initializer should prevent this from being called again\",\"params\":{\"name_\":\"Name for ERC20 token trackers\",\"symbol_\":\"Symbol for ERC20 token trackers\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"totalSupplyAt(uint256)\":{\"details\":\"Retrieves the total supply at the time `snapshotId` was created.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(address,uint256)\":{\"notice\":\"Baal-only function to burn loot.\"},\"getCurrentSnapshotId()\":{\"notice\":\"get current SnapshotId\"},\"mint(address,uint256)\":{\"notice\":\"Baal-only function to mint loot.\"},\"pause()\":{\"notice\":\"Baal-only function to pause shares.\"},\"setUp(string,string)\":{\"notice\":\"Configure loot - called by Baal on summon\"},\"snapshot()\":{\"notice\":\"Allows baal to create a snapshot\"},\"unpause()\":{\"notice\":\"Baal-only function to pause shares.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/LootERC20.sol\":\"Loot\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0xb1d9e69cf8073efa574b31b1f840e20709139c19bfb27e60b16393d6073f3d42\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ArraysUpgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\\n * total supply at the time are recorded for later access.\\n *\\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\\n * In naive implementations it's possible to perform a \\\"double spend\\\" attack by reusing the same balance from different\\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\\n * used to create an efficient ERC20 forking mechanism.\\n *\\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\\n * and the account address.\\n *\\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\\n *\\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\\n * alternative consider {ERC20Votes}.\\n *\\n * ==== Gas Costs\\n *\\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\\n *\\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\\n * transfers will have normal cost until the next snapshot, and so on.\\n */\\n\\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\\n function __ERC20Snapshot_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\\n }\\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\\n\\n using ArraysUpgradeable for uint256[];\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\\n // Snapshot struct, but that would impede usage of functions that work on an array.\\n struct Snapshots {\\n uint256[] ids;\\n uint256[] values;\\n }\\n\\n mapping(address => Snapshots) private _accountBalanceSnapshots;\\n Snapshots private _totalSupplySnapshots;\\n\\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\\n CountersUpgradeable.Counter private _currentSnapshotId;\\n\\n /**\\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\\n */\\n event Snapshot(uint256 id);\\n\\n /**\\n * @dev Creates a new snapshot and returns its snapshot id.\\n *\\n * Emits a {Snapshot} event that contains the same id.\\n *\\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\\n *\\n * [WARNING]\\n * ====\\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\\n * you must consider that it can potentially be used by attackers in two ways.\\n *\\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\\n * section above.\\n *\\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\\n * ====\\n */\\n function _snapshot() internal virtual returns (uint256) {\\n _currentSnapshotId.increment();\\n\\n uint256 currentId = _getCurrentSnapshotId();\\n emit Snapshot(currentId);\\n return currentId;\\n }\\n\\n /**\\n * @dev Get the current snapshotId\\n */\\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\\n return _currentSnapshotId.current();\\n }\\n\\n /**\\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\\n */\\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\\n\\n return snapshotted ? value : balanceOf(account);\\n }\\n\\n /**\\n * @dev Retrieves the total supply at the time `snapshotId` was created.\\n */\\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\\n\\n return snapshotted ? value : totalSupply();\\n }\\n\\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n if (from == address(0)) {\\n // mint\\n _updateAccountSnapshot(to);\\n _updateTotalSupplySnapshot();\\n } else if (to == address(0)) {\\n // burn\\n _updateAccountSnapshot(from);\\n _updateTotalSupplySnapshot();\\n } else {\\n // transfer\\n _updateAccountSnapshot(from);\\n _updateAccountSnapshot(to);\\n }\\n }\\n\\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\\n require(snapshotId > 0, \\\"ERC20Snapshot: id is 0\\\");\\n require(snapshotId <= _getCurrentSnapshotId(), \\\"ERC20Snapshot: nonexistent id\\\");\\n\\n // When a valid snapshot is queried, there are three possibilities:\\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\\n // to this id is the current one.\\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\\n // requested id, and its value is the one to return.\\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\\n // larger than the requested one.\\n //\\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\\n // exactly this.\\n\\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\\n\\n if (index == snapshots.ids.length) {\\n return (false, 0);\\n } else {\\n return (true, snapshots.values[index]);\\n }\\n }\\n\\n function _updateAccountSnapshot(address account) private {\\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\\n }\\n\\n function _updateTotalSupplySnapshot() private {\\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\\n }\\n\\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\\n uint256 currentId = _getCurrentSnapshotId();\\n if (_lastSnapshotId(snapshots.ids) < currentId) {\\n snapshots.ids.push(currentId);\\n snapshots.values.push(currentValue);\\n }\\n }\\n\\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\\n if (ids.length == 0) {\\n return 0;\\n } else {\\n return ids[ids.length - 1];\\n }\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[46] private __gap;\\n}\\n\",\"keccak256\":\"0x42da8099f59958af496f6c8f0d9c1ce0a929151e02f877e4be23aca4cc440cbe\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/EIP712Upgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 51\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n mapping(address => CountersUpgradeable.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\\n __EIP712_init_unchained(name, \\\"1\\\");\\n }\\n\\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(address owner) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(address owner) internal virtual returns (uint256 current) {\\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xfe1053f3a6ee4527cde96c8152b8b1dbb98774639a64e819087bc80e618d7f7f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./StorageSlotUpgradeable.sol\\\";\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary ArraysUpgradeable {\\n using StorageSlotUpgradeable for bytes32;\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * `array` is expected to be sorted in ascending order, and to contain no\\n * repeated elements.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n if (array.length == 0) {\\n return 0;\\n }\\n\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n while (low < high) {\\n uint256 mid = MathUpgradeable.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getUint256Slot();\\n }\\n}\\n\",\"keccak256\":\"0xc3821e9d41b2b19b612238b308dcc8f4ab46afcd0f6b3bd174e89789bbf59e26\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary CountersUpgradeable {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0x798741e231b22b81e2dd2eddaaf8832dee4baf5cd8e2dbaa5c1dd12a1c053c4d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"contracts/LootERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\ncontract Loot is\\n ERC20SnapshotUpgradeable,\\n ERC20PermitUpgradeable,\\n PausableUpgradeable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Configure loot - called by Baal on summon\\n /// @dev initializer should prevent this from being called again\\n /// @param name_ Name for ERC20 token trackers\\n /// @param symbol_ Symbol for ERC20 token trackers\\n function setUp(string memory name_, string memory symbol_)\\n external\\n initializer\\n {\\n require(bytes(name_).length != 0, \\\"loot: name empty\\\");\\n require(bytes(symbol_).length != 0, \\\"loot: symbol empty\\\");\\n\\n __ERC20_init(name_, symbol_);\\n __ERC20Permit_init(name_);\\n __Pausable_init();\\n __ERC20Snapshot_init();\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /// @notice Allows baal to create a snapshot\\n function snapshot() external onlyOwner returns(uint256) {\\n return _snapshot();\\n }\\n\\n /// @notice get current SnapshotId\\n function getCurrentSnapshotId() external view returns (uint256) {\\n return _getCurrentSnapshotId();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function pause() public onlyOwner {\\n _pause();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function unpause() public onlyOwner {\\n _unpause();\\n }\\n\\n /// @notice Baal-only function to mint loot.\\n /// @param recipient Address to receive loot\\n /// @param amount Amount to mint\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n // can not be more than half the max because of totalsupply of loot and shares\\n require(totalSupply() + amount <= type(uint256).max / 2, \\\"loot: cap exceeded\\\");\\n _mint(recipient, amount);\\n }\\n\\n /// @notice Baal-only function to burn loot.\\n /// @param account Address to lose loot\\n /// @param amount Amount to burn\\n function burn(address account, uint256 amount) external onlyOwner {\\n _burn(account, amount);\\n }\\n\\n /// @notice Internal hook to restrict token transfers unless allowed by baal\\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\\n /// @param from The address of the source account.\\n /// @param to The address of the destination account.\\n /// @param amount The number of `loot` tokens to transfer.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(\\n from == address(0) || /*Minting allowed*/\\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\\n !paused(),\\n \\\"loot: !transferable\\\"\\n );\\n }\\n\\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0xa3b301421fabcf9fc110e5532cc4368c6e25a80348dbfe47f8e8e4dd72ce02cb\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c61288a62000126600039600081816106480152818161069101528181610838015281816108780152610907015261288a6000f3fe6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "balanceOfAt(address,uint256)": { + "details": "Retrieves the balance of `account` at the time `snapshotId` was created." + }, + "burn(address,uint256)": { + "params": { + "account": "Address to lose loot", + "amount": "Amount to burn" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "mint(address,uint256)": { + "params": { + "amount": "Amount to mint", + "recipient": "Address to receive loot" + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setUp(string,string)": { + "details": "initializer should prevent this from being called again", + "params": { + "name_": "Name for ERC20 token trackers", + "symbol_": "Symbol for ERC20 token trackers" + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "totalSupplyAt(uint256)": { + "details": "Retrieves the total supply at the time `snapshotId` was created." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "burn(address,uint256)": { + "notice": "Baal-only function to burn loot." + }, + "getCurrentSnapshotId()": { + "notice": "get current SnapshotId" + }, + "mint(address,uint256)": { + "notice": "Baal-only function to mint loot." + }, + "pause()": { + "notice": "Baal-only function to pause shares." + }, + "setUp(string,string)": { + "notice": "Configure loot - called by Baal on summon" + }, + "snapshot()": { + "notice": "Allows baal to create a snapshot" + }, + "unpause()": { + "notice": "Baal-only function to pause shares." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4971, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4977, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4979, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 4981, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage" + }, + { + "astId": 4983, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage" + }, + { + "astId": 5563, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 5685, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_accountBalanceSnapshots", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_address,t_struct(Snapshots)5680_storage)" + }, + { + "astId": 5688, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupplySnapshots", + "offset": 0, + "slot": "102", + "type": "t_struct(Snapshots)5680_storage" + }, + { + "astId": 5691, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_currentSnapshotId", + "offset": 0, + "slot": "104", + "type": "t_struct(Counter)6730_storage" + }, + { + "astId": 5989, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "105", + "type": "t_array(t_uint256)46_storage" + }, + { + "astId": 7403, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 6041, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)6730_storage)" + }, + { + "astId": 6049, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32" + }, + { + "astId": 6205, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4773, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_paused", + "offset": 0, + "slot": "254", + "type": "t_bool" + }, + { + "astId": 4878, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3937, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_owner", + "offset": 0, + "slot": "304", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "354", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "404", + "type": "t_array(t_uint256)50_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)46_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[46]", + "numberOfBytes": "1472" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_struct(Counter)6730_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)6730_storage" + }, + "t_mapping(t_address,t_struct(Snapshots)5680_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", + "numberOfBytes": "32", + "value": "t_struct(Snapshots)5680_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)6730_storage": { + "encoding": "inplace", + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "astId": 6729, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Snapshots)5680_storage": { + "encoding": "inplace", + "label": "struct ERC20SnapshotUpgradeable.Snapshots", + "members": [ + { + "astId": 5676, + "contract": "contracts/LootERC20.sol:Loot", + "label": "ids", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5679, + "contract": "contracts/LootERC20.sol:Loot", + "label": "values", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/Shares.json b/lib/Baal/deployments/base/Shares.json new file mode 100644 index 0000000..f2ed98f --- /dev/null +++ b/lib/Baal/deployments/base/Shares.json @@ -0,0 +1,1624 @@ +{ + "address": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xd00490e9a98f1523ec182f9cd4e937d650eba6cd41cc4505838be89928c6f21b", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "transactionIndex": 2, + "gasUsed": "2949839", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000001000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6b11afcac3773ef2ff987e5e3a0cfbd4d933c44461100c0ba6ecc9ec0b2b994e", + "transactionHash": "0xd00490e9a98f1523ec182f9cd4e937d650eba6cd41cc4505838be89928c6f21b", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 7428452, + "transactionHash": "0xd00490e9a98f1523ec182f9cd4e937d650eba6cd41cc4505838be89928c6f21b", + "address": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 12, + "blockHash": "0x6b11afcac3773ef2ff987e5e3a0cfbd4d933c44461100c0ba6ecc9ec0b2b994e" + } + ], + "blockNumber": 7428452, + "cumulativeGasUsed": "3311509", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"checkpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fromTimePoint\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegationNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nCheckpoints\",\"type\":\"uint256\"}],\"name\":\"getCheckpoint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromTimePoint\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"internalType\":\"struct BaalVotes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSnapshotId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timePoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"now\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timePoint\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"balanceOfAt(address,uint256)\":{\"details\":\"Retrieves the balance of `account` at the time `snapshotId` was created.\"},\"burn(address,uint256)\":{\"params\":{\"account\":\"Address to lose shares\",\"amount\":\"Amount to burn\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"delegate(address)\":{\"params\":{\"delegatee\":\"The address to delegate votes to.\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"params\":{\"delegatee\":\"The address to delegate 'votes' to.\",\"expiry\":\"The time at which to expire the signature.\",\"nonce\":\"The contract state required to match the signature.\",\"r\":\"The r signature\",\"s\":\"The s signature\",\"v\":\"The v signature\"}},\"getPastVotes(address,uint256)\":{\"params\":{\"account\":\"The user to check `votes` for.\",\"timePoint\":\"The unix time to check `votes` for.\"},\"returns\":{\"votes\":\"Past `votes` delegated to `account`.\"}},\"getVotes(address)\":{\"params\":{\"account\":\"The user to check delegated `votes` for.\"},\"returns\":{\"votes\":\"Current `votes` delegated to `account`.\"}},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"mint(address,uint256)\":{\"params\":{\"amount\":\"Amount to mint\",\"recipient\":\"Address to receive shares\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"now()\":{\"returns\":{\"timePoint\":\"returns unix epoch timestamp\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setUp(string,string)\":{\"details\":\"initializer should prevent this from being called again\",\"params\":{\"name_\":\"Name for ERC20 token trackers\",\"symbol_\":\"Symbol for ERC20 token trackers\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"totalSupplyAt(uint256)\":{\"details\":\"Retrieves the total supply at the time `snapshotId` was created.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"title\":\"Shares\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(address,uint256)\":{\"notice\":\"Baal-only function to burn shares.\"},\"delegate(address)\":{\"notice\":\"Delegate votes from user to `delegatee`.\"},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"notice\":\"Delegates votes from `signer` to `delegatee` with EIP-712 signature.\"},\"getCurrentSnapshotId()\":{\"notice\":\"get current SnapshotId\"},\"getPastVotes(address,uint256)\":{\"notice\":\"Returns the prior number of `votes` for `account` as of `timePoint`.\"},\"getVotes(address)\":{\"notice\":\"Returns the current delegated `vote` balance for `account`.\"},\"mint(address,uint256)\":{\"notice\":\"Baal-only function to mint shares.\"},\"now()\":{\"notice\":\"Returns the current timepoint.\"},\"pause()\":{\"notice\":\"Baal-only function to pause shares.\"},\"setUp(string,string)\":{\"notice\":\"Configure shares - called by Baal on summon\"},\"snapshot()\":{\"notice\":\"Allows baal to create a snapshot\"},\"unpause()\":{\"notice\":\"Baal-only function to unpause shares.\"}},\"notice\":\"Accounting for Baal non voting shares\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SharesERC20.sol\":\"Shares\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0xb1d9e69cf8073efa574b31b1f840e20709139c19bfb27e60b16393d6073f3d42\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ArraysUpgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\\n * total supply at the time are recorded for later access.\\n *\\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\\n * In naive implementations it's possible to perform a \\\"double spend\\\" attack by reusing the same balance from different\\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\\n * used to create an efficient ERC20 forking mechanism.\\n *\\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\\n * and the account address.\\n *\\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\\n *\\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\\n * alternative consider {ERC20Votes}.\\n *\\n * ==== Gas Costs\\n *\\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\\n *\\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\\n * transfers will have normal cost until the next snapshot, and so on.\\n */\\n\\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\\n function __ERC20Snapshot_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\\n }\\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\\n\\n using ArraysUpgradeable for uint256[];\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\\n // Snapshot struct, but that would impede usage of functions that work on an array.\\n struct Snapshots {\\n uint256[] ids;\\n uint256[] values;\\n }\\n\\n mapping(address => Snapshots) private _accountBalanceSnapshots;\\n Snapshots private _totalSupplySnapshots;\\n\\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\\n CountersUpgradeable.Counter private _currentSnapshotId;\\n\\n /**\\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\\n */\\n event Snapshot(uint256 id);\\n\\n /**\\n * @dev Creates a new snapshot and returns its snapshot id.\\n *\\n * Emits a {Snapshot} event that contains the same id.\\n *\\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\\n *\\n * [WARNING]\\n * ====\\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\\n * you must consider that it can potentially be used by attackers in two ways.\\n *\\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\\n * section above.\\n *\\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\\n * ====\\n */\\n function _snapshot() internal virtual returns (uint256) {\\n _currentSnapshotId.increment();\\n\\n uint256 currentId = _getCurrentSnapshotId();\\n emit Snapshot(currentId);\\n return currentId;\\n }\\n\\n /**\\n * @dev Get the current snapshotId\\n */\\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\\n return _currentSnapshotId.current();\\n }\\n\\n /**\\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\\n */\\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\\n\\n return snapshotted ? value : balanceOf(account);\\n }\\n\\n /**\\n * @dev Retrieves the total supply at the time `snapshotId` was created.\\n */\\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\\n\\n return snapshotted ? value : totalSupply();\\n }\\n\\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n if (from == address(0)) {\\n // mint\\n _updateAccountSnapshot(to);\\n _updateTotalSupplySnapshot();\\n } else if (to == address(0)) {\\n // burn\\n _updateAccountSnapshot(from);\\n _updateTotalSupplySnapshot();\\n } else {\\n // transfer\\n _updateAccountSnapshot(from);\\n _updateAccountSnapshot(to);\\n }\\n }\\n\\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\\n require(snapshotId > 0, \\\"ERC20Snapshot: id is 0\\\");\\n require(snapshotId <= _getCurrentSnapshotId(), \\\"ERC20Snapshot: nonexistent id\\\");\\n\\n // When a valid snapshot is queried, there are three possibilities:\\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\\n // to this id is the current one.\\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\\n // requested id, and its value is the one to return.\\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\\n // larger than the requested one.\\n //\\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\\n // exactly this.\\n\\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\\n\\n if (index == snapshots.ids.length) {\\n return (false, 0);\\n } else {\\n return (true, snapshots.values[index]);\\n }\\n }\\n\\n function _updateAccountSnapshot(address account) private {\\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\\n }\\n\\n function _updateTotalSupplySnapshot() private {\\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\\n }\\n\\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\\n uint256 currentId = _getCurrentSnapshotId();\\n if (_lastSnapshotId(snapshots.ids) < currentId) {\\n snapshots.ids.push(currentId);\\n snapshots.values.push(currentValue);\\n }\\n }\\n\\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\\n if (ids.length == 0) {\\n return 0;\\n } else {\\n return ids[ids.length - 1];\\n }\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[46] private __gap;\\n}\\n\",\"keccak256\":\"0x42da8099f59958af496f6c8f0d9c1ce0a929151e02f877e4be23aca4cc440cbe\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/EIP712Upgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 51\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n mapping(address => CountersUpgradeable.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\\n __EIP712_init_unchained(name, \\\"1\\\");\\n }\\n\\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(address owner) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(address owner) internal virtual returns (uint256 current) {\\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xfe1053f3a6ee4527cde96c8152b8b1dbb98774639a64e819087bc80e618d7f7f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./StorageSlotUpgradeable.sol\\\";\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary ArraysUpgradeable {\\n using StorageSlotUpgradeable for bytes32;\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * `array` is expected to be sorted in ascending order, and to contain no\\n * repeated elements.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n if (array.length == 0) {\\n return 0;\\n }\\n\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n while (low < high) {\\n uint256 mid = MathUpgradeable.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getUint256Slot();\\n }\\n}\\n\",\"keccak256\":\"0xc3821e9d41b2b19b612238b308dcc8f4ab46afcd0f6b3bd174e89789bbf59e26\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary CountersUpgradeable {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0x798741e231b22b81e2dd2eddaaf8832dee4baf5cd8e2dbaa5c1dd12a1c053c4d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/SharesERC20.sol\":{\"content\":\"pragma solidity 0.8.7;\\n//SPDX-License-Identifier: MIT\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\\\";\\n\\nimport \\\"./utils/BaalVotes.sol\\\";\\nimport \\\"./interfaces/IBaal.sol\\\";\\n\\n// import \\\"hardhat/console.sol\\\";\\n\\n/// @title Shares\\n/// @notice Accounting for Baal non voting shares\\ncontract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Configure shares - called by Baal on summon\\n /// @dev initializer should prevent this from being called again\\n /// @param name_ Name for ERC20 token trackers\\n /// @param symbol_ Symbol for ERC20 token trackers\\n function setUp(string memory name_, string memory symbol_)\\n external\\n initializer\\n {\\n require(bytes(name_).length != 0, \\\"shares: name empty\\\");\\n require(bytes(symbol_).length != 0, \\\"shares: symbol empty\\\");\\n\\n __ERC20_init(name_, symbol_);\\n __ERC20Permit_init(name_);\\n __Pausable_init();\\n __ERC20Snapshot_init();\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n __EIP712_init_delegation(\\\"delegation\\\", \\\"4\\\");\\n\\n\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function pause() public onlyOwner {\\n _pause();\\n }\\n\\n /// @notice Baal-only function to unpause shares.\\n function unpause() public onlyOwner {\\n _unpause();\\n }\\n\\n /// @notice Allows baal to create a snapshot\\n function snapshot() external onlyOwner returns(uint256) {\\n return _snapshot();\\n }\\n\\n /// @notice get current SnapshotId\\n function getCurrentSnapshotId() external view returns (uint256) {\\n return _getCurrentSnapshotId();\\n }\\n\\n /// @notice Baal-only function to mint shares.\\n /// @param recipient Address to receive shares\\n /// @param amount Amount to mint\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n // can not be more than half the max because of totalsupply of loot and shares\\n require(totalSupply() + amount <= type(uint256).max / 2, \\\"shares: cap exceeded\\\");\\n _mint(recipient, amount);\\n }\\n\\n /// @notice Baal-only function to burn shares.\\n /// @param account Address to lose shares\\n /// @param amount Amount to burn\\n function burn(address account, uint256 amount) external onlyOwner {\\n _burn(account, amount);\\n }\\n\\n /// @notice Internal hook to restrict token transfers unless allowed by baal\\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\\n /// @param from The address of the source account.\\n /// @param to The address of the destination account.\\n /// @param amount The number of `shares` tokens to transfer.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal override(BaalVotes, ERC20SnapshotUpgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(\\n from == address(0) || /*Minting allowed*/\\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\\n !paused(),\\n \\\"shares: !transferable\\\"\\n );\\n }\\n\\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x01a30f13f538ee4d7e448aa984e10f24a18d7a35e9e45ab3b501364516f0725d\",\"license\":\"MIT\"},\"contracts/interfaces/IBaal.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaal {\\n function lootToken() external view returns (address);\\n function sharesToken() external view returns (address);\\n function votingPeriod() external view returns (uint32);\\n function gracePeriod() external view returns (uint32);\\n function proposalCount() external view returns (uint32);\\n function proposalOffering() external view returns (uint256);\\n function quorumPercent() external view returns (uint256);\\n function sponsorThreshold() external view returns (uint256);\\n function minRetentionPercent() external view returns (uint256);\\n function latestSponsoredProposalId() external view returns (uint32);\\n\\n function setUp(bytes memory initializationParams) external;\\n function multisendLibrary() external view returns (address);\\n // Module\\n function avatar() external view returns (address);\\n function target() external view returns (address);\\n function setAvatar(address avatar) external;\\n function setTarget(address avatar) external;\\n // BaseRelayRecipient\\n function trustedForwarder() external view returns (address);\\n function setTrustedForwarder(address trustedForwarderAddress) external;\\n\\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\\n function totalLoot() external view returns (uint256);\\n function totalShares() external view returns (uint256);\\n function totalSupply() external view returns (uint256);\\n function lootPaused() external view returns (bool);\\n function sharesPaused() external view returns (bool);\\n \\n function shamans(address shaman) external view returns (uint256);\\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\\n function isAdmin(address shaman) external view returns (bool);\\n function isManager(address shaman) external view returns (bool);\\n function isGovernor(address shaman) external view returns (bool);\\n function lockAdmin() external;\\n function lockManager() external;\\n function lockGovernor() external;\\n function adminLock() external view returns (bool);\\n function managerLock() external view returns (bool);\\n function governorLock() external view returns (bool);\\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\\n function setGovernanceConfig(bytes memory governanceConfig) external;\\n\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable returns (uint256);\\n function sponsorProposal(uint32 id) external;\\n function processProposal(uint32 id, bytes calldata proposalData) external;\\n function cancelProposal(uint32 id) external;\\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\\n function submitVote(uint32 id, bool approved) external;\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\\n\\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xa8e49237a041f30caf45f9999fe28fdaac6a847530f411761a9b493022622948\",\"license\":\"MIT\"},\"contracts/utils/BaalVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\\\";\\nimport \\\"./DelegationEIP712Upgradeable.sol\\\";\\n\\n/**\\n * @dev similar to Openzeplin ERC20Votes\\n *\\n * uses timestamp instead of block.number and auto self delegates.\\n *\\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\\n * power can be queried through the public accessors {getPriorVotes}.\\n *\\n */\\nabstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {\\n using ECDSAUpgradeable for bytes32;\\n\\n struct Checkpoint {\\n /*Baal checkpoint for marking number of delegated votes*/\\n uint32 fromTimePoint; /*unix time for referencing voting balance*/\\n uint256 votes; /*votes at given unix time*/\\n }\\n\\n // DELEGATE TRACKING\\n mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/\\n mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/\\n mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/\\n mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/\\n\\n // SIGNATURE HELPERS\\n bytes32 constant DELEGATION_TYPEHASH = keccak256(\\\"Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n event DelegateChanged(\\n address indexed delegator,\\n address indexed fromDelegate,\\n address indexed toDelegate\\n ); /*emits when an account changes its voting delegate*/\\n event DelegateVotesChanged(\\n address indexed delegate,\\n uint256 previousBalance,\\n uint256 newBalance\\n ); /*emits when a delegate account's voting balance changes*/\\n\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n /*If recipient is receiving their first shares, auto-self delegate*/\\n if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {\\n delegates[to] = to;\\n }\\n\\n _moveDelegates(delegates[from], delegates[to], amount);\\n }\\n\\n /// @notice Delegate votes from user to `delegatee`.\\n /// @param delegatee The address to delegate votes to.\\n function delegate(address delegatee) external virtual {\\n _delegate(msg.sender, delegatee);\\n }\\n\\n /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.\\n /// @param delegatee The address to delegate 'votes' to.\\n /// @param nonce The contract state required to match the signature.\\n /// @param expiry The time at which to expire the signature.\\n /// @param v The v signature\\n /// @param r The r signature\\n /// @param s The s signature\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public {\\n require(now() <= expiry, \\\"ERC20Votes: signature expired\\\");\\n address signer = ECDSAUpgradeable.recover(\\n _hashTypedDataV4Delegation(\\n keccak256(\\n abi.encode(\\n DELEGATION_TYPEHASH,\\n keccak256(abi.encodePacked(name())),\\n delegatee,\\n nonce,\\n expiry\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n require(signer != address(0), \\\"ERC20Votes: invalid signer (0x0)\\\");\\n require(nonce == delegationNonces[signer], \\\"ERC20Votes: invalid nonce\\\");\\n\\n delegationNonces[signer]++;\\n _delegate(signer, delegatee);\\n }\\n\\n /// @notice Delegates Baal voting weight.\\n /// @param delegator The address to delegate 'votes' from.\\n /// @param delegatee The address to delegate 'votes' to.\\n function _delegate(address delegator, address delegatee) internal virtual {\\n require(balanceOf(delegator) > 0, \\\"!shares\\\");\\n address currentDelegate = delegates[delegator];\\n delegates[delegator] = delegatee;\\n\\n _moveDelegates(\\n currentDelegate,\\n delegatee,\\n uint256(balanceOf(delegator))\\n );\\n\\n emit DelegateChanged(delegator, currentDelegate, delegatee);\\n }\\n\\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\\n /// @param srcRep The address to delegate 'votes' from.\\n /// @param dstRep The address to delegate 'votes' to.\\n /// @param amount The amount of votes to delegate\\n function _moveDelegates(\\n address srcRep,\\n address dstRep,\\n uint256 amount\\n ) private {\\n unchecked {\\n if (srcRep != dstRep && amount != 0) {\\n if (srcRep != address(0)) {\\n uint256 srcRepNum = numCheckpoints[srcRep];\\n uint256 srcRepOld = srcRepNum != 0\\n ? getCheckpoint(srcRep, srcRepNum - 1).votes\\n : 0;\\n uint256 srcRepNew = srcRepOld - amount;\\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\\n }\\n\\n if (dstRep != address(0)) {\\n uint256 dstRepNum = numCheckpoints[dstRep];\\n uint256 dstRepOld = dstRepNum != 0\\n ? getCheckpoint(dstRep, dstRepNum - 1).votes\\n : 0;\\n uint256 dstRepNew = dstRepOld + amount;\\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\\n }\\n }\\n }\\n }\\n\\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\\n /// @param delegatee The address to snapshot\\n /// @param nCheckpoints The number of checkpoints delegatee has\\n /// @param oldVotes The number of votes the delegatee had\\n /// @param newVotes The number of votes the delegate has now\\n function _writeCheckpoint(\\n address delegatee,\\n uint256 nCheckpoints,\\n uint256 oldVotes,\\n uint256 newVotes\\n ) private {\\n uint32 timePoint = uint32(now());\\n\\n unchecked {\\n if (\\n nCheckpoints != 0 &&\\n checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint\\n ) {\\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\\n } else {\\n checkpoints[delegatee][nCheckpoints] = Checkpoint(\\n timePoint,\\n newVotes\\n );\\n numCheckpoints[delegatee] = nCheckpoints + 1;\\n }\\n }\\n\\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\\n }\\n\\n /// @notice Returns the current timepoint.\\n /// @return timePoint returns unix epoch timestamp\\n function now() public view returns (uint256 timePoint) {\\n return block.timestamp;\\n }\\n\\n /// @notice Returns the prior number of `votes` for `account` as of `timePoint`.\\n /// @param account The user to check `votes` for.\\n /// @param timePoint The unix time to check `votes` for.\\n /// @return votes Past `votes` delegated to `account`.\\n function getPastVotes(address account, uint256 timePoint)\\n external\\n view\\n virtual\\n returns (uint256 votes)\\n {\\n require(timePoint < now(), \\\"!determined\\\"); /* Prior votes must be in the past*/\\n\\n uint256 nCheckpoints = numCheckpoints[account];\\n if (nCheckpoints == 0) return 0;\\n\\n unchecked {\\n if (\\n getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=\\n timePoint\\n ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/\\n if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;\\n uint256 lower = 0;\\n uint256 upper = nCheckpoints - 1;\\n while (upper > lower) {\\n /* Binary search to look for highest timePoint before desired timePoint*/\\n uint256 center = upper - (upper - lower) / 2;\\n Checkpoint memory cp = getCheckpoint(account, center);\\n if (cp.fromTimePoint == timePoint) return cp.votes;\\n else if (cp.fromTimePoint < timePoint) lower = center;\\n else upper = center - 1;\\n }\\n votes = getCheckpoint(account, lower).votes;\\n }\\n }\\n\\n /// @notice Returns the current delegated `vote` balance for `account`.\\n /// @param account The user to check delegated `votes` for.\\n /// @return votes Current `votes` delegated to `account`.\\n function getVotes(address account)\\n external\\n view\\n virtual\\n returns (uint256 votes)\\n {\\n uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/\\n unchecked {\\n votes = nCheckpoints != 0\\n ? getCheckpoint(account, nCheckpoints - 1).votes\\n : 0;\\n }\\n }\\n\\n function getCheckpoint(address delegatee, uint256 nCheckpoints)\\n public\\n view\\n virtual\\n returns (Checkpoint memory)\\n {\\n return checkpoints[delegatee][nCheckpoints];\\n }\\n}\\n\",\"keccak256\":\"0x2003d3afd190a6c73b8e29970cdd84f0deb9bc543ed63d058451020293486348\",\"license\":\"MIT\"},\"contracts/utils/DelegationEIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4Delegation}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract DelegationEIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME_DELEGATION;\\n bytes32 private _HASHED_VERSION_DELEGATION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained_delegation(name, version);\\n }\\n\\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME_DELEGATION = hashedName;\\n _HASHED_VERSION_DELEGATION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\\n }\\n\\n function _buildDomainSeparatorDelegation(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\\n return _HASHED_NAME_DELEGATION;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION_DELEGATION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xaaca6373c8a75310ffcbbd63e8d0689ab6e404c96366e3fa4158bd3957924089\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6133ef6200012660003960008181610891015281816108da01528181610c1801528181610c580152610ce701526133ef6000f3fe60806040526004361061023b5760003560e01c80635c19a95c1161012e5780639711715a116100ab578063a9059cbb1161006f578063a9059cbb14610705578063c3cda52014610725578063d505accf14610745578063dd62ed3e14610765578063f2fde38b1461078557600080fd5b80639711715a14610670578063981b24d0146106855780639ab24eb0146106a55780639dc29fac146106c5578063a457c2d7146106e557600080fd5b80637ecebe00116100f25780637ecebe00146105f45780638456cb59146106145780638abe09f2146106295780638da5cb5b1461063c57806395d89b411461065b57600080fd5b80635c19a95c146105425780635c975abb146105625780636fcfff451461057b57806370a08231146105a9578063715018a6146105df57600080fd5b80633a46b1a8116101bc5780634f1ef286116101805780634f1ef2861461049657806352d1902d146104a95780635439ad86146104be578063562d190d146104d3578063587cde1e146104f357600080fd5b80633a46b1a8146103e05780633f4ba83a1461040057806340c10f191461041557806347f761f5146104355780634ee2cd7e1461047657600080fd5b806323b872dd1161020357806323b872dd1461034d578063313ce5671461036d5780633644e515146103895780633659cfe61461039e57806339509351146103c057600080fd5b806303c8a3c61461024057806306fdde0314610281578063095ea7b3146102a35780630cdfebfa146102d357806318160ddd14610338575b600080fd5b34801561024c57600080fd5b5061026e61025b366004612eb7565b6101036020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561028d57600080fd5b506102966107a5565b6040516102789190613137565b3480156102af57600080fd5b506102c36102be36600461300d565b610837565b6040519015158152602001610278565b3480156102df57600080fd5b5061031c6102ee36600461300d565b6101006020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610278565b34801561034457600080fd5b5060355461026e565b34801561035957600080fd5b506102c3610368366004612f05565b610851565b34801561037957600080fd5b5060405160128152602001610278565b34801561039557600080fd5b5061026e610877565b3480156103aa57600080fd5b506103be6103b9366004612eb7565b610886565b005b3480156103cc57600080fd5b506102c36103db36600461300d565b61096f565b3480156103ec57600080fd5b5061026e6103fb36600461300d565b610991565b34801561040c57600080fd5b506103be610ad2565b34801561042157600080fd5b506103be61043036600461300d565b610ae4565b34801561044157600080fd5b5061045561045036600461300d565b610b60565b60408051825163ffffffff1681526020928301519281019290925201610278565b34801561048257600080fd5b5061026e61049136600461300d565b610bb3565b6103be6104a4366004612fab565b610c0d565b3480156104b557600080fd5b5061026e610cda565b3480156104ca57600080fd5b5061026e610d8d565b3480156104df57600080fd5b506103be6104ee3660046130a8565b610d97565b3480156104ff57600080fd5b5061052a61050e366004612eb7565b610102602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610278565b34801561054e57600080fd5b506103be61055d366004612eb7565b610fa2565b34801561056e57600080fd5b506101685460ff166102c3565b34801561058757600080fd5b5061026e610596366004612eb7565b6101016020526000908152604090205481565b3480156105b557600080fd5b5061026e6105c4366004612eb7565b6001600160a01b031660009081526033602052604090205490565b3480156105eb57600080fd5b506103be610fac565b34801561060057600080fd5b5061026e61060f366004612eb7565b610fbe565b34801561062057600080fd5b506103be610fdc565b34801561063557600080fd5b504261026e565b34801561064857600080fd5b50610136546001600160a01b031661052a565b34801561066757600080fd5b50610296610fec565b34801561067c57600080fd5b5061026e610ffb565b34801561069157600080fd5b5061026e6106a0366004613102565b61100d565b3480156106b157600080fd5b5061026e6106c0366004612eb7565b611039565b3480156106d157600080fd5b506103be6106e036600461300d565b611077565b3480156106f157600080fd5b506102c361070036600461300d565b611089565b34801561071157600080fd5b506102c361072036600461300d565b61110f565b34801561073157600080fd5b506103be610740366004613037565b61111d565b34801561075157600080fd5b506103be610760366004612f41565b611313565b34801561077157600080fd5b5061026e610780366004612ed2565b611477565b34801561079157600080fd5b506103be6107a0366004612eb7565b6114a2565b6060603680546107b4906132ca565b80601f01602080910402602001604051908101604052809291908181526020018280546107e0906132ca565b801561082d5780601f106108025761010080835404028352916020019161082d565b820191906000526020600020905b81548152906001019060200180831161081057829003601f168201915b5050505050905090565b600033610845818585611518565b60019150505b92915050565b60003361085f85828561163c565b61086a8585856116b6565b60019150505b9392505050565b600061088161186c565b905090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108d85760405162461bcd60e51b81526004016108cf9061316a565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610921600080516020613373833981519152546001600160a01b031690565b6001600160a01b0316146109475760405162461bcd60e51b81526004016108cf906131b6565b610950816118a3565b6040805160008082526020820190925261096c918391906118ab565b50565b6000336108458185856109828383611477565b61098c919061324d565b611518565b60004282106109d05760405162461bcd60e51b815260206004820152600b60248201526a0859195d195c9b5a5b995960aa1b60448201526064016108cf565b6001600160a01b03831660009081526101016020526040902054806109f957600091505061084b565b82610a078560018403610b60565b5163ffffffff1611610a2c57610a208460018303610b60565b6020015191505061084b565b82610a38856000610b60565b5163ffffffff161115610a4f57600091505061084b565b600060001982015b81811115610aba5760028282030481036000610a738883610b60565b805190915063ffffffff16871415610a955760200151945061084b9350505050565b805163ffffffff16871115610aac57819350610ab3565b6001820392505b5050610a57565b610ac48683610b60565b602001519695505050505050565b610ada611a25565b610ae2611a80565b565b610aec611a25565b610af96002600019613265565b81610b0360355490565b610b0d919061324d565b1115610b525760405162461bcd60e51b81526020600482015260146024820152731cda185c995cce8818d85c08195e18d95959195960621b60448201526064016108cf565b610b5c8282611ad3565b5050565b604080518082018252600080825260209182018190526001600160a01b039490941684526101008152818420928452918252918290208251808401909352805463ffffffff168352600101549082015290565b6001600160a01b03821660009081526101046020526040812081908190610bdb908590611ba0565b9150915081610c02576001600160a01b038516600090815260336020526040902054610c04565b805b95945050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610c565760405162461bcd60e51b81526004016108cf9061316a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c9f600080516020613373833981519152546001600160a01b031690565b6001600160a01b031614610cc55760405162461bcd60e51b81526004016108cf906131b6565b610cce826118a3565b610b5c828260016118ab565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108cf565b5060008051602061337383398151915290565b6000610881611c97565b600054610100900460ff1615808015610db75750600054600160ff909116105b80610dd15750303b158015610dd1575060005460ff166001145b610e345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108cf565b6000805460ff191660011790558015610e57576000805461ff0019166101001790555b8251610e9a5760405162461bcd60e51b81526020600482015260126024820152717368617265733a206e616d6520656d70747960701b60448201526064016108cf565b8151610edf5760405162461bcd60e51b81526020600482015260146024820152737368617265733a2073796d626f6c20656d70747960601b60448201526064016108cf565b610ee98383611ca3565b610ef283611cd4565b610efa611d1e565b610f02611d4d565b610f0a611d74565b610f12611d4d565b610f576040518060400160405280600a8152602001693232b632b3b0ba34b7b760b11b815250604051806040016040528060018152602001600d60fa1b815250611da3565b8015610f9d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b61096c3382611dd4565b610fb4611a25565b610ae26000611ecb565b6001600160a01b03811660009081526099602052604081205461084b565b610fe4611a25565b610ae2611f1e565b6060603780546107b4906132ca565b6000611005611a25565b610881611f5c565b600080600061101e84610105611ba0565b915091508161102f57603554611031565b805b949350505050565b6001600160a01b038116600090815261010160205260408120548061105f576000610870565b61106c8360018303610b60565b602001519392505050565b61107f611a25565b610b5c8282611fb7565b600033816110978286611477565b9050838110156110f75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108cf565b6111048286868403611518565b506001949350505050565b6000336108458185856116b6565b8342111561116d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e6174757265206578706972656400000060448201526064016108cf565b600061121661120e7f0e3bc21ca2be03aeeee0e614bfe98f970c96a05a768f627c50ab81764cb5026861119e6107a5565b6040516020016111ae919061311b565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905260c001604051602081830303815290604052805190602001206120f7565b858585612145565b90506001600160a01b03811661126e5760405162461bcd60e51b815260206004820181905260248201527f4552433230566f7465733a20696e76616c6964207369676e657220283078302960448201526064016108cf565b6001600160a01b0381166000908152610103602052604090205486146112d65760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e63650000000000000060448201526064016108cf565b6001600160a01b0381166000908152610103602052604081208054916112fb836132ff565b919050555061130a8188611dd4565b50505050505050565b834211156113635760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016108cf565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113928c61216d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113ed82612195565b905060006113fd82878787612145565b9050896001600160a01b0316816001600160a01b0316146114605760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016108cf565b61146b8a8a8a611518565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6114aa611a25565b6001600160a01b03811661150f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108cf565b61096c81611ecb565b6001600160a01b03831661157a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108cf565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108cf565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006116488484611477565b905060001981146116b057818110156116a35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016108cf565b6116b08484848403611518565b50505050565b6001600160a01b03831661171a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108cf565b6001600160a01b03821661177c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108cf565b6117878383836121a2565b6001600160a01b038316600090815260336020526040902054818110156117ff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108cf565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061185f9086815260200190565b60405180910390a36116b0565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61189b60655490565b606654612233565b61096c611a25565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156118de57610f9d8361227c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561191757600080fd5b505afa925050508015611947575060408051601f3d908101601f191682019092526119449181019061308f565b60015b6119aa5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108cf565b6000805160206133738339815191528114611a195760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108cf565b50610f9d838383612318565b610136546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108cf565b611a8861233d565b610168805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216611b295760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108cf565b611b35600083836121a2565b8060356000828254611b47919061324d565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60008060008411611bec5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016108cf565b611bf4611c97565b841115611c435760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016108cf565b6000611c4f8486612387565b8454909150811415611c68576000809250925050611c90565b6001846001018281548110611c7f57611c7f613346565b906000526020600020015492509250505b9250929050565b60006108816101075490565b600054610100900460ff16611cca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612432565b600054610100900460ff16611cfb5760405162461bcd60e51b81526004016108cf90613202565b61096c81604051806040016040528060018152602001603160f81b815250612480565b600054610100900460ff16611d455760405162461bcd60e51b81526004016108cf90613202565b610ae26124c1565b600054610100900460ff16610ae25760405162461bcd60e51b81526004016108cf90613202565b600054610100900460ff16611d9b5760405162461bcd60e51b81526004016108cf90613202565b610ae26124f5565b600054610100900460ff16611dca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612525565b6001600160a01b03821660009081526033602052604081205411611e245760405162461bcd60e51b81526020600482015260076024820152662173686172657360c81b60448201526064016108cf565b6001600160a01b0380831660009081526101026020526040902080548383166001600160a01b031982161790915516611e7c8183611e77866001600160a01b031660009081526033602052604090205490565b612566565b816001600160a01b0316816001600160a01b0316846001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4505050565b61013680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f2661264a565b610168805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ab63390565b6000611f6d61010780546001019055565b6000611f77611c97565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb6781604051611faa91815260200190565b60405180910390a1919050565b6001600160a01b0382166120175760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016108cf565b612023826000836121a2565b6001600160a01b038216600090815260336020526040902054818110156120975760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016108cf565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600061084b612104612691565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612156878787876126c8565b915091506121638161278c565b5095945050505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061084b61210461186c565b6121ad8383836128da565b6001600160a01b03831615806121e05750610136546001600160a01b0316331480156121e057506001600160a01b038216155b806121ef57506101685460ff16155b610f9d5760405162461bcd60e51b81526020600482015260156024820152747368617265733a20217472616e7366657261626c6560581b60448201526064016108cf565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6001600160a01b0381163b6122e95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108cf565b60008051602061337383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6123218361292d565b60008251118061232e5750805b15610f9d576116b0838361296d565b6101685460ff16610ae25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108cf565b81546000906123985750600061084b565b82546000905b808210156123e55760006123b28383612a58565b600087815260209020909150859082015411156123d1578091506123df565b6123dc81600161324d565b92505b5061239e565b60008211801561241157508361240e86612400600186613287565b600091825260209091200190565b54145b1561242a57612421600183613287565b9250505061084b565b50905061084b565b600054610100900460ff166124595760405162461bcd60e51b81526004016108cf90613202565b815161246c906036906020850190612d60565b508051610f9d906037906020840190612d60565b600054610100900460ff166124a75760405162461bcd60e51b81526004016108cf90613202565b815160209283012081519190920120606591909155606655565b600054610100900460ff166124e85760405162461bcd60e51b81526004016108cf90613202565b610168805460ff19169055565b600054610100900460ff1661251c5760405162461bcd60e51b81526004016108cf90613202565b610ae233611ecb565b600054610100900460ff1661254c5760405162461bcd60e51b81526004016108cf90613202565b81516020928301208151919092012060cc9190915560cd55565b816001600160a01b0316836001600160a01b03161415801561258757508015155b15610f9d576001600160a01b038316156125e9576001600160a01b0383166000908152610101602052604081205490816125c25760006125d4565b6125cf8560018403610b60565b602001515b90508281036125e586848484612a73565b5050505b6001600160a01b03821615610f9d576001600160a01b03821660009081526101016020526040812054908161261f576000612631565b61262c8460018403610b60565b602001515b905082810161264285848484612a73565b505050505050565b6101685460ff1615610ae25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108cf565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6126c060cc5490565b60cd54612233565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126ff5750600090506003612783565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612753573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661277c57600060019250925050612783565b9150600090505b94509492505050565b60008160048111156127a0576127a0613330565b14156127a95750565b60018160048111156127bd576127bd613330565b141561280b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108cf565b600281600481111561281f5761281f613330565b141561286d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108cf565b600381600481111561288157612881613330565b141561096c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108cf565b6128e5838383612b9c565b6001600160a01b038316612904576128fc82612c48565b610f9d612c7c565b6001600160a01b03821661291b576128fc83612c48565b61292483612c48565b610f9d82612c48565b6129368161227c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108cf565b600080846001600160a01b0316846040516129f0919061311b565b600060405180830381855af49150503d8060008114612a2b576040519150601f19603f3d011682016040523d82523d6000602084013e612a30565b606091505b5091509150610c04828260405180606001604052806027815260200161339360279139612c8b565b6000612a676002848418613265565b6108709084841661324d565b428315801590612ab357506001600160a01b0385166000908152610100602090815260408083206000198801845290915290205463ffffffff8281169116145b15612aeb576001600160a01b038516600090815261010060209081526040808320600019880184529091529020600101829055612b51565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038a16600081815261010084528681208b825284528681209551865463ffffffff191695169490941785559051600194850155825261010190529190912090850190555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b6001600160a01b038216600090815260336020526040902054158015612bd957506001600160a01b03821660009081526101016020526040902054155b8015612be55750600081115b15612c15576001600160a01b03821660008181526101026020526040902080546001600160a01b03191690911790555b6001600160a01b0380841660009081526101026020526040808220548584168352912054610f9d92918216911683612566565b6001600160a01b03811660009081526101046020908152604080832060339092529091205461096c9190612ca4565b612ca4565b610ae2610105612c7760355490565b60608315612c9a575081610870565b6108708383612cee565b6000612cae611c97565b905080612cba84612d18565b1015610f9d578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b815115612cfe5781518083602001fd5b8060405162461bcd60e51b81526004016108cf9190613137565b8054600090612d2957506000919050565b81548290612d3990600190613287565b81548110612d4957612d49613346565b90600052602060002001549050919050565b919050565b828054612d6c906132ca565b90600052602060002090601f016020900481019282612d8e5760008555612dd4565b82601f10612da757805160ff1916838001178555612dd4565b82800160010185558215612dd4579182015b82811115612dd4578251825591602001919060010190612db9565b50612de0929150612de4565b5090565b5b80821115612de05760008155600101612de5565b600067ffffffffffffffff80841115612e1457612e1461335c565b604051601f8501601f19908116603f01168101908282118183101715612e3c57612e3c61335c565b81604052809350858152868686011115612e5557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612d5b57600080fd5b600082601f830112612e9757600080fd5b61087083833560208501612df9565b803560ff81168114612d5b57600080fd5b600060208284031215612ec957600080fd5b61087082612e6f565b60008060408385031215612ee557600080fd5b612eee83612e6f565b9150612efc60208401612e6f565b90509250929050565b600080600060608486031215612f1a57600080fd5b612f2384612e6f565b9250612f3160208501612e6f565b9150604084013590509250925092565b600080600080600080600060e0888a031215612f5c57600080fd5b612f6588612e6f565b9650612f7360208901612e6f565b95506040880135945060608801359350612f8f60808901612ea6565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612fbe57600080fd5b612fc783612e6f565b9150602083013567ffffffffffffffff811115612fe357600080fd5b8301601f81018513612ff457600080fd5b61300385823560208401612df9565b9150509250929050565b6000806040838503121561302057600080fd5b61302983612e6f565b946020939093013593505050565b60008060008060008060c0878903121561305057600080fd5b61305987612e6f565b9550602087013594506040870135935061307560608801612ea6565b92506080870135915060a087013590509295509295509295565b6000602082840312156130a157600080fd5b5051919050565b600080604083850312156130bb57600080fd5b823567ffffffffffffffff808211156130d357600080fd5b6130df86838701612e86565b935060208501359150808211156130f557600080fd5b5061300385828601612e86565b60006020828403121561311457600080fd5b5035919050565b6000825161312d81846020870161329e565b9190910192915050565b602081526000825180602084015261315681604085016020870161329e565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156132605761326061331a565b500190565b60008261328257634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156132995761329961331a565b500390565b60005b838110156132b95781810151838201526020016132a1565b838111156116b05750506000910152565b600181811c908216806132de57607f821691505b6020821081141561218f57634e487b7160e01b600052602260045260246000fd5b60006000198214156133135761331361331a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200d1020c104d072d10e2125586128096b7567b61064dc9301fdd4980fc317d26464736f6c63430008070033", + "deployedBytecode": "0x60806040526004361061023b5760003560e01c80635c19a95c1161012e5780639711715a116100ab578063a9059cbb1161006f578063a9059cbb14610705578063c3cda52014610725578063d505accf14610745578063dd62ed3e14610765578063f2fde38b1461078557600080fd5b80639711715a14610670578063981b24d0146106855780639ab24eb0146106a55780639dc29fac146106c5578063a457c2d7146106e557600080fd5b80637ecebe00116100f25780637ecebe00146105f45780638456cb59146106145780638abe09f2146106295780638da5cb5b1461063c57806395d89b411461065b57600080fd5b80635c19a95c146105425780635c975abb146105625780636fcfff451461057b57806370a08231146105a9578063715018a6146105df57600080fd5b80633a46b1a8116101bc5780634f1ef286116101805780634f1ef2861461049657806352d1902d146104a95780635439ad86146104be578063562d190d146104d3578063587cde1e146104f357600080fd5b80633a46b1a8146103e05780633f4ba83a1461040057806340c10f191461041557806347f761f5146104355780634ee2cd7e1461047657600080fd5b806323b872dd1161020357806323b872dd1461034d578063313ce5671461036d5780633644e515146103895780633659cfe61461039e57806339509351146103c057600080fd5b806303c8a3c61461024057806306fdde0314610281578063095ea7b3146102a35780630cdfebfa146102d357806318160ddd14610338575b600080fd5b34801561024c57600080fd5b5061026e61025b366004612eb7565b6101036020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561028d57600080fd5b506102966107a5565b6040516102789190613137565b3480156102af57600080fd5b506102c36102be36600461300d565b610837565b6040519015158152602001610278565b3480156102df57600080fd5b5061031c6102ee36600461300d565b6101006020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610278565b34801561034457600080fd5b5060355461026e565b34801561035957600080fd5b506102c3610368366004612f05565b610851565b34801561037957600080fd5b5060405160128152602001610278565b34801561039557600080fd5b5061026e610877565b3480156103aa57600080fd5b506103be6103b9366004612eb7565b610886565b005b3480156103cc57600080fd5b506102c36103db36600461300d565b61096f565b3480156103ec57600080fd5b5061026e6103fb36600461300d565b610991565b34801561040c57600080fd5b506103be610ad2565b34801561042157600080fd5b506103be61043036600461300d565b610ae4565b34801561044157600080fd5b5061045561045036600461300d565b610b60565b60408051825163ffffffff1681526020928301519281019290925201610278565b34801561048257600080fd5b5061026e61049136600461300d565b610bb3565b6103be6104a4366004612fab565b610c0d565b3480156104b557600080fd5b5061026e610cda565b3480156104ca57600080fd5b5061026e610d8d565b3480156104df57600080fd5b506103be6104ee3660046130a8565b610d97565b3480156104ff57600080fd5b5061052a61050e366004612eb7565b610102602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610278565b34801561054e57600080fd5b506103be61055d366004612eb7565b610fa2565b34801561056e57600080fd5b506101685460ff166102c3565b34801561058757600080fd5b5061026e610596366004612eb7565b6101016020526000908152604090205481565b3480156105b557600080fd5b5061026e6105c4366004612eb7565b6001600160a01b031660009081526033602052604090205490565b3480156105eb57600080fd5b506103be610fac565b34801561060057600080fd5b5061026e61060f366004612eb7565b610fbe565b34801561062057600080fd5b506103be610fdc565b34801561063557600080fd5b504261026e565b34801561064857600080fd5b50610136546001600160a01b031661052a565b34801561066757600080fd5b50610296610fec565b34801561067c57600080fd5b5061026e610ffb565b34801561069157600080fd5b5061026e6106a0366004613102565b61100d565b3480156106b157600080fd5b5061026e6106c0366004612eb7565b611039565b3480156106d157600080fd5b506103be6106e036600461300d565b611077565b3480156106f157600080fd5b506102c361070036600461300d565b611089565b34801561071157600080fd5b506102c361072036600461300d565b61110f565b34801561073157600080fd5b506103be610740366004613037565b61111d565b34801561075157600080fd5b506103be610760366004612f41565b611313565b34801561077157600080fd5b5061026e610780366004612ed2565b611477565b34801561079157600080fd5b506103be6107a0366004612eb7565b6114a2565b6060603680546107b4906132ca565b80601f01602080910402602001604051908101604052809291908181526020018280546107e0906132ca565b801561082d5780601f106108025761010080835404028352916020019161082d565b820191906000526020600020905b81548152906001019060200180831161081057829003601f168201915b5050505050905090565b600033610845818585611518565b60019150505b92915050565b60003361085f85828561163c565b61086a8585856116b6565b60019150505b9392505050565b600061088161186c565b905090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108d85760405162461bcd60e51b81526004016108cf9061316a565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610921600080516020613373833981519152546001600160a01b031690565b6001600160a01b0316146109475760405162461bcd60e51b81526004016108cf906131b6565b610950816118a3565b6040805160008082526020820190925261096c918391906118ab565b50565b6000336108458185856109828383611477565b61098c919061324d565b611518565b60004282106109d05760405162461bcd60e51b815260206004820152600b60248201526a0859195d195c9b5a5b995960aa1b60448201526064016108cf565b6001600160a01b03831660009081526101016020526040902054806109f957600091505061084b565b82610a078560018403610b60565b5163ffffffff1611610a2c57610a208460018303610b60565b6020015191505061084b565b82610a38856000610b60565b5163ffffffff161115610a4f57600091505061084b565b600060001982015b81811115610aba5760028282030481036000610a738883610b60565b805190915063ffffffff16871415610a955760200151945061084b9350505050565b805163ffffffff16871115610aac57819350610ab3565b6001820392505b5050610a57565b610ac48683610b60565b602001519695505050505050565b610ada611a25565b610ae2611a80565b565b610aec611a25565b610af96002600019613265565b81610b0360355490565b610b0d919061324d565b1115610b525760405162461bcd60e51b81526020600482015260146024820152731cda185c995cce8818d85c08195e18d95959195960621b60448201526064016108cf565b610b5c8282611ad3565b5050565b604080518082018252600080825260209182018190526001600160a01b039490941684526101008152818420928452918252918290208251808401909352805463ffffffff168352600101549082015290565b6001600160a01b03821660009081526101046020526040812081908190610bdb908590611ba0565b9150915081610c02576001600160a01b038516600090815260336020526040902054610c04565b805b95945050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610c565760405162461bcd60e51b81526004016108cf9061316a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c9f600080516020613373833981519152546001600160a01b031690565b6001600160a01b031614610cc55760405162461bcd60e51b81526004016108cf906131b6565b610cce826118a3565b610b5c828260016118ab565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108cf565b5060008051602061337383398151915290565b6000610881611c97565b600054610100900460ff1615808015610db75750600054600160ff909116105b80610dd15750303b158015610dd1575060005460ff166001145b610e345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108cf565b6000805460ff191660011790558015610e57576000805461ff0019166101001790555b8251610e9a5760405162461bcd60e51b81526020600482015260126024820152717368617265733a206e616d6520656d70747960701b60448201526064016108cf565b8151610edf5760405162461bcd60e51b81526020600482015260146024820152737368617265733a2073796d626f6c20656d70747960601b60448201526064016108cf565b610ee98383611ca3565b610ef283611cd4565b610efa611d1e565b610f02611d4d565b610f0a611d74565b610f12611d4d565b610f576040518060400160405280600a8152602001693232b632b3b0ba34b7b760b11b815250604051806040016040528060018152602001600d60fa1b815250611da3565b8015610f9d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b61096c3382611dd4565b610fb4611a25565b610ae26000611ecb565b6001600160a01b03811660009081526099602052604081205461084b565b610fe4611a25565b610ae2611f1e565b6060603780546107b4906132ca565b6000611005611a25565b610881611f5c565b600080600061101e84610105611ba0565b915091508161102f57603554611031565b805b949350505050565b6001600160a01b038116600090815261010160205260408120548061105f576000610870565b61106c8360018303610b60565b602001519392505050565b61107f611a25565b610b5c8282611fb7565b600033816110978286611477565b9050838110156110f75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108cf565b6111048286868403611518565b506001949350505050565b6000336108458185856116b6565b8342111561116d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e6174757265206578706972656400000060448201526064016108cf565b600061121661120e7f0e3bc21ca2be03aeeee0e614bfe98f970c96a05a768f627c50ab81764cb5026861119e6107a5565b6040516020016111ae919061311b565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905260c001604051602081830303815290604052805190602001206120f7565b858585612145565b90506001600160a01b03811661126e5760405162461bcd60e51b815260206004820181905260248201527f4552433230566f7465733a20696e76616c6964207369676e657220283078302960448201526064016108cf565b6001600160a01b0381166000908152610103602052604090205486146112d65760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e63650000000000000060448201526064016108cf565b6001600160a01b0381166000908152610103602052604081208054916112fb836132ff565b919050555061130a8188611dd4565b50505050505050565b834211156113635760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016108cf565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113928c61216d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113ed82612195565b905060006113fd82878787612145565b9050896001600160a01b0316816001600160a01b0316146114605760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016108cf565b61146b8a8a8a611518565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6114aa611a25565b6001600160a01b03811661150f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108cf565b61096c81611ecb565b6001600160a01b03831661157a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108cf565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108cf565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006116488484611477565b905060001981146116b057818110156116a35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016108cf565b6116b08484848403611518565b50505050565b6001600160a01b03831661171a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108cf565b6001600160a01b03821661177c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108cf565b6117878383836121a2565b6001600160a01b038316600090815260336020526040902054818110156117ff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108cf565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061185f9086815260200190565b60405180910390a36116b0565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61189b60655490565b606654612233565b61096c611a25565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156118de57610f9d8361227c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561191757600080fd5b505afa925050508015611947575060408051601f3d908101601f191682019092526119449181019061308f565b60015b6119aa5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108cf565b6000805160206133738339815191528114611a195760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108cf565b50610f9d838383612318565b610136546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108cf565b611a8861233d565b610168805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216611b295760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108cf565b611b35600083836121a2565b8060356000828254611b47919061324d565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60008060008411611bec5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016108cf565b611bf4611c97565b841115611c435760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016108cf565b6000611c4f8486612387565b8454909150811415611c68576000809250925050611c90565b6001846001018281548110611c7f57611c7f613346565b906000526020600020015492509250505b9250929050565b60006108816101075490565b600054610100900460ff16611cca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612432565b600054610100900460ff16611cfb5760405162461bcd60e51b81526004016108cf90613202565b61096c81604051806040016040528060018152602001603160f81b815250612480565b600054610100900460ff16611d455760405162461bcd60e51b81526004016108cf90613202565b610ae26124c1565b600054610100900460ff16610ae25760405162461bcd60e51b81526004016108cf90613202565b600054610100900460ff16611d9b5760405162461bcd60e51b81526004016108cf90613202565b610ae26124f5565b600054610100900460ff16611dca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612525565b6001600160a01b03821660009081526033602052604081205411611e245760405162461bcd60e51b81526020600482015260076024820152662173686172657360c81b60448201526064016108cf565b6001600160a01b0380831660009081526101026020526040902080548383166001600160a01b031982161790915516611e7c8183611e77866001600160a01b031660009081526033602052604090205490565b612566565b816001600160a01b0316816001600160a01b0316846001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4505050565b61013680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f2661264a565b610168805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ab63390565b6000611f6d61010780546001019055565b6000611f77611c97565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb6781604051611faa91815260200190565b60405180910390a1919050565b6001600160a01b0382166120175760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016108cf565b612023826000836121a2565b6001600160a01b038216600090815260336020526040902054818110156120975760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016108cf565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600061084b612104612691565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612156878787876126c8565b915091506121638161278c565b5095945050505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061084b61210461186c565b6121ad8383836128da565b6001600160a01b03831615806121e05750610136546001600160a01b0316331480156121e057506001600160a01b038216155b806121ef57506101685460ff16155b610f9d5760405162461bcd60e51b81526020600482015260156024820152747368617265733a20217472616e7366657261626c6560581b60448201526064016108cf565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6001600160a01b0381163b6122e95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108cf565b60008051602061337383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6123218361292d565b60008251118061232e5750805b15610f9d576116b0838361296d565b6101685460ff16610ae25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108cf565b81546000906123985750600061084b565b82546000905b808210156123e55760006123b28383612a58565b600087815260209020909150859082015411156123d1578091506123df565b6123dc81600161324d565b92505b5061239e565b60008211801561241157508361240e86612400600186613287565b600091825260209091200190565b54145b1561242a57612421600183613287565b9250505061084b565b50905061084b565b600054610100900460ff166124595760405162461bcd60e51b81526004016108cf90613202565b815161246c906036906020850190612d60565b508051610f9d906037906020840190612d60565b600054610100900460ff166124a75760405162461bcd60e51b81526004016108cf90613202565b815160209283012081519190920120606591909155606655565b600054610100900460ff166124e85760405162461bcd60e51b81526004016108cf90613202565b610168805460ff19169055565b600054610100900460ff1661251c5760405162461bcd60e51b81526004016108cf90613202565b610ae233611ecb565b600054610100900460ff1661254c5760405162461bcd60e51b81526004016108cf90613202565b81516020928301208151919092012060cc9190915560cd55565b816001600160a01b0316836001600160a01b03161415801561258757508015155b15610f9d576001600160a01b038316156125e9576001600160a01b0383166000908152610101602052604081205490816125c25760006125d4565b6125cf8560018403610b60565b602001515b90508281036125e586848484612a73565b5050505b6001600160a01b03821615610f9d576001600160a01b03821660009081526101016020526040812054908161261f576000612631565b61262c8460018403610b60565b602001515b905082810161264285848484612a73565b505050505050565b6101685460ff1615610ae25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108cf565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6126c060cc5490565b60cd54612233565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126ff5750600090506003612783565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612753573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661277c57600060019250925050612783565b9150600090505b94509492505050565b60008160048111156127a0576127a0613330565b14156127a95750565b60018160048111156127bd576127bd613330565b141561280b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108cf565b600281600481111561281f5761281f613330565b141561286d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108cf565b600381600481111561288157612881613330565b141561096c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108cf565b6128e5838383612b9c565b6001600160a01b038316612904576128fc82612c48565b610f9d612c7c565b6001600160a01b03821661291b576128fc83612c48565b61292483612c48565b610f9d82612c48565b6129368161227c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108cf565b600080846001600160a01b0316846040516129f0919061311b565b600060405180830381855af49150503d8060008114612a2b576040519150601f19603f3d011682016040523d82523d6000602084013e612a30565b606091505b5091509150610c04828260405180606001604052806027815260200161339360279139612c8b565b6000612a676002848418613265565b6108709084841661324d565b428315801590612ab357506001600160a01b0385166000908152610100602090815260408083206000198801845290915290205463ffffffff8281169116145b15612aeb576001600160a01b038516600090815261010060209081526040808320600019880184529091529020600101829055612b51565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038a16600081815261010084528681208b825284528681209551865463ffffffff191695169490941785559051600194850155825261010190529190912090850190555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b6001600160a01b038216600090815260336020526040902054158015612bd957506001600160a01b03821660009081526101016020526040902054155b8015612be55750600081115b15612c15576001600160a01b03821660008181526101026020526040902080546001600160a01b03191690911790555b6001600160a01b0380841660009081526101026020526040808220548584168352912054610f9d92918216911683612566565b6001600160a01b03811660009081526101046020908152604080832060339092529091205461096c9190612ca4565b612ca4565b610ae2610105612c7760355490565b60608315612c9a575081610870565b6108708383612cee565b6000612cae611c97565b905080612cba84612d18565b1015610f9d578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b815115612cfe5781518083602001fd5b8060405162461bcd60e51b81526004016108cf9190613137565b8054600090612d2957506000919050565b81548290612d3990600190613287565b81548110612d4957612d49613346565b90600052602060002001549050919050565b919050565b828054612d6c906132ca565b90600052602060002090601f016020900481019282612d8e5760008555612dd4565b82601f10612da757805160ff1916838001178555612dd4565b82800160010185558215612dd4579182015b82811115612dd4578251825591602001919060010190612db9565b50612de0929150612de4565b5090565b5b80821115612de05760008155600101612de5565b600067ffffffffffffffff80841115612e1457612e1461335c565b604051601f8501601f19908116603f01168101908282118183101715612e3c57612e3c61335c565b81604052809350858152868686011115612e5557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612d5b57600080fd5b600082601f830112612e9757600080fd5b61087083833560208501612df9565b803560ff81168114612d5b57600080fd5b600060208284031215612ec957600080fd5b61087082612e6f565b60008060408385031215612ee557600080fd5b612eee83612e6f565b9150612efc60208401612e6f565b90509250929050565b600080600060608486031215612f1a57600080fd5b612f2384612e6f565b9250612f3160208501612e6f565b9150604084013590509250925092565b600080600080600080600060e0888a031215612f5c57600080fd5b612f6588612e6f565b9650612f7360208901612e6f565b95506040880135945060608801359350612f8f60808901612ea6565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612fbe57600080fd5b612fc783612e6f565b9150602083013567ffffffffffffffff811115612fe357600080fd5b8301601f81018513612ff457600080fd5b61300385823560208401612df9565b9150509250929050565b6000806040838503121561302057600080fd5b61302983612e6f565b946020939093013593505050565b60008060008060008060c0878903121561305057600080fd5b61305987612e6f565b9550602087013594506040870135935061307560608801612ea6565b92506080870135915060a087013590509295509295509295565b6000602082840312156130a157600080fd5b5051919050565b600080604083850312156130bb57600080fd5b823567ffffffffffffffff808211156130d357600080fd5b6130df86838701612e86565b935060208501359150808211156130f557600080fd5b5061300385828601612e86565b60006020828403121561311457600080fd5b5035919050565b6000825161312d81846020870161329e565b9190910192915050565b602081526000825180602084015261315681604085016020870161329e565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156132605761326061331a565b500190565b60008261328257634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156132995761329961331a565b500390565b60005b838110156132b95781810151838201526020016132a1565b838111156116b05750506000910152565b600181811c908216806132de57607f821691505b6020821081141561218f57634e487b7160e01b600052602260045260246000fd5b60006000198214156133135761331361331a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200d1020c104d072d10e2125586128096b7567b61064dc9301fdd4980fc317d26464736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "balanceOfAt(address,uint256)": { + "details": "Retrieves the balance of `account` at the time `snapshotId` was created." + }, + "burn(address,uint256)": { + "params": { + "account": "Address to lose shares", + "amount": "Amount to burn" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "delegate(address)": { + "params": { + "delegatee": "The address to delegate votes to." + } + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "params": { + "delegatee": "The address to delegate 'votes' to.", + "expiry": "The time at which to expire the signature.", + "nonce": "The contract state required to match the signature.", + "r": "The r signature", + "s": "The s signature", + "v": "The v signature" + } + }, + "getPastVotes(address,uint256)": { + "params": { + "account": "The user to check `votes` for.", + "timePoint": "The unix time to check `votes` for." + }, + "returns": { + "votes": "Past `votes` delegated to `account`." + } + }, + "getVotes(address)": { + "params": { + "account": "The user to check delegated `votes` for." + }, + "returns": { + "votes": "Current `votes` delegated to `account`." + } + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "mint(address,uint256)": { + "params": { + "amount": "Amount to mint", + "recipient": "Address to receive shares" + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "now()": { + "returns": { + "timePoint": "returns unix epoch timestamp" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setUp(string,string)": { + "details": "initializer should prevent this from being called again", + "params": { + "name_": "Name for ERC20 token trackers", + "symbol_": "Symbol for ERC20 token trackers" + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "totalSupplyAt(uint256)": { + "details": "Retrieves the total supply at the time `snapshotId` was created." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "title": "Shares", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "burn(address,uint256)": { + "notice": "Baal-only function to burn shares." + }, + "delegate(address)": { + "notice": "Delegate votes from user to `delegatee`." + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "notice": "Delegates votes from `signer` to `delegatee` with EIP-712 signature." + }, + "getCurrentSnapshotId()": { + "notice": "get current SnapshotId" + }, + "getPastVotes(address,uint256)": { + "notice": "Returns the prior number of `votes` for `account` as of `timePoint`." + }, + "getVotes(address)": { + "notice": "Returns the current delegated `vote` balance for `account`." + }, + "mint(address,uint256)": { + "notice": "Baal-only function to mint shares." + }, + "now()": { + "notice": "Returns the current timepoint." + }, + "pause()": { + "notice": "Baal-only function to pause shares." + }, + "setUp(string,string)": { + "notice": "Configure shares - called by Baal on summon" + }, + "snapshot()": { + "notice": "Allows baal to create a snapshot" + }, + "unpause()": { + "notice": "Baal-only function to unpause shares." + } + }, + "notice": "Accounting for Baal non voting shares", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4971, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4977, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4979, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 4981, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage" + }, + { + "astId": 4983, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage" + }, + { + "astId": 5563, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 7403, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "101", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "102", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "103", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 6041, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_nonces", + "offset": 0, + "slot": "153", + "type": "t_mapping(t_address,t_struct(Counter)6730_storage)" + }, + { + "astId": 6049, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "154", + "type": "t_bytes32" + }, + { + "astId": 6205, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "155", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 16164, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_NAME_DELEGATION", + "offset": 0, + "slot": "204", + "type": "t_bytes32" + }, + { + "astId": 16166, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_VERSION_DELEGATION", + "offset": 0, + "slot": "205", + "type": "t_bytes32" + }, + { + "astId": 16304, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "206", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 15565, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "checkpoints", + "offset": 0, + "slot": "256", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_struct(Checkpoint)15558_storage))" + }, + { + "astId": 15569, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "numCheckpoints", + "offset": 0, + "slot": "257", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 15573, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "delegates", + "offset": 0, + "slot": "258", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 15577, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "delegationNonces", + "offset": 0, + "slot": "259", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 5685, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_accountBalanceSnapshots", + "offset": 0, + "slot": "260", + "type": "t_mapping(t_address,t_struct(Snapshots)5680_storage)" + }, + { + "astId": 5688, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_totalSupplySnapshots", + "offset": 0, + "slot": "261", + "type": "t_struct(Snapshots)5680_storage" + }, + { + "astId": 5691, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_currentSnapshotId", + "offset": 0, + "slot": "263", + "type": "t_struct(Counter)6730_storage" + }, + { + "astId": 5989, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "264", + "type": "t_array(t_uint256)46_storage" + }, + { + "astId": 3937, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_owner", + "offset": 0, + "slot": "310", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "311", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4773, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_paused", + "offset": 0, + "slot": "360", + "type": "t_bool" + }, + { + "astId": 4878, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "361", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "410", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "460", + "type": "t_array(t_uint256)50_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)46_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[46]", + "numberOfBytes": "1472" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_struct(Checkpoint)15558_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => struct BaalVotes.Checkpoint))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(Checkpoint)15558_storage)" + }, + "t_mapping(t_address,t_struct(Counter)6730_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)6730_storage" + }, + "t_mapping(t_address,t_struct(Snapshots)5680_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", + "numberOfBytes": "32", + "value": "t_struct(Snapshots)5680_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_struct(Checkpoint)15558_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct BaalVotes.Checkpoint)", + "numberOfBytes": "32", + "value": "t_struct(Checkpoint)15558_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint)15558_storage": { + "encoding": "inplace", + "label": "struct BaalVotes.Checkpoint", + "members": [ + { + "astId": 15555, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "fromTimePoint", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 15557, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "votes", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Counter)6730_storage": { + "encoding": "inplace", + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "astId": 6729, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Snapshots)5680_storage": { + "encoding": "inplace", + "label": "struct ERC20SnapshotUpgradeable.Snapshots", + "members": [ + { + "astId": 5676, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "ids", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5679, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "values", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/TributeMinion.json b/lib/Baal/deployments/base/TributeMinion.json new file mode 100644 index 0000000..799ef2c --- /dev/null +++ b/lib/Baal/deployments/base/TributeMinion.json @@ -0,0 +1,355 @@ +{ + "address": "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x30db36d2acee89378eee8a9417ad3cb27e364b36389c7079152b6f961c5dc1c2", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + "transactionIndex": 3, + "gasUsed": "885797", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xef625e1653fce2b83964112a2f63867c4a55a4f22eeca0956c986a71b65bfdb5", + "transactionHash": "0x30db36d2acee89378eee8a9417ad3cb27e364b36389c7079152b6f961c5dc1c2", + "logs": [], + "blockNumber": 7428418, + "cumulativeGasUsed": "1423490", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"proposalId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"applicant\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EscrowReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"TributeProposal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loot\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"proposalId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"escrow\",\"type\":\"address\"}],\"name\":\"encodeTributeProposal\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"escrows\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"applicant\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"released\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_baal\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_proposalId\",\"type\":\"uint32\"}],\"name\":\"releaseEscrow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Baal\",\"name\":\"baal\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loot\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalgas\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"submitTributeProposal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/tools/TributeMinion.sol\":\"TributeMinion\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"},\"contracts/tools/TributeMinion.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\nimport \\\"../Baal.sol\\\";\\n\\ninterface IERC20 {\\n function transferFrom(\\n address from,\\n address to,\\n uint256 value\\n ) external returns (bool);\\n}\\n\\ncontract TributeMinion {\\n event TributeProposal(\\n address indexed baal,\\n address token,\\n uint256 amount,\\n address recipient,\\n uint256 proposalId\\n );\\n struct Escrow {\\n address token;\\n address applicant;\\n uint256 amount;\\n bool released;\\n address safe;\\n }\\n mapping(address => mapping(uint256 => Escrow)) public escrows;\\n\\n event EscrowReleased(\\n address indexed baal,\\n uint32 proposalId,\\n address applicant,\\n address safe,\\n uint256 amount\\n );\\n\\n function encodeTributeProposal(\\n address baal,\\n uint256 shares,\\n uint256 loot,\\n address recipient,\\n uint32 proposalId,\\n address escrow\\n ) public pure returns (bytes memory) {\\n // Workaround for solidity dynamic memory array\\n address[] memory _recipients = new address[](1);\\n _recipients[0] = recipient;\\n\\n bytes memory _releaseEscrow = abi.encodeWithSignature(\\n \\\"releaseEscrow(address,uint32)\\\",\\n baal,\\n proposalId\\n );\\n\\n bytes memory tributeMultisend = abi.encodePacked(\\n uint8(0),\\n escrow,\\n uint256(0),\\n uint256(_releaseEscrow.length),\\n bytes(_releaseEscrow)\\n );\\n\\n if (shares > 0) {\\n // Workaround for solidity dynamic memory array\\n uint256[] memory _shares = new uint256[](1);\\n _shares[0] = shares;\\n\\n bytes memory _issueShares = abi.encodeWithSignature(\\n \\\"mintShares(address[],uint256[])\\\",\\n _recipients,\\n _shares\\n );\\n\\n tributeMultisend = abi.encodePacked(\\n tributeMultisend,\\n uint8(0),\\n baal,\\n uint256(0),\\n uint256(_issueShares.length),\\n bytes(_issueShares)\\n );\\n }\\n if (loot > 0) {\\n // Workaround for solidity dynamic memory array\\n uint256[] memory _loot = new uint256[](1);\\n _loot[0] = loot;\\n\\n bytes memory _issueLoot = abi.encodeWithSignature(\\n \\\"mintLoot(address[],uint256[])\\\",\\n _recipients,\\n _loot\\n );\\n\\n tributeMultisend = abi.encodePacked(\\n tributeMultisend,\\n uint8(0),\\n address(baal),\\n uint256(0),\\n uint256(_issueLoot.length),\\n bytes(_issueLoot)\\n );\\n }\\n\\n bytes memory _multisendAction = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n tributeMultisend\\n );\\n return _multisendAction;\\n }\\n\\n function submitTributeProposal(\\n Baal baal,\\n address token,\\n uint256 amount,\\n uint256 shares,\\n uint256 loot,\\n uint32 expiration,\\n uint256 baalgas,\\n string memory details\\n ) external payable {\\n uint32 proposalId = baal.proposalCount() + 1;\\n\\n bytes memory encodedProposal = encodeTributeProposal(\\n address(baal),\\n shares,\\n loot,\\n msg.sender,\\n proposalId,\\n address(this)\\n );\\n\\n escrows[address(baal)][proposalId] = Escrow(\\n token,\\n msg.sender,\\n amount,\\n false,\\n baal.target()\\n );\\n\\n baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);\\n\\n emit TributeProposal(\\n address(baal),\\n token,\\n amount,\\n msg.sender,\\n proposalId\\n );\\n }\\n\\n function releaseEscrow(address _baal, uint32 _proposalId) external {\\n Baal baal = Baal(_baal);\\n Escrow storage escrow = escrows[address(baal)][_proposalId];\\n require(!escrow.released, \\\"Already released\\\");\\n\\n bool[4] memory status = baal.getProposalStatus(_proposalId);\\n require(status[2], \\\"Not passed\\\");\\n escrow.released = true;\\n\\n IERC20 token = IERC20(escrow.token);\\n\\n emit EscrowReleased(\\n _baal,\\n _proposalId,\\n escrow.applicant,\\n escrow.safe,\\n escrow.amount\\n );\\n\\n require(\\n token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),\\n \\\"Transfer failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x878896b7c3bdd2b2132d356d9d6f6cff263c88027970ea8c2c917d6fdef52209\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610f10806100206000396000f3fe60806040526004361061003f5760003560e01c806304a54aa7146100445780633336c279146100e0578063610ac73d146101025780636bd4afe714610115575b600080fd5b34801561005057600080fd5b506100a561005f366004610980565b600060208181529281526040808220909352908152208054600182015460028301546003909301546001600160a01b03928316939183169260ff82169161010090041685565b604080516001600160a01b039687168152948616602086015284019290925215156060830152909116608082015260a0015b60405180910390f35b3480156100ec57600080fd5b506101006100fb366004610a1c565b610142565b005b610100610110366004610afe565b6103de565b34801561012157600080fd5b506101356101303660046109ac565b61069d565b6040516100d79190610d98565b6001600160a01b03821660009081526020818152604080832063ffffffff851684529091529020600381015483919060ff16156101b95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995b19585cd95960821b60448201526064015b60405180910390fd5b60405163118c2bff60e21b815263ffffffff841660048201526000906001600160a01b03841690634630affc9060240160806040518083038186803b15801561020157600080fd5b505afa158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610a55565b604081015190915061027a5760405162461bcd60e51b815260206004820152600a602482015269139bdd081c185cdcd95960b21b60448201526064016101b0565b60038201805460ff191660019081179182905583549084015460028501546040805163ffffffff8a1681526001600160a01b039384166020820152610100909504831690850152606084015290811691908716907f637fb12bbeb9000df3de89d3f54dba04a8940ff0b762f16937aa1bc12dfc26779060800160405180910390a26001830154600384015460028501546040516323b872dd60e01b81526001600160a01b039384166004820152610100909204831660248301526044820152908216906323b872dd90606401602060405180830381600087803b15801561036057600080fd5b505af1158015610374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103989190610ae3565b6103d65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016101b0565b505050505050565b6000886001600160a01b031663da35c6646040518163ffffffff1660e01b815260040160206040518083038186803b15801561041957600080fd5b505afa15801561042d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104519190610c0b565b61045c906001610e1e565b9050600061046e8a888833863061069d565b90506040518060a001604052808a6001600160a01b03168152602001336001600160a01b031681526020018981526020016000151581526020018b6001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e157600080fd5b505afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610519919061095c565b6001600160a01b039081169091528b811660008181526020818152604080832063ffffffff89168452825291829020855181549086166001600160a01b031991821617825591860151600182018054918716919093161790915584820151600282015560608501516003909101805460809096015190941661010002610100600160a81b0319911515919091166001600160a81b0319909516949094179390931790915590516307505ff960e31b8152633a82ffc89034906105e59085908a908a908a90600401610dab565b6020604051808303818588803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106379190610bf2565b50604080516001600160a01b038b81168252602082018b9052338284015263ffffffff851660608301529151918c16917f1deb8b1e22941ec32a7ed14b2d25bdb44593ab343156feb1c735ec06696221399181900360800190a250505050505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905084816000815181106106d7576106d7610e84565b6001600160a01b039283166020918202929092010152604051908916602482015263ffffffff8516604482015260009060640160408051601f19818403018152918152602080830180516001600160e01b0316633336c27960e01b179052825191519293506000926107529284928992849291889101610cbe565b60408051601f198184030181529190529050881561082f576040805160018082528183019092526000916020808301908036833701905050905089816000815181106107a0576107a0610e84565b602002602001018181525050600084826040516024016107c1929190610d14565b604051602081830303815290604052632c78fd0360e21b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d600084518560405160200161081b96959493929190610c54565b604051602081830303815290604052925050505b87156108fa5760408051600180825281830190925260009160208083019080368337019050509050888160008151811061086b5761086b610e84565b6020026020010181815250506000848260405160240161088c929190610d14565b6040516020818303038152906040526322936c2360e11b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d60008451856040516020016108e696959493929190610c54565b604051602081830303815290604052925050505b60008160405160240161090d9190610d98565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b1790529450505050509695505050505050565b8051801515811461095757600080fd5b919050565b60006020828403121561096e57600080fd5b815161097981610eb0565b9392505050565b6000806040838503121561099357600080fd5b823561099e81610eb0565b946020939093013593505050565b60008060008060008060c087890312156109c557600080fd5b86356109d081610eb0565b9550602087013594506040870135935060608701356109ee81610eb0565b925060808701356109fe81610ec8565b915060a0870135610a0e81610eb0565b809150509295509295509295565b60008060408385031215610a2f57600080fd5b8235610a3a81610eb0565b91506020830135610a4a81610ec8565b809150509250929050565b600060808284031215610a6757600080fd5b82601f830112610a7657600080fd5b6040516080810181811067ffffffffffffffff82111715610a9957610a99610e9a565b604052808360808101861015610aae57600080fd5b60005b6004811015610ad857610ac382610947565b83526020928301929190910190600101610ab1565b509195945050505050565b600060208284031215610af557600080fd5b61097982610947565b600080600080600080600080610100898b031215610b1b57600080fd5b8835610b2681610eb0565b9750602089810135610b3781610eb0565b975060408a0135965060608a0135955060808a0135945060a08a0135610b5c81610ec8565b935060c08a0135925060e08a013567ffffffffffffffff80821115610b8057600080fd5b818c0191508c601f830112610b9457600080fd5b813581811115610ba657610ba6610e9a565b610bb8601f8201601f19168501610ded565b91508082528d84828501011115610bce57600080fd5b80848401858401376000848284010152508093505050509295985092959890939650565b600060208284031215610c0457600080fd5b5051919050565b600060208284031215610c1d57600080fd5b815161097981610ec8565b60008151808452610c40816020860160208601610e54565b601f01601f19169290920160200192915050565b60008751610c66818460208c01610e54565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351610cae816055840160208801610e54565b0160550198975050505050505050565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251610d03816055850160208701610e54565b919091016055019695505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610d565781516001600160a01b031684529284019290840190600101610d31565b5050508381038285015284518082528583019183019060005b81811015610d8b57835183529284019291840191600101610d6f565b5090979650505050505050565b6020815260006109796020830184610c28565b608081526000610dbe6080830187610c28565b63ffffffff861660208401528460408401528281036060840152610de28185610c28565b979650505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e1657610e16610e9a565b604052919050565b600063ffffffff808316818516808303821115610e4b57634e487b7160e01b600052601160045260246000fd5b01949350505050565b60005b83811015610e6f578181015183820152602001610e57565b83811115610e7e576000848401525b50505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ec557600080fd5b50565b63ffffffff81168114610ec557600080fdfea2646970667358221220a3323eb1a602115aba0d9a9bf27a1b961890e40a7d0dbd148bb6b967aef950c264736f6c63430008070033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806304a54aa7146100445780633336c279146100e0578063610ac73d146101025780636bd4afe714610115575b600080fd5b34801561005057600080fd5b506100a561005f366004610980565b600060208181529281526040808220909352908152208054600182015460028301546003909301546001600160a01b03928316939183169260ff82169161010090041685565b604080516001600160a01b039687168152948616602086015284019290925215156060830152909116608082015260a0015b60405180910390f35b3480156100ec57600080fd5b506101006100fb366004610a1c565b610142565b005b610100610110366004610afe565b6103de565b34801561012157600080fd5b506101356101303660046109ac565b61069d565b6040516100d79190610d98565b6001600160a01b03821660009081526020818152604080832063ffffffff851684529091529020600381015483919060ff16156101b95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995b19585cd95960821b60448201526064015b60405180910390fd5b60405163118c2bff60e21b815263ffffffff841660048201526000906001600160a01b03841690634630affc9060240160806040518083038186803b15801561020157600080fd5b505afa158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610a55565b604081015190915061027a5760405162461bcd60e51b815260206004820152600a602482015269139bdd081c185cdcd95960b21b60448201526064016101b0565b60038201805460ff191660019081179182905583549084015460028501546040805163ffffffff8a1681526001600160a01b039384166020820152610100909504831690850152606084015290811691908716907f637fb12bbeb9000df3de89d3f54dba04a8940ff0b762f16937aa1bc12dfc26779060800160405180910390a26001830154600384015460028501546040516323b872dd60e01b81526001600160a01b039384166004820152610100909204831660248301526044820152908216906323b872dd90606401602060405180830381600087803b15801561036057600080fd5b505af1158015610374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103989190610ae3565b6103d65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016101b0565b505050505050565b6000886001600160a01b031663da35c6646040518163ffffffff1660e01b815260040160206040518083038186803b15801561041957600080fd5b505afa15801561042d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104519190610c0b565b61045c906001610e1e565b9050600061046e8a888833863061069d565b90506040518060a001604052808a6001600160a01b03168152602001336001600160a01b031681526020018981526020016000151581526020018b6001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e157600080fd5b505afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610519919061095c565b6001600160a01b039081169091528b811660008181526020818152604080832063ffffffff89168452825291829020855181549086166001600160a01b031991821617825591860151600182018054918716919093161790915584820151600282015560608501516003909101805460809096015190941661010002610100600160a81b0319911515919091166001600160a81b0319909516949094179390931790915590516307505ff960e31b8152633a82ffc89034906105e59085908a908a908a90600401610dab565b6020604051808303818588803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106379190610bf2565b50604080516001600160a01b038b81168252602082018b9052338284015263ffffffff851660608301529151918c16917f1deb8b1e22941ec32a7ed14b2d25bdb44593ab343156feb1c735ec06696221399181900360800190a250505050505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905084816000815181106106d7576106d7610e84565b6001600160a01b039283166020918202929092010152604051908916602482015263ffffffff8516604482015260009060640160408051601f19818403018152918152602080830180516001600160e01b0316633336c27960e01b179052825191519293506000926107529284928992849291889101610cbe565b60408051601f198184030181529190529050881561082f576040805160018082528183019092526000916020808301908036833701905050905089816000815181106107a0576107a0610e84565b602002602001018181525050600084826040516024016107c1929190610d14565b604051602081830303815290604052632c78fd0360e21b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d600084518560405160200161081b96959493929190610c54565b604051602081830303815290604052925050505b87156108fa5760408051600180825281830190925260009160208083019080368337019050509050888160008151811061086b5761086b610e84565b6020026020010181815250506000848260405160240161088c929190610d14565b6040516020818303038152906040526322936c2360e11b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d60008451856040516020016108e696959493929190610c54565b604051602081830303815290604052925050505b60008160405160240161090d9190610d98565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b1790529450505050509695505050505050565b8051801515811461095757600080fd5b919050565b60006020828403121561096e57600080fd5b815161097981610eb0565b9392505050565b6000806040838503121561099357600080fd5b823561099e81610eb0565b946020939093013593505050565b60008060008060008060c087890312156109c557600080fd5b86356109d081610eb0565b9550602087013594506040870135935060608701356109ee81610eb0565b925060808701356109fe81610ec8565b915060a0870135610a0e81610eb0565b809150509295509295509295565b60008060408385031215610a2f57600080fd5b8235610a3a81610eb0565b91506020830135610a4a81610ec8565b809150509250929050565b600060808284031215610a6757600080fd5b82601f830112610a7657600080fd5b6040516080810181811067ffffffffffffffff82111715610a9957610a99610e9a565b604052808360808101861015610aae57600080fd5b60005b6004811015610ad857610ac382610947565b83526020928301929190910190600101610ab1565b509195945050505050565b600060208284031215610af557600080fd5b61097982610947565b600080600080600080600080610100898b031215610b1b57600080fd5b8835610b2681610eb0565b9750602089810135610b3781610eb0565b975060408a0135965060608a0135955060808a0135945060a08a0135610b5c81610ec8565b935060c08a0135925060e08a013567ffffffffffffffff80821115610b8057600080fd5b818c0191508c601f830112610b9457600080fd5b813581811115610ba657610ba6610e9a565b610bb8601f8201601f19168501610ded565b91508082528d84828501011115610bce57600080fd5b80848401858401376000848284010152508093505050509295985092959890939650565b600060208284031215610c0457600080fd5b5051919050565b600060208284031215610c1d57600080fd5b815161097981610ec8565b60008151808452610c40816020860160208601610e54565b601f01601f19169290920160200192915050565b60008751610c66818460208c01610e54565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351610cae816055840160208801610e54565b0160550198975050505050505050565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251610d03816055850160208701610e54565b919091016055019695505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610d565781516001600160a01b031684529284019290840190600101610d31565b5050508381038285015284518082528583019183019060005b81811015610d8b57835183529284019291840191600101610d6f565b5090979650505050505050565b6020815260006109796020830184610c28565b608081526000610dbe6080830187610c28565b63ffffffff861660208401528460408401528281036060840152610de28185610c28565b979650505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e1657610e16610e9a565b604052919050565b600063ffffffff808316818516808303821115610e4b57634e487b7160e01b600052601160045260246000fd5b01949350505050565b60005b83811015610e6f578181015183820152602001610e57565b83811115610e7e576000848401525b50505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ec557600080fd5b50565b63ffffffff81168114610ec557600080fdfea2646970667358221220a3323eb1a602115aba0d9a9bf27a1b961890e40a7d0dbd148bb6b967aef950c264736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15153, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "escrows", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_struct(Escrow)15146_storage))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_struct(Escrow)15146_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => struct TributeMinion.Escrow))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(Escrow)15146_storage)" + }, + "t_mapping(t_uint256,t_struct(Escrow)15146_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct TributeMinion.Escrow)", + "numberOfBytes": "32", + "value": "t_struct(Escrow)15146_storage" + }, + "t_struct(Escrow)15146_storage": { + "encoding": "inplace", + "label": "struct TributeMinion.Escrow", + "members": [ + { + "astId": 15137, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 15139, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "applicant", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 15141, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "amount", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 15143, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "released", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 15145, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "safe", + "offset": 1, + "slot": "3", + "type": "t_address" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/lib/Baal/deployments/base/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 0000000..6eb5ed9 --- /dev/null +++ b/lib/Baal/deployments/base/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/solcInputs/928daf6847beb441da40e990eb20d125.json b/lib/Baal/deployments/base/solcInputs/928daf6847beb441da40e990eb20d125.json new file mode 100644 index 0000000..fb39b99 --- /dev/null +++ b/lib/Baal/deployments/base/solcInputs/928daf6847beb441da40e990eb20d125.json @@ -0,0 +1,284 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/GnosisSafeStorage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title GnosisSafeStorage - Storage layout of the Safe contracts to be used in libraries\n/// @author Richard Meissner - \ncontract GnosisSafeStorage {\n // From /common/Singleton.sol\n address internal singleton;\n // From /common/ModuleManager.sol\n mapping(address => address) internal modules;\n // From /common/OwnerManager.sol\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n // From /GnosisSafe.sol\n bytes32 internal nonce;\n bytes32 internal domainSeparator;\n mapping(bytes32 => uint256) internal signedMessages;\n mapping(address => mapping(bytes32 => uint256)) internal approvedHashes;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeStorage.sol\";\nimport \"../../GnosisSafe.sol\";\n\n/// @title SignMessageLib - Allows to set an entry in the signedMessages\n/// @author Richard Meissner - \ncontract SignMessageLib is GnosisSafeStorage {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n event SignMsg(bytes32 indexed msgHash);\n\n /// @dev Marks a message as signed, so that it can be used with EIP-1271\n /// @notice Marks a message (`_data`) as signed.\n /// @param _data Arbitrary length data that should be marked as signed on the behalf of address(this)\n function signMessage(bytes calldata _data) external {\n bytes32 msgHash = getMessageHash(_data);\n signedMessages[msgHash] = 1;\n emit SignMsg(msgHash);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return\n keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), GnosisSafe(payable(address(this))).domainSeparator(), safeMessageHash));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./DefaultCallbackHandler.sol\";\nimport \"../interfaces/ISignatureValidator.sol\";\nimport \"../GnosisSafe.sol\";\n\n/// @title Compatibility Fallback Handler - fallback handler to provider compatibility between pre 1.3.0 and 1.3.0+ Safe contracts\n/// @author Richard Meissner - \ncontract CompatibilityFallbackHandler is DefaultCallbackHandler, ISignatureValidator {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256(\"simulate(address,bytes)\"));\n\n address internal constant SENTINEL_MODULES = address(0x1);\n bytes4 internal constant UPDATED_MAGIC_VALUE = 0x1626ba7e;\n\n /**\n * Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`)\n * @dev Should return whether the signature provided is valid for the provided data.\n * @param _data Arbitrary length data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _data\n * @return a bool upon valid or invalid signature with corresponding _data\n */\n function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n bytes32 messageHash = getMessageHashForSafe(safe, _data);\n if (_signature.length == 0) {\n require(safe.signedMessages(messageHash) != 0, \"Hash not approved\");\n } else {\n safe.checkSignatures(messageHash, _data, _signature);\n }\n return EIP1271_MAGIC_VALUE;\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n return getMessageHashForSafe(GnosisSafe(payable(msg.sender)), message);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param safe Safe to which the message is targeted\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHashForSafe(GnosisSafe safe, bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), safe.domainSeparator(), safeMessageHash));\n }\n\n /**\n * Implementation of updated EIP-1271\n * @dev Should return whether the signature provided is valid for the provided data.\n * The save does not implement the interface since `checkSignatures` is not a view method.\n * The method will not perform any state changes (see parameters of `checkSignatures`)\n * @param _dataHash Hash of the data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _dataHash\n * @return a bool upon valid or invalid signature with corresponding _dataHash\n * @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\n */\n function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) {\n ISignatureValidator validator = ISignatureValidator(msg.sender);\n bytes4 value = validator.isValidSignature(abi.encode(_dataHash), _signature);\n return (value == EIP1271_MAGIC_VALUE) ? UPDATED_MAGIC_VALUE : bytes4(0);\n }\n\n /// @dev Returns array of first 10 modules.\n /// @return Array of modules.\n function getModules() external view returns (address[] memory) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n (address[] memory array, ) = safe.getModulesPaginated(SENTINEL_MODULES, 10);\n return array;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulate(address targetContract, bytes calldata calldataPayload) external returns (bytes memory response) {\n // Suppress compiler warnings about not using parameters, while allowing\n // parameters to keep names for documentation purposes. This does not\n // generate code.\n targetContract;\n calldataPayload;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let internalCalldata := mload(0x40)\n // Store `simulateAndRevert.selector`.\n // String representation is used to force right padding\n mstore(internalCalldata, \"\\xb4\\xfa\\xba\\x09\")\n // Abuse the fact that both this and the internal methods have the\n // same signature, and differ only in symbol name (and therefore,\n // selector) and copy calldata directly. This saves us approximately\n // 250 bytes of code and 300 gas at runtime over the\n // `abi.encodeWithSelector` builtin.\n calldatacopy(add(internalCalldata, 0x04), 0x04, sub(calldatasize(), 0x04))\n\n // `pop` is required here by the compiler, as top level expressions\n // can't have return values in inline assembly. `call` typically\n // returns a 0 or 1 value indicated whether or not it reverted, but\n // since we know it will always revert, we can safely ignore it.\n pop(\n call(\n gas(),\n // address() has been changed to caller() to use the implementation of the Safe\n caller(),\n 0,\n internalCalldata,\n calldatasize(),\n // The `simulateAndRevert` call always reverts, and\n // instead encodes whether or not it was successful in the return\n // data. The first 32-byte word of the return data contains the\n // `success` value, so write it to memory address 0x00 (which is\n // reserved Solidity scratch space and OK to use).\n 0x00,\n 0x20\n )\n )\n\n // Allocate and copy the response bytes, making sure to increment\n // the free memory pointer accordingly (in case this method is\n // called as an internal function). The remaining `returndata[0x20:]`\n // contains the ABI encoded response bytes, so we can just write it\n // as is to memory.\n let responseSize := sub(returndatasize(), 0x20)\n response := mload(0x40)\n mstore(0x40, add(response, responseSize))\n returndatacopy(response, 0x20, responseSize)\n\n if iszero(mload(0x00)) {\n revert(add(response, 0x20), mload(response))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n\n/// @title Default Callback Handler - returns true for known token callbacks\n/// @author Richard Meissner - \ncontract DefaultCallbackHandler is ERC1155TokenReceiver, ERC777TokensRecipient, ERC721TokenReceiver, IERC165 {\n string public constant NAME = \"Default Callback Handler\";\n string public constant VERSION = \"1.0.0\";\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xf23a6e61;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xbc197c81;\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0x150b7a02;\n }\n\n function tokensReceived(\n address,\n address,\n address,\n uint256,\n bytes calldata,\n bytes calldata\n ) external pure override {\n // We implement this for completeness, doesn't really have any value\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC1155TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n Note: The ERC-165 identifier for this interface is 0x4e2312e0.\n*/\ninterface ERC1155TokenReceiver {\n /**\n @notice Handle the receipt of a single ERC1155 token type.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` (i.e. 0xf23a6e61) if it accepts the transfer.\n This function MUST revert if it rejects the transfer.\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _id The ID of the token being transferred\n @param _value The amount of tokens being transferred\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 _id,\n uint256 _value,\n bytes calldata _data\n ) external returns (bytes4);\n\n /**\n @notice Handle the receipt of multiple ERC1155 token types.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` (i.e. 0xbc197c81) if it accepts the transfer(s).\n This function MUST revert if it rejects the transfer(s).\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the batch transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _ids An array containing ids of each token being transferred (order and length must match _values array)\n @param _values An array containing amounts of each token being transferred (order and length must match _ids array)\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata _ids,\n uint256[] calldata _values,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC721TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.\ninterface ERC721TokenReceiver {\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC777TokensRecipient.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ninterface ERC777TokensRecipient {\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Multi Send - Allows to batch multiple transactions into one.\n/// @author Nick Dodson - \n/// @author Gonçalo Sá - \n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract MultiSend {\n address private immutable multisendSingleton;\n\n constructor() {\n multisendSingleton = address(this);\n }\n\n /// @dev Sends multiple transactions and reverts all if one fails.\n /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of\n /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),\n /// to as a address (=> 20 bytes),\n /// value as a uint256 (=> 32 bytes),\n /// data length as a uint256 (=> 32 bytes),\n /// data as bytes.\n /// see abi.encodePacked for more information on packed encoding\n /// @notice This method is payable as delegatecalls keep the msg.value from the previous call\n /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise\n function multiSend(bytes memory transactions) public payable {\n require(address(this) != multisendSingleton, \"MultiSend should only be called via delegatecall\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let length := mload(transactions)\n let i := 0x20\n for {\n // Pre block is not used in \"while mode\"\n } lt(i, length) {\n // Post block is not used in \"while mode\"\n } {\n // First byte of the data is the operation.\n // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).\n // This will also zero out unused data.\n let operation := shr(0xf8, mload(add(transactions, i)))\n // We offset the load address by 1 byte (operation byte)\n // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.\n let to := shr(0x60, mload(add(transactions, add(i, 0x01))))\n // We offset the load address by 21 byte (operation byte + 20 address bytes)\n let value := mload(add(transactions, add(i, 0x15)))\n // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)\n let dataLength := mload(add(transactions, add(i, 0x35)))\n // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)\n let data := add(transactions, add(i, 0x55))\n let success := 0\n switch operation\n case 0 {\n success := call(gas(), to, value, data, dataLength, 0, 0)\n }\n case 1 {\n success := delegatecall(gas(), to, data, dataLength, 0, 0)\n }\n if eq(success, 0) {\n revert(0, 0)\n }\n // Next entry starts at 85 byte + data length\n i := add(i, add(0x55, dataLength))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ArraysUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it's possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\n *\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\n * alternative consider {ERC20Votes}.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\n\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\n function __ERC20Snapshot_init() internal onlyInitializing {\n }\n\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\n }\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n using ArraysUpgradeable for uint256[];\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n // Snapshot struct, but that would impede usage of functions that work on an array.\n struct Snapshots {\n uint256[] ids;\n uint256[] values;\n }\n\n mapping(address => Snapshots) private _accountBalanceSnapshots;\n Snapshots private _totalSupplySnapshots;\n\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n CountersUpgradeable.Counter private _currentSnapshotId;\n\n /**\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n */\n event Snapshot(uint256 id);\n\n /**\n * @dev Creates a new snapshot and returns its snapshot id.\n *\n * Emits a {Snapshot} event that contains the same id.\n *\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\n *\n * [WARNING]\n * ====\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n * you must consider that it can potentially be used by attackers in two ways.\n *\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n * section above.\n *\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\n * ====\n */\n function _snapshot() internal virtual returns (uint256) {\n _currentSnapshotId.increment();\n\n uint256 currentId = _getCurrentSnapshotId();\n emit Snapshot(currentId);\n return currentId;\n }\n\n /**\n * @dev Get the current snapshotId\n */\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\n return _currentSnapshotId.current();\n }\n\n /**\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n */\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n return snapshotted ? value : balanceOf(account);\n }\n\n /**\n * @dev Retrieves the total supply at the time `snapshotId` was created.\n */\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n return snapshotted ? value : totalSupply();\n }\n\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (from == address(0)) {\n // mint\n _updateAccountSnapshot(to);\n _updateTotalSupplySnapshot();\n } else if (to == address(0)) {\n // burn\n _updateAccountSnapshot(from);\n _updateTotalSupplySnapshot();\n } else {\n // transfer\n _updateAccountSnapshot(from);\n _updateAccountSnapshot(to);\n }\n }\n\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\n require(snapshotId > 0, \"ERC20Snapshot: id is 0\");\n require(snapshotId <= _getCurrentSnapshotId(), \"ERC20Snapshot: nonexistent id\");\n\n // When a valid snapshot is queried, there are three possibilities:\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n // to this id is the current one.\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n // requested id, and its value is the one to return.\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n // larger than the requested one.\n //\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\n // exactly this.\n\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n if (index == snapshots.ids.length) {\n return (false, 0);\n } else {\n return (true, snapshots.values[index]);\n }\n }\n\n function _updateAccountSnapshot(address account) private {\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n }\n\n function _updateTotalSupplySnapshot() private {\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\n }\n\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n uint256 currentId = _getCurrentSnapshotId();\n if (_lastSnapshotId(snapshots.ids) < currentId) {\n snapshots.ids.push(currentId);\n snapshots.values.push(currentValue);\n }\n }\n\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n if (ids.length == 0) {\n return 0;\n } else {\n return ids[ids.length - 1];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[46] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./StorageSlotUpgradeable.sol\";\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary ArraysUpgradeable {\n using StorageSlotUpgradeable for bytes32;\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * `array` is expected to be sorted in ascending order, and to contain no\n * repeated elements.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n if (array.length == 0) {\n return 0;\n }\n\n uint256 low = 0;\n uint256 high = array.length;\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getUint256Slot();\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr)\n public\n returns (address)\n {\n // Deploy new safe but do not set it up yet\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxy(\n gnosisSingleton,\n bytes(\"\")\n )\n )\n );\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal));\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IAdminShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IAdminShaman {\n function isAdmin(address shaman) external view returns (bool);\n\n // Admin Only\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n}\n" + }, + "contracts/interfaces/IBaal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaal {\n function lootToken() external view returns (address);\n function sharesToken() external view returns (address);\n function votingPeriod() external view returns (uint32);\n function gracePeriod() external view returns (uint32);\n function proposalCount() external view returns (uint32);\n function proposalOffering() external view returns (uint256);\n function quorumPercent() external view returns (uint256);\n function sponsorThreshold() external view returns (uint256);\n function minRetentionPercent() external view returns (uint256);\n function latestSponsoredProposalId() external view returns (uint32);\n\n function setUp(bytes memory initializationParams) external;\n function multisendLibrary() external view returns (address);\n // Module\n function avatar() external view returns (address);\n function target() external view returns (address);\n function setAvatar(address avatar) external;\n function setTarget(address avatar) external;\n // BaseRelayRecipient\n function trustedForwarder() external view returns (address);\n function setTrustedForwarder(address trustedForwarderAddress) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n function totalLoot() external view returns (uint256);\n function totalShares() external view returns (uint256);\n function totalSupply() external view returns (uint256);\n function lootPaused() external view returns (bool);\n function sharesPaused() external view returns (bool);\n \n function shamans(address shaman) external view returns (uint256);\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\n function isAdmin(address shaman) external view returns (bool);\n function isManager(address shaman) external view returns (bool);\n function isGovernor(address shaman) external view returns (bool);\n function lockAdmin() external;\n function lockManager() external;\n function lockGovernor() external;\n function adminLock() external view returns (bool);\n function managerLock() external view returns (bool);\n function governorLock() external view returns (bool);\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n function setGovernanceConfig(bytes memory governanceConfig) external;\n\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable returns (uint256);\n function sponsorProposal(uint32 id) external;\n function processProposal(uint32 id, bytes calldata proposalData) external;\n function cancelProposal(uint32 id) external;\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\n function submitVote(uint32 id, bool approved) external;\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\n\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\n}\n" + }, + "contracts/interfaces/IBaalAndVaultSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalAndVaultSummoner {\n\n function _baalSummoner() external view returns (address);\n function summonBaalAndVault(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 saltNonce,\n bytes32 referrer,\n string memory name\n ) external returns (address _daoAddress, address _vaultAddress);\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + }, + "contracts/interfaces/IGovernorShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IGovernorShaman {\n function isGovernor(address shaman) external view returns (bool);\n // Governor Only\n function setGovernanceConfig(bytes memory _governanceConfig) external;\n}\n" + }, + "contracts/interfaces/IManagerShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IManagerShaman {\n\n function isManager(address shaman) external view returns (bool);\n\n // Manager Only\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n\n}\n" + }, + "contracts/interfaces/IPoster.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IPoster {\n function post(string calldata content, string calldata tag) external;\n}\n" + }, + "contracts/utils/DelegationEIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4Delegation}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract DelegationEIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME_DELEGATION;\n bytes32 private _HASHED_VERSION_DELEGATION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained_delegation(name, version);\n }\n\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME_DELEGATION = hashedName;\n _HASHED_VERSION_DELEGATION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\n }\n\n function _buildDomainSeparatorDelegation(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_NAME_DELEGATION;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_VERSION_DELEGATION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/base/solcInputs/d833871936d16a85338aeeebf4887b62.json b/lib/Baal/deployments/base/solcInputs/d833871936d16a85338aeeebf4887b62.json new file mode 100644 index 0000000..285fb33 --- /dev/null +++ b/lib/Baal/deployments/base/solcInputs/d833871936d16a85338aeeebf4887b62.json @@ -0,0 +1,302 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/GnosisSafeStorage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title GnosisSafeStorage - Storage layout of the Safe contracts to be used in libraries\n/// @author Richard Meissner - \ncontract GnosisSafeStorage {\n // From /common/Singleton.sol\n address internal singleton;\n // From /common/ModuleManager.sol\n mapping(address => address) internal modules;\n // From /common/OwnerManager.sol\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n // From /GnosisSafe.sol\n bytes32 internal nonce;\n bytes32 internal domainSeparator;\n mapping(bytes32 => uint256) internal signedMessages;\n mapping(address => mapping(bytes32 => uint256)) internal approvedHashes;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeStorage.sol\";\nimport \"../../GnosisSafe.sol\";\n\n/// @title SignMessageLib - Allows to set an entry in the signedMessages\n/// @author Richard Meissner - \ncontract SignMessageLib is GnosisSafeStorage {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n event SignMsg(bytes32 indexed msgHash);\n\n /// @dev Marks a message as signed, so that it can be used with EIP-1271\n /// @notice Marks a message (`_data`) as signed.\n /// @param _data Arbitrary length data that should be marked as signed on the behalf of address(this)\n function signMessage(bytes calldata _data) external {\n bytes32 msgHash = getMessageHash(_data);\n signedMessages[msgHash] = 1;\n emit SignMsg(msgHash);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return\n keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), GnosisSafe(payable(address(this))).domainSeparator(), safeMessageHash));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./DefaultCallbackHandler.sol\";\nimport \"../interfaces/ISignatureValidator.sol\";\nimport \"../GnosisSafe.sol\";\n\n/// @title Compatibility Fallback Handler - fallback handler to provider compatibility between pre 1.3.0 and 1.3.0+ Safe contracts\n/// @author Richard Meissner - \ncontract CompatibilityFallbackHandler is DefaultCallbackHandler, ISignatureValidator {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256(\"simulate(address,bytes)\"));\n\n address internal constant SENTINEL_MODULES = address(0x1);\n bytes4 internal constant UPDATED_MAGIC_VALUE = 0x1626ba7e;\n\n /**\n * Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`)\n * @dev Should return whether the signature provided is valid for the provided data.\n * @param _data Arbitrary length data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _data\n * @return a bool upon valid or invalid signature with corresponding _data\n */\n function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n bytes32 messageHash = getMessageHashForSafe(safe, _data);\n if (_signature.length == 0) {\n require(safe.signedMessages(messageHash) != 0, \"Hash not approved\");\n } else {\n safe.checkSignatures(messageHash, _data, _signature);\n }\n return EIP1271_MAGIC_VALUE;\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n return getMessageHashForSafe(GnosisSafe(payable(msg.sender)), message);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param safe Safe to which the message is targeted\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHashForSafe(GnosisSafe safe, bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), safe.domainSeparator(), safeMessageHash));\n }\n\n /**\n * Implementation of updated EIP-1271\n * @dev Should return whether the signature provided is valid for the provided data.\n * The save does not implement the interface since `checkSignatures` is not a view method.\n * The method will not perform any state changes (see parameters of `checkSignatures`)\n * @param _dataHash Hash of the data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _dataHash\n * @return a bool upon valid or invalid signature with corresponding _dataHash\n * @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\n */\n function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) {\n ISignatureValidator validator = ISignatureValidator(msg.sender);\n bytes4 value = validator.isValidSignature(abi.encode(_dataHash), _signature);\n return (value == EIP1271_MAGIC_VALUE) ? UPDATED_MAGIC_VALUE : bytes4(0);\n }\n\n /// @dev Returns array of first 10 modules.\n /// @return Array of modules.\n function getModules() external view returns (address[] memory) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n (address[] memory array, ) = safe.getModulesPaginated(SENTINEL_MODULES, 10);\n return array;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulate(address targetContract, bytes calldata calldataPayload) external returns (bytes memory response) {\n // Suppress compiler warnings about not using parameters, while allowing\n // parameters to keep names for documentation purposes. This does not\n // generate code.\n targetContract;\n calldataPayload;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let internalCalldata := mload(0x40)\n // Store `simulateAndRevert.selector`.\n // String representation is used to force right padding\n mstore(internalCalldata, \"\\xb4\\xfa\\xba\\x09\")\n // Abuse the fact that both this and the internal methods have the\n // same signature, and differ only in symbol name (and therefore,\n // selector) and copy calldata directly. This saves us approximately\n // 250 bytes of code and 300 gas at runtime over the\n // `abi.encodeWithSelector` builtin.\n calldatacopy(add(internalCalldata, 0x04), 0x04, sub(calldatasize(), 0x04))\n\n // `pop` is required here by the compiler, as top level expressions\n // can't have return values in inline assembly. `call` typically\n // returns a 0 or 1 value indicated whether or not it reverted, but\n // since we know it will always revert, we can safely ignore it.\n pop(\n call(\n gas(),\n // address() has been changed to caller() to use the implementation of the Safe\n caller(),\n 0,\n internalCalldata,\n calldatasize(),\n // The `simulateAndRevert` call always reverts, and\n // instead encodes whether or not it was successful in the return\n // data. The first 32-byte word of the return data contains the\n // `success` value, so write it to memory address 0x00 (which is\n // reserved Solidity scratch space and OK to use).\n 0x00,\n 0x20\n )\n )\n\n // Allocate and copy the response bytes, making sure to increment\n // the free memory pointer accordingly (in case this method is\n // called as an internal function). The remaining `returndata[0x20:]`\n // contains the ABI encoded response bytes, so we can just write it\n // as is to memory.\n let responseSize := sub(returndatasize(), 0x20)\n response := mload(0x40)\n mstore(0x40, add(response, responseSize))\n returndatacopy(response, 0x20, responseSize)\n\n if iszero(mload(0x00)) {\n revert(add(response, 0x20), mload(response))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n\n/// @title Default Callback Handler - returns true for known token callbacks\n/// @author Richard Meissner - \ncontract DefaultCallbackHandler is ERC1155TokenReceiver, ERC777TokensRecipient, ERC721TokenReceiver, IERC165 {\n string public constant NAME = \"Default Callback Handler\";\n string public constant VERSION = \"1.0.0\";\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xf23a6e61;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xbc197c81;\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0x150b7a02;\n }\n\n function tokensReceived(\n address,\n address,\n address,\n uint256,\n bytes calldata,\n bytes calldata\n ) external pure override {\n // We implement this for completeness, doesn't really have any value\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC1155TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n Note: The ERC-165 identifier for this interface is 0x4e2312e0.\n*/\ninterface ERC1155TokenReceiver {\n /**\n @notice Handle the receipt of a single ERC1155 token type.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` (i.e. 0xf23a6e61) if it accepts the transfer.\n This function MUST revert if it rejects the transfer.\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _id The ID of the token being transferred\n @param _value The amount of tokens being transferred\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 _id,\n uint256 _value,\n bytes calldata _data\n ) external returns (bytes4);\n\n /**\n @notice Handle the receipt of multiple ERC1155 token types.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` (i.e. 0xbc197c81) if it accepts the transfer(s).\n This function MUST revert if it rejects the transfer(s).\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the batch transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _ids An array containing ids of each token being transferred (order and length must match _values array)\n @param _values An array containing amounts of each token being transferred (order and length must match _ids array)\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata _ids,\n uint256[] calldata _values,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC721TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.\ninterface ERC721TokenReceiver {\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC777TokensRecipient.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ninterface ERC777TokensRecipient {\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Multi Send - Allows to batch multiple transactions into one.\n/// @author Nick Dodson - \n/// @author Gonçalo Sá - \n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract MultiSend {\n address private immutable multisendSingleton;\n\n constructor() {\n multisendSingleton = address(this);\n }\n\n /// @dev Sends multiple transactions and reverts all if one fails.\n /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of\n /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),\n /// to as a address (=> 20 bytes),\n /// value as a uint256 (=> 32 bytes),\n /// data length as a uint256 (=> 32 bytes),\n /// data as bytes.\n /// see abi.encodePacked for more information on packed encoding\n /// @notice This method is payable as delegatecalls keep the msg.value from the previous call\n /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise\n function multiSend(bytes memory transactions) public payable {\n require(address(this) != multisendSingleton, \"MultiSend should only be called via delegatecall\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let length := mload(transactions)\n let i := 0x20\n for {\n // Pre block is not used in \"while mode\"\n } lt(i, length) {\n // Post block is not used in \"while mode\"\n } {\n // First byte of the data is the operation.\n // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).\n // This will also zero out unused data.\n let operation := shr(0xf8, mload(add(transactions, i)))\n // We offset the load address by 1 byte (operation byte)\n // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.\n let to := shr(0x60, mload(add(transactions, add(i, 0x01))))\n // We offset the load address by 21 byte (operation byte + 20 address bytes)\n let value := mload(add(transactions, add(i, 0x15)))\n // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)\n let dataLength := mload(add(transactions, add(i, 0x35)))\n // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)\n let data := add(transactions, add(i, 0x55))\n let success := 0\n switch operation\n case 0 {\n success := call(gas(), to, value, data, dataLength, 0, 0)\n }\n case 1 {\n success := delegatecall(gas(), to, data, dataLength, 0, 0)\n }\n if eq(success, 0) {\n revert(0, 0)\n }\n // Next entry starts at 85 byte + data length\n i := add(i, add(0x55, dataLength))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ArraysUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it's possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\n *\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\n * alternative consider {ERC20Votes}.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\n\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\n function __ERC20Snapshot_init() internal onlyInitializing {\n }\n\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\n }\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n using ArraysUpgradeable for uint256[];\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n // Snapshot struct, but that would impede usage of functions that work on an array.\n struct Snapshots {\n uint256[] ids;\n uint256[] values;\n }\n\n mapping(address => Snapshots) private _accountBalanceSnapshots;\n Snapshots private _totalSupplySnapshots;\n\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n CountersUpgradeable.Counter private _currentSnapshotId;\n\n /**\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n */\n event Snapshot(uint256 id);\n\n /**\n * @dev Creates a new snapshot and returns its snapshot id.\n *\n * Emits a {Snapshot} event that contains the same id.\n *\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\n *\n * [WARNING]\n * ====\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n * you must consider that it can potentially be used by attackers in two ways.\n *\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n * section above.\n *\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\n * ====\n */\n function _snapshot() internal virtual returns (uint256) {\n _currentSnapshotId.increment();\n\n uint256 currentId = _getCurrentSnapshotId();\n emit Snapshot(currentId);\n return currentId;\n }\n\n /**\n * @dev Get the current snapshotId\n */\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\n return _currentSnapshotId.current();\n }\n\n /**\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n */\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n return snapshotted ? value : balanceOf(account);\n }\n\n /**\n * @dev Retrieves the total supply at the time `snapshotId` was created.\n */\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n return snapshotted ? value : totalSupply();\n }\n\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (from == address(0)) {\n // mint\n _updateAccountSnapshot(to);\n _updateTotalSupplySnapshot();\n } else if (to == address(0)) {\n // burn\n _updateAccountSnapshot(from);\n _updateTotalSupplySnapshot();\n } else {\n // transfer\n _updateAccountSnapshot(from);\n _updateAccountSnapshot(to);\n }\n }\n\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\n require(snapshotId > 0, \"ERC20Snapshot: id is 0\");\n require(snapshotId <= _getCurrentSnapshotId(), \"ERC20Snapshot: nonexistent id\");\n\n // When a valid snapshot is queried, there are three possibilities:\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n // to this id is the current one.\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n // requested id, and its value is the one to return.\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n // larger than the requested one.\n //\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\n // exactly this.\n\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n if (index == snapshots.ids.length) {\n return (false, 0);\n } else {\n return (true, snapshots.values[index]);\n }\n }\n\n function _updateAccountSnapshot(address account) private {\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n }\n\n function _updateTotalSupplySnapshot() private {\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\n }\n\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n uint256 currentId = _getCurrentSnapshotId();\n if (_lastSnapshotId(snapshots.ids) < currentId) {\n snapshots.ids.push(currentId);\n snapshots.values.push(currentValue);\n }\n }\n\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n if (ids.length == 0) {\n return 0;\n } else {\n return ids[ids.length - 1];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[46] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./StorageSlotUpgradeable.sol\";\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary ArraysUpgradeable {\n using StorageSlotUpgradeable for bytes32;\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * `array` is expected to be sorted in ascending order, and to contain no\n * repeated elements.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n if (array.length == 0) {\n return 0;\n }\n\n uint256 low = 0;\n uint256 high = array.length;\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getUint256Slot();\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/fixtures/GnosisImports.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\n" + }, + "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../Baal.sol\";\nimport \"../interfaces/IBaalSummoner.sol\";\n\ncontract BaalAdvTokenSummoner is\n Initializable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n IBaalSummoner public _baalSummoner;\n\n event setSummoner(address summoner);\n\n event DeployBaalTokens(address lootToken, address sharesToken);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize() public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /**\n * @dev Sets the address of the BaalSummoner contract\n * @param baalSummoner The address of the BaalSummoner contract\n */\n function setSummonerAddr(address baalSummoner) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /**\n * @dev Summon a new Baal contract with a new set of tokens\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\n * @param _saltNonce The salt nonce to be used for the Safe contract\n * @param initializationMintParams The parameters for minting the tokens\n * @param initializationTokenParams The parameters for deploying the tokens\n * @param postInitializationActions The actions to be performed after the initialization\n */\n function summonBaalFromReferrer(\n address _safeAddr,\n address _forwarderAddr,\n uint256 _saltNonce,\n bytes calldata initializationMintParams,\n bytes calldata initializationTokenParams,\n bytes[] calldata postInitializationActions\n ) external {\n // summon tokens\n (address _lootToken, address _sharesToken) = deployTokens(\n initializationTokenParams\n );\n\n // mint shares loot tokens\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\n\n // summon baal with new tokens\n address _baal = _baalSummoner.summonBaalFromReferrer(\n abi.encode(\n IBaalToken(_sharesToken).name(), \n IBaalToken(_sharesToken).symbol(),\n _safeAddr,\n _forwarderAddr,\n _lootToken,\n _sharesToken\n ),\n postInitializationActions,\n _saltNonce,\n bytes32(bytes(\"DHAdvTokenSummoner\")) // referrer\n );\n\n // change token ownership to baal\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n }\n\n /**\n * @dev mintTokens\n * @param initializationTokens The parameters for minting the tokens\n * @param _lootToken The loot token address\n * @param _sharesToken The shares token address\n */\n function mintTokens(\n bytes calldata initializationTokens,\n address _lootToken,\n address _sharesToken\n ) internal {\n (\n address[] memory summoners, // The address to mint initial tokens to\n uint256[] memory summonerShares, // The amount of shares to mint\n uint256[] memory summonerLoot // The amount of loot to mint\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\n\n require(\n summoners.length == summonerShares.length &&\n summoners.length == summonerLoot.length,\n \"!array parity\"\n ); /*check array lengths match*/\n\n for (uint256 i = 0; i < summoners.length; i++) {\n if (summonerLoot[i] > 0) {\n IBaalToken(_lootToken).mint(\n summoners[i],\n summonerLoot[i]\n ); /*grant `to` `amount` `loot`*/\n }\n if (summonerShares[i] > 0) {\n IBaalToken(_sharesToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `shares`*/\n }\n }\n }\n\n /**\n * @dev deployTokens\n * @param initializationParams The parameters for deploying the tokens\n */\n function deployTokens(\n bytes calldata initializationParams\n ) internal returns (address lootToken, address sharesToken) {\n (\n string\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\n string\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\n string\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\n string\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\n bool _transferableShares /* if shares is transferable */,\n bool _transferableLoot /* if loot is transferable */\n ) = abi.decode(\n initializationParams,\n (string, string, string, string, bool, bool)\n );\n\n address lootSingleton = _baalSummoner.lootSingleton();\n address sharesSingleton = _baalSummoner.sharesSingleton();\n\n lootToken = address(\n new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector,\n _lootName,\n _lootSymbol\n )\n )\n );\n\n sharesToken = address(\n new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector,\n _name,\n _symbol\n )\n )\n );\n if (!_transferableShares) {\n IBaalToken(sharesToken).pause();\n }\n if (!_transferableLoot) {\n IBaalToken(lootToken).pause();\n }\n\n emit DeployBaalTokens(lootToken, sharesToken);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n}\n" + }, + "contracts/higherOrderFactories/BaalAndVaultSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../interfaces/IBaalSummoner.sol\";\n\n/*\nSummon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)\nCan summon a dao with a new Vault.\nCan summon a new vault for a dao after initial dao setup.\nActs as a register and the owner of the contract or DAO can deactivate\nregister is primarily a helper for UIs\nOwner of the contract can add new vaults, and set current vaults\nContract is upgradable and should be owned by a DAO\n*/\ncontract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n\n IBaalSummoner public _baalSummoner;\n uint256 public vaultIdx;\n\n struct Vault{\n uint256 id;\n bool active;\n address daoAddress;\n address vaultAddress;\n string name;\n }\n mapping(uint256 => Vault) public vaults;\n mapping(address => address) public delegates;\n\n event SetVault(\n Vault vault\n );\n\n event SetDelegate(\n address daoAddress,\n address delegate\n );\n\n event setSummoner(\n address summoner\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n vaultIdx = 0;\n }\n\n function setSummonerAddr(\n address baalSummoner\n ) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /** Summon a new baal and add a Vault */\n function summonBaalAndVault(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 saltNonce,\n bytes32 referrer,\n string memory name\n ) external returns (address _daoAddress, address _vaultAddress) {\n _daoAddress = _baalSummoner.summonBaalFromReferrer(\n initializationParams,\n initializationActions,\n saltNonce,\n referrer\n );\n _vaultAddress = summonVault(_daoAddress, name);\n }\n\n /** create and add a Vault(Safe) to an existing DAO */\n function summonVault(\n address daoAddress,\n string memory name\n ) public returns (address _vaultAddress) {\n _vaultAddress = _baalSummoner.deployAndSetupSafe(\n daoAddress\n );\n _setNewVault(name, daoAddress, _vaultAddress);\n }\n\n /** set a Vault as active or not on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setVault(\n uint256 id,\n bool active\n ) public onlyOwner\n {\n _setVault(id, active);\n }\n\n /** set a new Vault as active on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setNewVault(\n address daoAddress, \n address vaultAddress,\n string memory name\n ) public onlyOwner\n {\n _setNewVault(name, daoAddress, vaultAddress);\n }\n\n /** \n A DAO can set a Vault as inactive \n */\n function deactivateVaultAsDao(\n uint256 id,\n address daoAddress\n ) external\n {\n require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], \"not DAO or delegate\");\n require(vaults[id].daoAddress == daoAddress && vaults[id].active,\"!not active DAO vault\");\n _setVault(id, false);\n }\n\n /** Allow a Dao to set a delegate that can manage vault enteries */\n function setDelegate(\n address daoAddress,\n address delegate\n ) external\n {\n require(msg.sender == daoAddress, \"!DAO\");\n delegates[daoAddress] = delegate;\n emit SetDelegate(daoAddress, delegate);\n }\n\n\n function _setVault(\n uint256 id, \n bool active\n ) internal \n {\n vaults[id].active = active;\n emit SetVault(vaults[id]);\n }\n\n function _setNewVault(\n string memory name,\n address daoAddress, \n address vaultAddress\n ) internal \n {\n vaultIdx += 1;\n vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);\n emit SetVault(vaults[vaultIdx]);\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IBaal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaal {\n function lootToken() external view returns (address);\n function sharesToken() external view returns (address);\n function votingPeriod() external view returns (uint32);\n function gracePeriod() external view returns (uint32);\n function proposalCount() external view returns (uint32);\n function proposalOffering() external view returns (uint256);\n function quorumPercent() external view returns (uint256);\n function sponsorThreshold() external view returns (uint256);\n function minRetentionPercent() external view returns (uint256);\n function latestSponsoredProposalId() external view returns (uint32);\n\n function setUp(bytes memory initializationParams) external;\n function multisendLibrary() external view returns (address);\n // Module\n function avatar() external view returns (address);\n function target() external view returns (address);\n function setAvatar(address avatar) external;\n function setTarget(address avatar) external;\n // BaseRelayRecipient\n function trustedForwarder() external view returns (address);\n function setTrustedForwarder(address trustedForwarderAddress) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n function totalLoot() external view returns (uint256);\n function totalShares() external view returns (uint256);\n function totalSupply() external view returns (uint256);\n function lootPaused() external view returns (bool);\n function sharesPaused() external view returns (bool);\n \n function shamans(address shaman) external view returns (uint256);\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\n function isAdmin(address shaman) external view returns (bool);\n function isManager(address shaman) external view returns (bool);\n function isGovernor(address shaman) external view returns (bool);\n function lockAdmin() external;\n function lockManager() external;\n function lockGovernor() external;\n function adminLock() external view returns (bool);\n function managerLock() external view returns (bool);\n function governorLock() external view returns (bool);\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n function setGovernanceConfig(bytes memory governanceConfig) external;\n\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable returns (uint256);\n function sponsorProposal(uint32 id) external;\n function processProposal(uint32 id, bytes calldata proposalData) external;\n function cancelProposal(uint32 id) external;\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\n function submitVote(uint32 id, bool approved) external;\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\n\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + }, + "contracts/LootERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract Loot is\n ERC20SnapshotUpgradeable,\n ERC20PermitUpgradeable,\n PausableUpgradeable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure loot - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"loot: name empty\");\n require(bytes(symbol_).length != 0, \"loot: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to pause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Baal-only function to mint loot.\n /// @param recipient Address to receive loot\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"loot: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn loot.\n /// @param account Address to lose loot\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `loot` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"loot: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/BaalLessToken.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../utils/BaalVotes.sol\";\nimport \"../interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract BaalLessShares is BaalVotes, OwnableUpgradeable, UUPSUpgradeable {\n // Baal Config\n IBaal public baal;\n uint8 public version;\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @param _version new version\n function setUp(uint8 _version)\n external\n reinitializer(_version)\n {\n baal = IBaal(address(0)); /*Configure Baal to setup sender*/\n version = _version;\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n\n /// @notice owner-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n unchecked {\n if (totalSupply() + amount <= type(uint256).max / 2) {\n _mint(recipient, amount);\n }\n }\n }\n\n /// @notice owner-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice new before transfer\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes) {\n super._beforeTokenTransfer(from, to, amount);\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/MockBaal.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\n\nimport \"../Baal.sol\";\n\ncontract MockBaal {\n bool public lootPaused;\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n\n constructor(\n address payable _lootSingleton,\n string memory _name,\n string memory _symbol\n ) {\n /*Clone loot singleton using EIP1167 minimal proxy pattern*/\n lootToken = IBaalToken(Clones.clone(_lootSingleton));\n lootToken.setUp(\n string(abi.encodePacked(_name, \" LOOT\")),\n string(abi.encodePacked(_symbol, \"-LOOT\"))\n );\n }\n\n function setLootPaused(bool paused) external {\n if(!lootToken.paused() && paused){\n lootToken.pause();\n } else if(lootToken.paused() && !paused){\n lootToken.unpause();\n }\n lootPaused = paused;\n }\n\n function mintLoot(address _to, uint256 _amount) external {\n lootToken.mint(_to, _amount);\n }\n\n function burnLoot(address _from, uint256 _amount) external {\n lootToken.burn(_from, _amount);\n }\n}\n" + }, + "contracts/mock/TestAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\ncontract Enum {\n enum Operation {\n Call,\n DelegateCall\n }\n}\n\ncontract TestAvatar {\n address public module;\n\n receive() external payable {}\n\n function enableModule(address _module) external {\n module = _module;\n }\n\n function disableModule(address, address) external {\n module = address(0);\n }\n\n function isModuleEnabled(address _module) external view returns (bool) {\n if (module == _module) {\n return true;\n } else {\n return false;\n }\n }\n\n function execTransactionFromModule(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, ) = to.call{value: value}(data);\n }\n\n function execTransactionFromModuleReturnData(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success, bytes memory returnData) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, returnData) = to.call{value: value}(data);\n }\n\n function getModulesPaginated(address, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next)\n {\n // Init array with max page size\n array = new address[](pageSize);\n\n array[0] = module;\n next = module;\n }\n}\n" + }, + "contracts/mock/TestERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\n/// @notice Basic ERC20 implementation.\ncontract TestERC20 {\n string public name;\n string public symbol;\n uint8 public constant decimals = 18;\n uint256 public totalSupply;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 amount);\n event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n constructor(string memory _name, string memory _symbol, uint256 _totalSupply) {\n name = _name;\n symbol = _symbol;\n totalSupply = _totalSupply;\n balanceOf[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function approve(address to, uint256 amount) external returns (bool) {\n allowance[msg.sender][to] = amount;\n emit Approval(msg.sender, to, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n balanceOf[msg.sender] -= amount;\n balanceOf[to] += amount;\n emit Transfer(msg.sender, to, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max)\n allowance[from][msg.sender] -= amount;\n\n balanceOf[from] -= amount;\n balanceOf[to] += amount;\n emit Transfer(from, to, amount);\n return true;\n }\n}\n" + }, + "contracts/SharesERC20.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\n\nimport \"./utils/BaalVotes.sol\";\nimport \"./interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"shares: name empty\");\n require(bytes(symbol_).length != 0, \"shares: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n __EIP712_init_delegation(\"delegation\", \"4\");\n\n\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to unpause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"shares: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"shares: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/tools/TributeMinion.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"../Baal.sol\";\n\ninterface IERC20 {\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n}\n\ncontract TributeMinion {\n event TributeProposal(\n address indexed baal,\n address token,\n uint256 amount,\n address recipient,\n uint256 proposalId\n );\n struct Escrow {\n address token;\n address applicant;\n uint256 amount;\n bool released;\n address safe;\n }\n mapping(address => mapping(uint256 => Escrow)) public escrows;\n\n event EscrowReleased(\n address indexed baal,\n uint32 proposalId,\n address applicant,\n address safe,\n uint256 amount\n );\n\n function encodeTributeProposal(\n address baal,\n uint256 shares,\n uint256 loot,\n address recipient,\n uint32 proposalId,\n address escrow\n ) public pure returns (bytes memory) {\n // Workaround for solidity dynamic memory array\n address[] memory _recipients = new address[](1);\n _recipients[0] = recipient;\n\n bytes memory _releaseEscrow = abi.encodeWithSignature(\n \"releaseEscrow(address,uint32)\",\n baal,\n proposalId\n );\n\n bytes memory tributeMultisend = abi.encodePacked(\n uint8(0),\n escrow,\n uint256(0),\n uint256(_releaseEscrow.length),\n bytes(_releaseEscrow)\n );\n\n if (shares > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _shares = new uint256[](1);\n _shares[0] = shares;\n\n bytes memory _issueShares = abi.encodeWithSignature(\n \"mintShares(address[],uint256[])\",\n _recipients,\n _shares\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n baal,\n uint256(0),\n uint256(_issueShares.length),\n bytes(_issueShares)\n );\n }\n if (loot > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _loot = new uint256[](1);\n _loot[0] = loot;\n\n bytes memory _issueLoot = abi.encodeWithSignature(\n \"mintLoot(address[],uint256[])\",\n _recipients,\n _loot\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n address(baal),\n uint256(0),\n uint256(_issueLoot.length),\n bytes(_issueLoot)\n );\n }\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n tributeMultisend\n );\n return _multisendAction;\n }\n\n function submitTributeProposal(\n Baal baal,\n address token,\n uint256 amount,\n uint256 shares,\n uint256 loot,\n uint32 expiration,\n uint256 baalgas,\n string memory details\n ) external payable {\n uint32 proposalId = baal.proposalCount() + 1;\n\n bytes memory encodedProposal = encodeTributeProposal(\n address(baal),\n shares,\n loot,\n msg.sender,\n proposalId,\n address(this)\n );\n\n escrows[address(baal)][proposalId] = Escrow(\n token,\n msg.sender,\n amount,\n false,\n baal.target()\n );\n\n baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);\n\n emit TributeProposal(\n address(baal),\n token,\n amount,\n msg.sender,\n proposalId\n );\n }\n\n function releaseEscrow(address _baal, uint32 _proposalId) external {\n Baal baal = Baal(_baal);\n Escrow storage escrow = escrows[address(baal)][_proposalId];\n require(!escrow.released, \"Already released\");\n\n bool[4] memory status = baal.getProposalStatus(_proposalId);\n require(status[2], \"Not passed\");\n escrow.released = true;\n\n IERC20 token = IERC20(escrow.token);\n\n emit EscrowReleased(\n _baal,\n _proposalId,\n escrow.applicant,\n escrow.safe,\n escrow.amount\n );\n\n require(\n token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),\n \"Transfer failed\"\n );\n }\n}\n" + }, + "contracts/utils/BaalVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"./DelegationEIP712Upgradeable.sol\";\n\n/**\n * @dev similar to Openzeplin ERC20Votes\n *\n * uses timestamp instead of block.number and auto self delegates.\n *\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\n * power can be queried through the public accessors {getPriorVotes}.\n *\n */\nabstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {\n using ECDSAUpgradeable for bytes32;\n\n struct Checkpoint {\n /*Baal checkpoint for marking number of delegated votes*/\n uint32 fromTimePoint; /*unix time for referencing voting balance*/\n uint256 votes; /*votes at given unix time*/\n }\n\n // DELEGATE TRACKING\n mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/\n mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/\n mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/\n mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/\n\n // SIGNATURE HELPERS\n bytes32 constant DELEGATION_TYPEHASH = keccak256(\"Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)\");\n\n event DelegateChanged(\n address indexed delegator,\n address indexed fromDelegate,\n address indexed toDelegate\n ); /*emits when an account changes its voting delegate*/\n event DelegateVotesChanged(\n address indexed delegate,\n uint256 previousBalance,\n uint256 newBalance\n ); /*emits when a delegate account's voting balance changes*/\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n /*If recipient is receiving their first shares, auto-self delegate*/\n if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {\n delegates[to] = to;\n }\n\n _moveDelegates(delegates[from], delegates[to], amount);\n }\n\n /// @notice Delegate votes from user to `delegatee`.\n /// @param delegatee The address to delegate votes to.\n function delegate(address delegatee) external virtual {\n _delegate(msg.sender, delegatee);\n }\n\n /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.\n /// @param delegatee The address to delegate 'votes' to.\n /// @param nonce The contract state required to match the signature.\n /// @param expiry The time at which to expire the signature.\n /// @param v The v signature\n /// @param r The r signature\n /// @param s The s signature\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public {\n require(now() <= expiry, \"ERC20Votes: signature expired\");\n address signer = ECDSAUpgradeable.recover(\n _hashTypedDataV4Delegation(\n keccak256(\n abi.encode(\n DELEGATION_TYPEHASH,\n keccak256(abi.encodePacked(name())),\n delegatee,\n nonce,\n expiry\n )\n )\n ),\n v,\n r,\n s\n );\n require(signer != address(0), \"ERC20Votes: invalid signer (0x0)\");\n require(nonce == delegationNonces[signer], \"ERC20Votes: invalid nonce\");\n\n delegationNonces[signer]++;\n _delegate(signer, delegatee);\n }\n\n /// @notice Delegates Baal voting weight.\n /// @param delegator The address to delegate 'votes' from.\n /// @param delegatee The address to delegate 'votes' to.\n function _delegate(address delegator, address delegatee) internal virtual {\n require(balanceOf(delegator) > 0, \"!shares\");\n address currentDelegate = delegates[delegator];\n delegates[delegator] = delegatee;\n\n _moveDelegates(\n currentDelegate,\n delegatee,\n uint256(balanceOf(delegator))\n );\n\n emit DelegateChanged(delegator, currentDelegate, delegatee);\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param srcRep The address to delegate 'votes' from.\n /// @param dstRep The address to delegate 'votes' to.\n /// @param amount The amount of votes to delegate\n function _moveDelegates(\n address srcRep,\n address dstRep,\n uint256 amount\n ) private {\n unchecked {\n if (srcRep != dstRep && amount != 0) {\n if (srcRep != address(0)) {\n uint256 srcRepNum = numCheckpoints[srcRep];\n uint256 srcRepOld = srcRepNum != 0\n ? getCheckpoint(srcRep, srcRepNum - 1).votes\n : 0;\n uint256 srcRepNew = srcRepOld - amount;\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\n }\n\n if (dstRep != address(0)) {\n uint256 dstRepNum = numCheckpoints[dstRep];\n uint256 dstRepOld = dstRepNum != 0\n ? getCheckpoint(dstRep, dstRepNum - 1).votes\n : 0;\n uint256 dstRepNew = dstRepOld + amount;\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\n }\n }\n }\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param delegatee The address to snapshot\n /// @param nCheckpoints The number of checkpoints delegatee has\n /// @param oldVotes The number of votes the delegatee had\n /// @param newVotes The number of votes the delegate has now\n function _writeCheckpoint(\n address delegatee,\n uint256 nCheckpoints,\n uint256 oldVotes,\n uint256 newVotes\n ) private {\n uint32 timePoint = uint32(now());\n\n unchecked {\n if (\n nCheckpoints != 0 &&\n checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint\n ) {\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\n } else {\n checkpoints[delegatee][nCheckpoints] = Checkpoint(\n timePoint,\n newVotes\n );\n numCheckpoints[delegatee] = nCheckpoints + 1;\n }\n }\n\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\n }\n\n /// @notice Returns the current timepoint.\n /// @return timePoint returns unix epoch timestamp\n function now() public view returns (uint256 timePoint) {\n return block.timestamp;\n }\n\n /// @notice Returns the prior number of `votes` for `account` as of `timePoint`.\n /// @param account The user to check `votes` for.\n /// @param timePoint The unix time to check `votes` for.\n /// @return votes Past `votes` delegated to `account`.\n function getPastVotes(address account, uint256 timePoint)\n external\n view\n virtual\n returns (uint256 votes)\n {\n require(timePoint < now(), \"!determined\"); /* Prior votes must be in the past*/\n\n uint256 nCheckpoints = numCheckpoints[account];\n if (nCheckpoints == 0) return 0;\n\n unchecked {\n if (\n getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=\n timePoint\n ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/\n if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;\n uint256 lower = 0;\n uint256 upper = nCheckpoints - 1;\n while (upper > lower) {\n /* Binary search to look for highest timePoint before desired timePoint*/\n uint256 center = upper - (upper - lower) / 2;\n Checkpoint memory cp = getCheckpoint(account, center);\n if (cp.fromTimePoint == timePoint) return cp.votes;\n else if (cp.fromTimePoint < timePoint) lower = center;\n else upper = center - 1;\n }\n votes = getCheckpoint(account, lower).votes;\n }\n }\n\n /// @notice Returns the current delegated `vote` balance for `account`.\n /// @param account The user to check delegated `votes` for.\n /// @return votes Current `votes` delegated to `account`.\n function getVotes(address account)\n external\n view\n virtual\n returns (uint256 votes)\n {\n uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/\n unchecked {\n votes = nCheckpoints != 0\n ? getCheckpoint(account, nCheckpoints - 1).votes\n : 0;\n }\n }\n\n function getCheckpoint(address delegatee, uint256 nCheckpoints)\n public\n view\n virtual\n returns (Checkpoint memory)\n {\n return checkpoints[delegatee][nCheckpoints];\n }\n}\n" + }, + "contracts/utils/DelegationEIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4Delegation}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract DelegationEIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME_DELEGATION;\n bytes32 private _HASHED_VERSION_DELEGATION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained_delegation(name, version);\n }\n\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME_DELEGATION = hashedName;\n _HASHED_VERSION_DELEGATION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\n }\n\n function _buildDomainSeparatorDelegation(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_NAME_DELEGATION;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_VERSION_DELEGATION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "contracts/utils/Poster.sol": { + "content": "/*\n██████╗ ██████╗ ███████╗████████╗███████╗██████╗\n██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗\n██████╔╝██║ ██║███████╗ ██║ █████╗ ██████╔╝\n██╔═══╝ ██║ ██║╚════██║ ██║ ██╔══╝ ██╔══██╗\n██║ ╚██████╔╝███████║ ██║ ███████╗██║ ██║\n╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝\nA ridiculously simple general purpose social media smart contract.\nIt takes two strings (content and tag) as parameters and emits those strings, along with msg.sender, as an event. That's it.\nMade with ❤️ by Auryn.eth\n*/\n// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity 0.8.7;\n\ncontract Poster {\n event NewPost(address indexed user, string content, string indexed tag);\n\n function post(string calldata content, string calldata tag) external {\n emit NewPost(msg.sender, content, tag);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/.chainId b/lib/Baal/deployments/gnosis/.chainId new file mode 100644 index 0000000..105d7d9 --- /dev/null +++ b/lib/Baal/deployments/gnosis/.chainId @@ -0,0 +1 @@ +100 \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/Baal.json b/lib/Baal/deployments/gnosis/Baal.json new file mode 100644 index 0000000..dd56eb2 --- /dev/null +++ b/lib/Baal/deployments/gnosis/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x5DcE1044A7E2E35D6524001796cee47252f18411", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner.json b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..53e7202 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner.json @@ -0,0 +1,330 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..92bcfd7 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,262 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..1fd3615 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAndVaultSummoner.json b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner.json new file mode 100644 index 0000000..32ea289 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..86492b1 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x882881c5A49A71C31B6956b06AF8C7a33AF1cdD6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..dc73832 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalSummoner.json b/lib/Baal/deployments/gnosis/BaalSummoner.json new file mode 100644 index 0000000..6f63d4f --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalSummoner_Implementation.json b/lib/Baal/deployments/gnosis/BaalSummoner_Implementation.json new file mode 100644 index 0000000..ab77504 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0x00BD22D2cE75422E7B16351F72524174672D5D64", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/BaalSummoner_Proxy.json b/lib/Baal/deployments/gnosis/BaalSummoner_Proxy.json new file mode 100644 index 0000000..bf871e0 --- /dev/null +++ b/lib/Baal/deployments/gnosis/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/Loot.json b/lib/Baal/deployments/gnosis/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/gnosis/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/Poster.json b/lib/Baal/deployments/gnosis/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/gnosis/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/Shares.json b/lib/Baal/deployments/gnosis/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/gnosis/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/gnosis/TributeMinion.json b/lib/Baal/deployments/gnosis/TributeMinion.json new file mode 100644 index 0000000..34e6b6b --- /dev/null +++ b/lib/Baal/deployments/gnosis/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/.chainId b/lib/Baal/deployments/goerli/.chainId new file mode 100644 index 0000000..7813681 --- /dev/null +++ b/lib/Baal/deployments/goerli/.chainId @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/Baal.json b/lib/Baal/deployments/goerli/Baal.json new file mode 100644 index 0000000..dd56eb2 --- /dev/null +++ b/lib/Baal/deployments/goerli/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x5DcE1044A7E2E35D6524001796cee47252f18411", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAdvTokenSummoner.json b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..7a58688 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner.json @@ -0,0 +1,330 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..dcbc906 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,262 @@ +{ + "address": "0x72EFe2AE3382779E9F22f95574b736cb2AFF37C6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..a4cf431 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAndVaultSummoner.json b/lib/Baal/deployments/goerli/BaalAndVaultSummoner.json new file mode 100644 index 0000000..32ea289 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..759b903 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x5AacdE1c0F29EE9276037ed59f39124c32F0E3e2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..dc73832 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalSummoner.json b/lib/Baal/deployments/goerli/BaalSummoner.json new file mode 100644 index 0000000..508e924 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalSummoner.json @@ -0,0 +1,809 @@ +{ + "address": "0x5425451EfEAA5479D0Fc8C1Bb8210F43c7e8f2B6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x5afa96e18999b2528896e2ade9a6a5d47613cd2dd1de3e4ed98257c1041ca386", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0x5425451EfEAA5479D0Fc8C1Bb8210F43c7e8f2B6", + "transactionIndex": 17, + "gasUsed": "2615801", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc89df658ea941c5ee164e9d03f49b7652280da36f6bef0ee9f7d5349eb9900dd", + "transactionHash": "0x5afa96e18999b2528896e2ade9a6a5d47613cd2dd1de3e4ed98257c1041ca386", + "logs": [], + "blockNumber": 10348705, + "cumulativeGasUsed": "3957496", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "b52e66b4cd1dc0db61ba3c32479c6962", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"}],\"name\":\"DaoReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"baalSafe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"moduleAddr\",\"type\":\"address\"}],\"name\":\"DeployBaalSafe\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"SetAddrsVersion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loot\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"shares\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"existingAddrs\",\"type\":\"uint256\"}],\"name\":\"SummonBaal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addrsVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_moduleAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"deployAndSetupSafe\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_moduleAddr\",\"type\":\"address\"}],\"name\":\"deployAndSetupSafe\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"name\":\"deployTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_calls\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"encodeMultisend\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedMultisend\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisFallbackLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisMultisendLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lootSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_template\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisFallbackLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisMultisendLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSafeProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_moduleProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_lootSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sharesSingleton\",\"type\":\"address\"}],\"name\":\"setAddrs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharesSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"summonBaal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"template\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/BaalSummoner.sol\":\"BaalSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/BaalSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"./Baal.sol\\\";\\n\\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\\n // when some of the init addresses are updated\\n uint256 public addrsVersion;\\n\\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\\n\\n // Template contract to use for new Gnosis safe proxies\\n address public gnosisSingleton;\\n\\n // Library to use for EIP1271 compatability\\n address public gnosisFallbackLibrary;\\n\\n // Library to use for all safe transaction executions\\n address public gnosisMultisendLibrary;\\n\\n // template contract to clone for loot ERC20 token\\n address public lootSingleton;\\n\\n // template contract to clone for shares ERC20 token\\n address public sharesSingleton;\\n\\n // Proxy summoners\\n //\\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\\n ModuleProxyFactory moduleProxyFactory;\\n\\n event SetAddrsVersion(\\n uint256 version\\n );\\n\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n\\n event DaoReferral(\\n bytes32 referrer,\\n address daoAddress\\n );\\n\\n event DeployBaalTokens(\\n address lootToken, \\n address sharesToken\\n );\\n\\n event DeployBaalSafe(\\n address baalSafe,\\n address moduleAddr\\n );\\n\\n function initialize() initializer public {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n // must be called after deploy to set libraries\\n function setAddrs(\\n address payable _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) public onlyOwner {\\n require(_lootSingleton != address(0), \\\"!lootSingleton\\\");\\n require(_sharesSingleton != address(0), \\\"!sharesSingleton\\\");\\n require(_gnosisSingleton != address(0), \\\"!gnosisSingleton\\\");\\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\\n\\n template = _template;\\n gnosisSingleton = _gnosisSingleton;\\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\\n lootSingleton = _lootSingleton;\\n sharesSingleton = _sharesSingleton;\\n\\n emit SetAddrsVersion(\\n addrsVersion++\\n );\\n \\n }\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n public\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n function summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) external returns (address) {\\n \\n return\\n _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n }\\n\\n // Add a referrer to help keep track of where deploies are coming from\\n function summonBaalFromReferrer(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address) {\\n address daoAddress;\\n\\n daoAddress = _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n\\n emit DaoReferral(referrer, daoAddress);\\n return daoAddress;\\n }\\n\\n // deploy new share and loot contracts\\n function deployTokens(string memory _name, string memory _symbol) \\n public \\n returns (address lootToken, address sharesToken) \\n {\\n lootToken = address(new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector, \\n string(abi.encodePacked(_name, \\\" LOOT\\\")), \\n string(abi.encodePacked(_symbol, \\\"-LOOT\\\")))\\n ));\\n\\n sharesToken = address(new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector, \\n _name, \\n _symbol)\\n ));\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n\\n }\\n\\n function configureSafe(address _moduleAddr, GnosisSafe _safe) internal {\\n // Generate delegate calls so the safe calls enableModule on itself during setup\\n bytes memory _enableBaal = abi.encodeWithSignature(\\n \\\"enableModule(address)\\\",\\n address(_moduleAddr)\\n );\\n bytes memory _enableBaalMultisend = abi.encodePacked(\\n uint8(0),\\n address(_safe),\\n uint256(0),\\n uint256(_enableBaal.length),\\n bytes(_enableBaal)\\n );\\n\\n bytes memory _multisendAction = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n _enableBaalMultisend\\n );\\n\\n // Workaround for solidity dynamic memory array\\n address[] memory _owners = new address[](1);\\n _owners[0] = address(_moduleAddr);\\n\\n // Call setup on safe to enable our new module and set the module as the only signer\\n _safe.setup(\\n _owners,\\n 1,\\n gnosisMultisendLibrary,\\n _multisendAction,\\n gnosisFallbackLibrary,\\n address(0),\\n 0,\\n payable(address(0))\\n );\\n }\\n\\n\\n // deploy a safe with module and single module signer setup\\n // with nounce\\n function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce)\\n public\\n returns (address)\\n {\\n GnosisSafe _safe = GnosisSafe(\\n payable(\\n gnosisSafeProxyFactory.createProxyWithNonce(\\n gnosisSingleton,\\n bytes(\\\"\\\"),\\n _saltNonce\\n )\\n )\\n );\\n \\n configureSafe(_moduleAddr, _safe);\\n\\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\\n\\n return address(_safe);\\n }\\n\\n\\n // deploy a safe with module and single module signer setup\\n function deployAndSetupSafe(address _moduleAddr)\\n public\\n returns (address)\\n {\\n GnosisSafe _safe = GnosisSafe(\\n payable(\\n gnosisSafeProxyFactory.createProxy(\\n gnosisSingleton,\\n bytes(\\\"\\\")\\n )\\n )\\n );\\n\\n configureSafe(_moduleAddr, _safe);\\n\\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\\n\\n return address(_safe);\\n }\\n\\n // advanced summon baal with different configurations\\n // name and symbol can be blank if bringing own baal tokens\\n // zero address for either loot or shares token will summon new ones\\n // if bringing own tokens the ownership must be transfered to the new DAO\\n // zero address for Safe with summon and setup a new Safe\\n // if bringing existing safe the new dao must be enabled as a module\\n // todo: add a simple summon that just creates a dao with a single summoner\\n function _summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) internal returns (address) {\\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\\n (\\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\\n address _safeAddr, /*address of safe, 0 addr if new*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\\n address _lootToken, /*predeployed loot token, 0 addr if new*/\\n address _sharesToken /*predeployed shares token, 0 addr if new*/\\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\\n\\n Baal _baal = Baal(\\n moduleProxyFactory.deployModule(\\n template, \\n abi.encodeWithSignature(\\\"avatar()\\\"), \\n _saltNonce\\n )\\n );\\n\\n // if loot or shares are zero address new tokens are deployed\\n // tokens need to be baalTokens\\n if(_lootToken == address(0) || _sharesToken == address(0)){\\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\\n // pause tokens by default and transfer to the DAO\\n IBaalToken(_lootToken).pause();\\n IBaalToken(_sharesToken).pause();\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n } else {\\n existingAddrs += 1;\\n }\\n\\n // if zero address deploy a new safe\\n // Needs to be a valid zodiac treasury\\n if(_safeAddr == address(0)){\\n _safeAddr = deployAndSetupSafe(address(_baal), _saltNonce);\\n } else {\\n existingAddrs += 2;\\n }\\n\\n bytes memory _initializationMultisendData = encodeMultisend(\\n initializationActions,\\n address(_baal)\\n );\\n bytes memory _initializer = abi.encode(\\n _lootToken,\\n _sharesToken,\\n gnosisMultisendLibrary,\\n _safeAddr,\\n _forwarder,\\n _initializationMultisendData\\n );\\n // can run the actions now because we have a baal\\n _baal.setUp(_initializer);\\n\\n emit SummonBaal(\\n address(_baal),\\n address(_baal.lootToken()),\\n address(_baal.sharesToken()),\\n _safeAddr,\\n _forwarder,\\n existingAddrs\\n );\\n\\n return (address(_baal));\\n }\\n\\n function _authorizeUpgrade(address newImplementation)\\n internal\\n onlyOwner\\n override\\n {}\\n}\\n\",\"keccak256\":\"0x05bae09e32f349455ae2647acce500f0a87aa0fd88c3ef2ffa4455bcfd8710d2\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b50608051612e7961004c600039600081816104b401528181610500015281816105c40152818161060701526106a30152612e796000f3fe608060405260043610620001435760003560e01c8063881e4ea411620000b9578063d9118ce71162000078578063d9118ce71462000370578063ebfb8a431462000392578063f0fa28b914620003b7578063f2fde38b14620003d9578063f413f27414620003fe578063f884231c146200042357600080fd5b8063881e4ea414620002925780638da5cb5b14620002b457806397fc9fbb14620002d4578063a2346618146200031a578063d61f27ae146200033c57600080fd5b80634f1ef28611620001065780634f1ef286146200021157806352d1902d14620002285780636f2ddd931462000240578063715018a614620002625780638129fc1c146200027a57600080fd5b8063209f3695146200014857806321d56a43146200017c57806323626b45146200019e5780633659cfe614620001c55780634a8b0b3214620001ec575b600080fd5b6200015f6200015936600462001c97565b62000448565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200018957600080fd5b5060cb546200015f906001600160a01b031681565b348015620001ab57600080fd5b50620001b660c95481565b60405190815260200162000173565b348015620001d257600080fd5b50620001ea620001e436600462001d32565b620004a9565b005b348015620001f957600080fd5b506200015f6200020b36600462001d52565b6200059e565b620001ea6200022236600462001e8e565b620005b9565b3480156200023557600080fd5b50620001b662000696565b3480156200024d57600080fd5b5060ca546200015f906001600160a01b031681565b3480156200026f57600080fd5b50620001ea6200074c565b3480156200028757600080fd5b50620001ea62000764565b3480156200029f57600080fd5b5060cd546200015f906001600160a01b031681565b348015620002c157600080fd5b506033546001600160a01b03166200015f565b348015620002e157600080fd5b50620002f9620002f336600462001ee4565b62000887565b604080516001600160a01b0393841681529290911660208301520162000173565b3480156200032757600080fd5b5060cf546200015f906001600160a01b031681565b3480156200034957600080fd5b50620003616200035b36600462001fd5565b62000a48565b6040516200017391906200209f565b3480156200037d57600080fd5b5060ce546200015f906001600160a01b031681565b3480156200039f57600080fd5b50620001ea620003b1366004620020b4565b62000b1d565b348015620003c457600080fd5b5060cc546200015f906001600160a01b031681565b348015620003e657600080fd5b50620001ea620003f836600462001d32565b62000e21565b3480156200040b57600080fd5b506200015f6200041d3660046200216e565b62000e9d565b3480156200043057600080fd5b506200015f6200044236600462001d32565b62000f87565b6000806200045a88888888886200106e565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004fe5760405162461bcd60e51b8152600401620004f5906200219d565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200054960008051602062002dfd833981519152546001600160a01b031690565b6001600160a01b031614620005725760405162461bcd60e51b8152600401620004f590620021e9565b6200057d816200154f565b604080516000808252602082019092526200059b9183919062001559565b50565b6000620005af86868686866200106e565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006055760405162461bcd60e51b8152600401620004f5906200219d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200065060008051602062002dfd833981519152546001600160a01b031690565b6001600160a01b031614620006795760405162461bcd60e51b8152600401620004f590620021e9565b62000684826200154f565b620006928282600162001559565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007385760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004f5565b5060008051602062002dfd83398151915290565b62000756620016d6565b62000762600062001732565b565b600054610100900460ff1615808015620007855750600054600160ff909116105b80620007a15750303b158015620007a1575060005460ff166001145b620008065760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004f5565b6000805460ff1916600117905580156200082a576000805461ff0019166101001790555b6200083462001784565b6200083e620017b8565b80156200059b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b90620008b790879060200162002235565b60405160208183030381529060405285604051602001620008d9919062002260565b60408051601f1981840301815290829052620008f992916024016200228b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009389062001bf5565b62000945929190620022b4565b604051809103906000f08015801562000962573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b906200099190879087906024016200228b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009d09062001bf5565b620009dd929190620022b4565b604051809103906000f080158015620009fa573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000ad75781600085600088858151811062000a735762000a73620022e2565b60200260200101515189868151811062000a915762000a91620022e2565b602002602001015160405160200162000ab096959493929190620022f8565b6040516020818303038152906040529150808062000ace906200237c565b91505062000a4e565b508060405160240162000aeb91906200209f565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000b27620016d6565b6001600160a01b03821662000b705760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004f5565b6001600160a01b03811662000bbb5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004f5565b6001600160a01b03871662000c065760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004f5565b6001600160a01b03861662000c575760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004f5565b6001600160a01b03851662000caf5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004f5565b6001600160a01b03841662000d075760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004f5565b6001600160a01b03831662000d555760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004f5565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000e02836200237c565b9091555060405190815260200160405180910390a15050505050505050565b62000e2b620016d6565b6001600160a01b03811662000e925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004f5565b6200059b8162001732565b60d05460cb546040805160208101825260008082529151631688f0b960e01b8152919384936001600160a01b0391821693631688f0b99362000ee993909216919088906004016200239a565b6020604051808303816000875af115801562000f09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f2f9190620023d0565b905062000f3d8482620017e2565b604080516001600160a01b038084168252861660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0910160405180910390a19392505050565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000fd1939092169190600401620022b4565b6020604051808303816000875af115801562000ff1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010179190620023d0565b9050620010258382620017e2565b604080516001600160a01b038084168252851660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0910160405180910390a192915050565b600080808080808080620010858c8e018e620023f0565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b81526004016200112e939291906200239a565b6020604051808303816000875af11580156200114e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011749190620023d0565b90506001600160a01b03831615806200119457506001600160a01b038216155b156200131857620011a6878762000887565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620011ea57600080fd5b505af1158015620011ff573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200123f57600080fd5b505af115801562001254573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b1580156200129c57600080fd5b505af1158015620012b1573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620012f957600080fd5b505af11580156200130e573d6000803e3d6000fd5b5050505062001328565b62001325600189620024ae565b97505b6001600160a01b0385166200134b5762001343818b62000e9d565b94506200135b565b62001358600289620024ae565b97505b6000620013746200136d8d8f620024c9565b8362000a48565b60cd54604051919250600091620013a291879187916001600160a01b0316908b908b908890602001620024d8565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf90620013e09084906004016200209f565b600060405180830381600087803b158015620013fb57600080fd5b505af115801562001410573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001453573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014799190620023d0565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014e79190620023d0565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200059b620016d6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562001594576200158f8362001960565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620015f1575060408051601f3d908101601f19168201909252620015ee918101906200252a565b60015b620016565760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004f5565b60008051602062002dfd8339815191528114620016c85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004f5565b506200158f838383620019ff565b6033546001600160a01b03163314620007625760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004f5565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620017ae5760405162461bcd60e51b8152600401620004f59062002544565b6200076262001a30565b600054610100900460ff16620007625760405162461bcd60e51b8152600401620004f59062002544565b6040516001600160a01b038316602482015260009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b179052825191519293506000926200184492849287928492918891016200258f565b60405160208183030381529060405290506000816040516024016200186a91906200209f565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b17905281516001808252818401909352929350600092919082810190803683370190505090508581600081518110620018cf57620018cf620022e2565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001924938793600193928316928a92169060009081908190600401620025e7565b600060405180830381600087803b1580156200193f57600080fd5b505af115801562001954573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b0381163b620019cf5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004f5565b60008051602062002dfd83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b62001a0a8362001a65565b60008251118062001a185750805b156200158f5762001a2a838362001aa7565b50505050565b600054610100900460ff1662001a5a5760405162461bcd60e51b8152600401620004f59062002544565b620007623362001732565b62001a708162001960565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b62001b115760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004f5565b600080846001600160a01b03168460405162001b2e9190620026a9565b600060405180830381855af49150503d806000811462001b6b576040519150601f19603f3d011682016040523d82523d6000602084013e62001b70565b606091505b509150915062001b9b828260405180606001604052806027815260200162002e1d6027913962001ba4565b95945050505050565b6060831562001bb557508162001bc1565b62001bc1838362001bc8565b9392505050565b81511562001bd95781518083602001fd5b8060405162461bcd60e51b8152600401620004f591906200209f565b61073580620026c883390190565b60008083601f84011262001c1657600080fd5b50813567ffffffffffffffff81111562001c2f57600080fd5b60208301915083602082850101111562001c4857600080fd5b9250929050565b60008083601f84011262001c6257600080fd5b50813567ffffffffffffffff81111562001c7b57600080fd5b6020830191508360208260051b850101111562001c4857600080fd5b6000806000806000806080878903121562001cb157600080fd5b863567ffffffffffffffff8082111562001cca57600080fd5b62001cd88a838b0162001c03565b9098509650602089013591508082111562001cf257600080fd5b5062001d0189828a0162001c4f565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200059b57600080fd5b60006020828403121562001d4557600080fd5b813562001bc18162001d1c565b60008060008060006060868803121562001d6b57600080fd5b853567ffffffffffffffff8082111562001d8457600080fd5b62001d9289838a0162001c03565b9097509550602088013591508082111562001dac57600080fd5b5062001dbb8882890162001c4f565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001e0f5762001e0f62001dcd565b604052919050565b600082601f83011262001e2957600080fd5b813567ffffffffffffffff81111562001e465762001e4662001dcd565b62001e5b601f8201601f191660200162001de3565b81815284602083860101111562001e7157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001ea257600080fd5b823562001eaf8162001d1c565b9150602083013567ffffffffffffffff81111562001ecc57600080fd5b62001eda8582860162001e17565b9150509250929050565b6000806040838503121562001ef857600080fd5b823567ffffffffffffffff8082111562001f1157600080fd5b62001f1f8683870162001e17565b9350602085013591508082111562001f3657600080fd5b5062001eda8582860162001e17565b600067ffffffffffffffff8084111562001f635762001f6362001dcd565b8360051b602062001f7681830162001de3565b8681529350908401908084018783111562001f9057600080fd5b855b8381101562001fc95780358581111562001fac5760008081fd5b62001fba8a828a0162001e17565b83525090820190820162001f92565b50505050509392505050565b6000806040838503121562001fe957600080fd5b823567ffffffffffffffff8111156200200157600080fd5b8301601f810185136200201357600080fd5b620020248582356020840162001f45565b9250506020830135620020378162001d1c565b809150509250929050565b60005b838110156200205f57818101518382015260200162002045565b8381111562001a2a5750506000910152565b600081518084526200208b81602086016020860162002042565b601f01601f19169290920160200192915050565b60208152600062001bc1602083018462002071565b600080600080600080600080610100898b031215620020d257600080fd5b8835620020df8162001d1c565b97506020890135620020f18162001d1c565b96506040890135620021038162001d1c565b95506060890135620021158162001d1c565b94506080890135620021278162001d1c565b935060a0890135620021398162001d1c565b925060c08901356200214b8162001d1c565b915060e08901356200215d8162001d1c565b809150509295985092959890939650565b600080604083850312156200218257600080fd5b82356200218f8162001d1c565b946020939093013593505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b600082516200224981846020870162002042565b64081313d3d560da1b920191825250600501919050565b600082516200227481846020870162002042565b640b5313d3d560da1b920191825250600501919050565b604081526000620022a0604083018562002071565b828103602084015262001b9b818562002071565b6001600160a01b0383168152604060208201819052600090620022da9083018462002071565b949350505050565b634e487b7160e01b600052603260045260246000fd5b600087516200230c818460208c0162002042565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b16600182015285601582015284603582015283516200235681605584016020880162002042565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982141562002393576200239362002366565b5060010190565b6001600160a01b0384168152606060208201819052600090620023c09083018562002071565b9050826040830152949350505050565b600060208284031215620023e357600080fd5b815162001bc18162001d1c565b60008060008060008060c087890312156200240a57600080fd5b863567ffffffffffffffff808211156200242357600080fd5b620024318a838b0162001e17565b975060208901359150808211156200244857600080fd5b506200245789828a0162001e17565b95505060408701356200246a8162001d1c565b935060608701356200247c8162001d1c565b925060808701356200248e8162001d1c565b915060a0870135620024a08162001d1c565b809150509295509295509295565b60008219821115620024c457620024c462002366565b500190565b600062001bc136848462001f45565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a082018190526000906200251e9083018462002071565b98975050505050505050565b6000602082840312156200253d57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620025d681605585016020870162002042565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b828110156200262d5781516001600160a01b03168552938301939083019060010162002606565b50505083018a90526001600160a01b0389166040840152828103606084015262002658818962002071565b9150506200267160808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200269c60e08301846001600160a01b03169052565b9998505050505050505050565b60008251620026bd81846020870162002042565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206aaea425347cbdf2ce219d869c1f46746ae0464d3865d54db4da12977981076f64736f6c634300080a0033", + "deployedBytecode": "0x608060405260043610620001435760003560e01c8063881e4ea411620000b9578063d9118ce71162000078578063d9118ce71462000370578063ebfb8a431462000392578063f0fa28b914620003b7578063f2fde38b14620003d9578063f413f27414620003fe578063f884231c146200042357600080fd5b8063881e4ea414620002925780638da5cb5b14620002b457806397fc9fbb14620002d4578063a2346618146200031a578063d61f27ae146200033c57600080fd5b80634f1ef28611620001065780634f1ef286146200021157806352d1902d14620002285780636f2ddd931462000240578063715018a614620002625780638129fc1c146200027a57600080fd5b8063209f3695146200014857806321d56a43146200017c57806323626b45146200019e5780633659cfe614620001c55780634a8b0b3214620001ec575b600080fd5b6200015f6200015936600462001c97565b62000448565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200018957600080fd5b5060cb546200015f906001600160a01b031681565b348015620001ab57600080fd5b50620001b660c95481565b60405190815260200162000173565b348015620001d257600080fd5b50620001ea620001e436600462001d32565b620004a9565b005b348015620001f957600080fd5b506200015f6200020b36600462001d52565b6200059e565b620001ea6200022236600462001e8e565b620005b9565b3480156200023557600080fd5b50620001b662000696565b3480156200024d57600080fd5b5060ca546200015f906001600160a01b031681565b3480156200026f57600080fd5b50620001ea6200074c565b3480156200028757600080fd5b50620001ea62000764565b3480156200029f57600080fd5b5060cd546200015f906001600160a01b031681565b348015620002c157600080fd5b506033546001600160a01b03166200015f565b348015620002e157600080fd5b50620002f9620002f336600462001ee4565b62000887565b604080516001600160a01b0393841681529290911660208301520162000173565b3480156200032757600080fd5b5060cf546200015f906001600160a01b031681565b3480156200034957600080fd5b50620003616200035b36600462001fd5565b62000a48565b6040516200017391906200209f565b3480156200037d57600080fd5b5060ce546200015f906001600160a01b031681565b3480156200039f57600080fd5b50620001ea620003b1366004620020b4565b62000b1d565b348015620003c457600080fd5b5060cc546200015f906001600160a01b031681565b348015620003e657600080fd5b50620001ea620003f836600462001d32565b62000e21565b3480156200040b57600080fd5b506200015f6200041d3660046200216e565b62000e9d565b3480156200043057600080fd5b506200015f6200044236600462001d32565b62000f87565b6000806200045a88888888886200106e565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004fe5760405162461bcd60e51b8152600401620004f5906200219d565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200054960008051602062002dfd833981519152546001600160a01b031690565b6001600160a01b031614620005725760405162461bcd60e51b8152600401620004f590620021e9565b6200057d816200154f565b604080516000808252602082019092526200059b9183919062001559565b50565b6000620005af86868686866200106e565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006055760405162461bcd60e51b8152600401620004f5906200219d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200065060008051602062002dfd833981519152546001600160a01b031690565b6001600160a01b031614620006795760405162461bcd60e51b8152600401620004f590620021e9565b62000684826200154f565b620006928282600162001559565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007385760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004f5565b5060008051602062002dfd83398151915290565b62000756620016d6565b62000762600062001732565b565b600054610100900460ff1615808015620007855750600054600160ff909116105b80620007a15750303b158015620007a1575060005460ff166001145b620008065760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004f5565b6000805460ff1916600117905580156200082a576000805461ff0019166101001790555b6200083462001784565b6200083e620017b8565b80156200059b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b90620008b790879060200162002235565b60405160208183030381529060405285604051602001620008d9919062002260565b60408051601f1981840301815290829052620008f992916024016200228b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009389062001bf5565b62000945929190620022b4565b604051809103906000f08015801562000962573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b906200099190879087906024016200228b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009d09062001bf5565b620009dd929190620022b4565b604051809103906000f080158015620009fa573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000ad75781600085600088858151811062000a735762000a73620022e2565b60200260200101515189868151811062000a915762000a91620022e2565b602002602001015160405160200162000ab096959493929190620022f8565b6040516020818303038152906040529150808062000ace906200237c565b91505062000a4e565b508060405160240162000aeb91906200209f565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000b27620016d6565b6001600160a01b03821662000b705760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004f5565b6001600160a01b03811662000bbb5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004f5565b6001600160a01b03871662000c065760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004f5565b6001600160a01b03861662000c575760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004f5565b6001600160a01b03851662000caf5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004f5565b6001600160a01b03841662000d075760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004f5565b6001600160a01b03831662000d555760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004f5565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000e02836200237c565b9091555060405190815260200160405180910390a15050505050505050565b62000e2b620016d6565b6001600160a01b03811662000e925760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004f5565b6200059b8162001732565b60d05460cb546040805160208101825260008082529151631688f0b960e01b8152919384936001600160a01b0391821693631688f0b99362000ee993909216919088906004016200239a565b6020604051808303816000875af115801562000f09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f2f9190620023d0565b905062000f3d8482620017e2565b604080516001600160a01b038084168252861660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0910160405180910390a19392505050565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000fd1939092169190600401620022b4565b6020604051808303816000875af115801562000ff1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010179190620023d0565b9050620010258382620017e2565b604080516001600160a01b038084168252851660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0910160405180910390a192915050565b600080808080808080620010858c8e018e620023f0565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b81526004016200112e939291906200239a565b6020604051808303816000875af11580156200114e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011749190620023d0565b90506001600160a01b03831615806200119457506001600160a01b038216155b156200131857620011a6878762000887565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620011ea57600080fd5b505af1158015620011ff573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200123f57600080fd5b505af115801562001254573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b1580156200129c57600080fd5b505af1158015620012b1573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620012f957600080fd5b505af11580156200130e573d6000803e3d6000fd5b5050505062001328565b62001325600189620024ae565b97505b6001600160a01b0385166200134b5762001343818b62000e9d565b94506200135b565b62001358600289620024ae565b97505b6000620013746200136d8d8f620024c9565b8362000a48565b60cd54604051919250600091620013a291879187916001600160a01b0316908b908b908890602001620024d8565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf90620013e09084906004016200209f565b600060405180830381600087803b158015620013fb57600080fd5b505af115801562001410573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001453573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014799190620023d0565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014e79190620023d0565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200059b620016d6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562001594576200158f8362001960565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620015f1575060408051601f3d908101601f19168201909252620015ee918101906200252a565b60015b620016565760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004f5565b60008051602062002dfd8339815191528114620016c85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004f5565b506200158f838383620019ff565b6033546001600160a01b03163314620007625760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004f5565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620017ae5760405162461bcd60e51b8152600401620004f59062002544565b6200076262001a30565b600054610100900460ff16620007625760405162461bcd60e51b8152600401620004f59062002544565b6040516001600160a01b038316602482015260009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b179052825191519293506000926200184492849287928492918891016200258f565b60405160208183030381529060405290506000816040516024016200186a91906200209f565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b17905281516001808252818401909352929350600092919082810190803683370190505090508581600081518110620018cf57620018cf620022e2565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001924938793600193928316928a92169060009081908190600401620025e7565b600060405180830381600087803b1580156200193f57600080fd5b505af115801562001954573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b0381163b620019cf5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004f5565b60008051602062002dfd83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b62001a0a8362001a65565b60008251118062001a185750805b156200158f5762001a2a838362001aa7565b50505050565b600054610100900460ff1662001a5a5760405162461bcd60e51b8152600401620004f59062002544565b620007623362001732565b62001a708162001960565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b62001b115760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004f5565b600080846001600160a01b03168460405162001b2e9190620026a9565b600060405180830381855af49150503d806000811462001b6b576040519150601f19603f3d011682016040523d82523d6000602084013e62001b70565b606091505b509150915062001b9b828260405180606001604052806027815260200162002e1d6027913962001ba4565b95945050505050565b6060831562001bb557508162001bc1565b62001bc1838362001bc8565b9392505050565b81511562001bd95781518083602001fd5b8060405162461bcd60e51b8152600401620004f591906200209f565b61073580620026c883390190565b60008083601f84011262001c1657600080fd5b50813567ffffffffffffffff81111562001c2f57600080fd5b60208301915083602082850101111562001c4857600080fd5b9250929050565b60008083601f84011262001c6257600080fd5b50813567ffffffffffffffff81111562001c7b57600080fd5b6020830191508360208260051b850101111562001c4857600080fd5b6000806000806000806080878903121562001cb157600080fd5b863567ffffffffffffffff8082111562001cca57600080fd5b62001cd88a838b0162001c03565b9098509650602089013591508082111562001cf257600080fd5b5062001d0189828a0162001c4f565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200059b57600080fd5b60006020828403121562001d4557600080fd5b813562001bc18162001d1c565b60008060008060006060868803121562001d6b57600080fd5b853567ffffffffffffffff8082111562001d8457600080fd5b62001d9289838a0162001c03565b9097509550602088013591508082111562001dac57600080fd5b5062001dbb8882890162001c4f565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001e0f5762001e0f62001dcd565b604052919050565b600082601f83011262001e2957600080fd5b813567ffffffffffffffff81111562001e465762001e4662001dcd565b62001e5b601f8201601f191660200162001de3565b81815284602083860101111562001e7157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001ea257600080fd5b823562001eaf8162001d1c565b9150602083013567ffffffffffffffff81111562001ecc57600080fd5b62001eda8582860162001e17565b9150509250929050565b6000806040838503121562001ef857600080fd5b823567ffffffffffffffff8082111562001f1157600080fd5b62001f1f8683870162001e17565b9350602085013591508082111562001f3657600080fd5b5062001eda8582860162001e17565b600067ffffffffffffffff8084111562001f635762001f6362001dcd565b8360051b602062001f7681830162001de3565b8681529350908401908084018783111562001f9057600080fd5b855b8381101562001fc95780358581111562001fac5760008081fd5b62001fba8a828a0162001e17565b83525090820190820162001f92565b50505050509392505050565b6000806040838503121562001fe957600080fd5b823567ffffffffffffffff8111156200200157600080fd5b8301601f810185136200201357600080fd5b620020248582356020840162001f45565b9250506020830135620020378162001d1c565b809150509250929050565b60005b838110156200205f57818101518382015260200162002045565b8381111562001a2a5750506000910152565b600081518084526200208b81602086016020860162002042565b601f01601f19169290920160200192915050565b60208152600062001bc1602083018462002071565b600080600080600080600080610100898b031215620020d257600080fd5b8835620020df8162001d1c565b97506020890135620020f18162001d1c565b96506040890135620021038162001d1c565b95506060890135620021158162001d1c565b94506080890135620021278162001d1c565b935060a0890135620021398162001d1c565b925060c08901356200214b8162001d1c565b915060e08901356200215d8162001d1c565b809150509295985092959890939650565b600080604083850312156200218257600080fd5b82356200218f8162001d1c565b946020939093013593505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b600082516200224981846020870162002042565b64081313d3d560da1b920191825250600501919050565b600082516200227481846020870162002042565b640b5313d3d560da1b920191825250600501919050565b604081526000620022a0604083018562002071565b828103602084015262001b9b818562002071565b6001600160a01b0383168152604060208201819052600090620022da9083018462002071565b949350505050565b634e487b7160e01b600052603260045260246000fd5b600087516200230c818460208c0162002042565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b16600182015285601582015284603582015283516200235681605584016020880162002042565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982141562002393576200239362002366565b5060010190565b6001600160a01b0384168152606060208201819052600090620023c09083018562002071565b9050826040830152949350505050565b600060208284031215620023e357600080fd5b815162001bc18162001d1c565b60008060008060008060c087890312156200240a57600080fd5b863567ffffffffffffffff808211156200242357600080fd5b620024318a838b0162001e17565b975060208901359150808211156200244857600080fd5b506200245789828a0162001e17565b95505060408701356200246a8162001d1c565b935060608701356200247c8162001d1c565b925060808701356200248e8162001d1c565b915060a0870135620024a08162001d1c565b809150509295509295509295565b60008219821115620024c457620024c462002366565b500190565b600062001bc136848462001f45565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a082018190526000906200251e9083018462002071565b98975050505050505050565b6000602082840312156200253d57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620025d681605585016020870162002042565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b828110156200262d5781516001600160a01b03168552938301939083019060010162002606565b50505083018a90526001600160a01b0389166040840152828103606084015262002658818962002071565b9150506200267160808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200269c60e08301846001600160a01b03169052565b9998505050505050505050565b60008251620026bd81846020870162002042565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206aaea425347cbdf2ce219d869c1f46746ae0464d3865d54db4da12977981076f64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3851, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 3854, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 4547, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3334, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 3454, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3833, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4148, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 9569, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "addrsVersion", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 9571, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "template", + "offset": 0, + "slot": "202", + "type": "t_address_payable" + }, + { + "astId": 9573, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSingleton", + "offset": 0, + "slot": "203", + "type": "t_address" + }, + { + "astId": 9575, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisFallbackLibrary", + "offset": 0, + "slot": "204", + "type": "t_address" + }, + { + "astId": 9577, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisMultisendLibrary", + "offset": 0, + "slot": "205", + "type": "t_address" + }, + { + "astId": 9579, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "lootSingleton", + "offset": 0, + "slot": "206", + "type": "t_address" + }, + { + "astId": 9581, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "sharesSingleton", + "offset": 0, + "slot": "207", + "type": "t_address" + }, + { + "astId": 9584, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSafeProxyFactory", + "offset": 0, + "slot": "208", + "type": "t_contract(GnosisSafeProxyFactory)2560" + }, + { + "astId": 9587, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "moduleProxyFactory", + "offset": 0, + "slot": "209", + "type": "t_contract(ModuleProxyFactory)2936" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(GnosisSafeProxyFactory)2560": { + "encoding": "inplace", + "label": "contract GnosisSafeProxyFactory", + "numberOfBytes": "20" + }, + "t_contract(ModuleProxyFactory)2936": { + "encoding": "inplace", + "label": "contract ModuleProxyFactory", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalSummoner_Implementation.json b/lib/Baal/deployments/goerli/BaalSummoner_Implementation.json new file mode 100644 index 0000000..6caa632 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0xbc654E592df10AFB2f6562a4ab34BaD35Ae75049", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/BaalSummoner_Proxy.json b/lib/Baal/deployments/goerli/BaalSummoner_Proxy.json new file mode 100644 index 0000000..bf871e0 --- /dev/null +++ b/lib/Baal/deployments/goerli/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/Loot.json b/lib/Baal/deployments/goerli/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/goerli/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/Poster.json b/lib/Baal/deployments/goerli/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/goerli/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/Shares.json b/lib/Baal/deployments/goerli/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/goerli/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/TributeMinion.json b/lib/Baal/deployments/goerli/TributeMinion.json new file mode 100644 index 0000000..34e6b6b --- /dev/null +++ b/lib/Baal/deployments/goerli/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/__BaalSummoner.json b/lib/Baal/deployments/goerli/__BaalSummoner.json new file mode 100644 index 0000000..6f63d4f --- /dev/null +++ b/lib/Baal/deployments/goerli/__BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/solcInputs/7ba494230421f9e16bfee0b9927fda6d.json b/lib/Baal/deployments/goerli/solcInputs/7ba494230421f9e16bfee0b9927fda6d.json new file mode 100644 index 0000000..be8d2b8 --- /dev/null +++ b/lib/Baal/deployments/goerli/solcInputs/7ba494230421f9e16bfee0b9927fda6d.json @@ -0,0 +1,191 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce)\n public\n returns (address)\n {\n // Deploy new safe but do not set it up yet\n // createProxyWithNonce(singleton, \"\", nonce)\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxyWithNonce(\n gnosisSingleton,\n bytes(\"\"),\n _saltNonce\n )\n )\n );\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n function deployAndSetupSafe(address _moduleAddr)\n public\n returns (address)\n {\n return deployAndSetupSafe(_moduleAddr, 8441);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal), _saltNonce);\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/solcInputs/b52e66b4cd1dc0db61ba3c32479c6962.json b/lib/Baal/deployments/goerli/solcInputs/b52e66b4cd1dc0db61ba3c32479c6962.json new file mode 100644 index 0000000..4e8c192 --- /dev/null +++ b/lib/Baal/deployments/goerli/solcInputs/b52e66b4cd1dc0db61ba3c32479c6962.json @@ -0,0 +1,191 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n function configureSafe(address _moduleAddr, GnosisSafe _safe) internal {\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n }\n\n\n // deploy a safe with module and single module signer setup\n // with nounce\n function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce)\n public\n returns (address)\n {\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxyWithNonce(\n gnosisSingleton,\n bytes(\"\"),\n _saltNonce\n )\n )\n );\n \n configureSafe(_moduleAddr, _safe);\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr)\n public\n returns (address)\n {\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxy(\n gnosisSingleton,\n bytes(\"\")\n )\n )\n );\n\n configureSafe(_moduleAddr, _safe);\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal), _saltNonce);\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/goerli/solcInputs/f43414b76d939b4b02d560d5a78e9cb3.json b/lib/Baal/deployments/goerli/solcInputs/f43414b76d939b4b02d560d5a78e9cb3.json new file mode 100644 index 0000000..7a68000 --- /dev/null +++ b/lib/Baal/deployments/goerli/solcInputs/f43414b76d939b4b02d560d5a78e9cb3.json @@ -0,0 +1,191 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr, uint256 _saltNonce)\n public\n returns (address)\n {\n // Deploy new safe but do not set it up yet\n // createProxyWithNonce(singleton, \"\", nonce)\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxyWithNonce(\n gnosisSingleton,\n bytes(\"\"),\n _saltNonce\n )\n )\n );\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal), _saltNonce);\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/hardhat/.chainId b/lib/Baal/deployments/hardhat/.chainId new file mode 100644 index 0000000..027791f --- /dev/null +++ b/lib/Baal/deployments/hardhat/.chainId @@ -0,0 +1 @@ +31337 \ No newline at end of file diff --git a/lib/Baal/deployments/hardhat/Loot.json b/lib/Baal/deployments/hardhat/Loot.json new file mode 100644 index 0000000..c1cae08 --- /dev/null +++ b/lib/Baal/deployments/hardhat/Loot.json @@ -0,0 +1,1186 @@ +{ + "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xe856a0128642438daa5627d962fe914b5f20b6b736405d48237febd5b6e08ef8", + "receipt": { + "to": null, + "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "contractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "transactionIndex": 0, + "gasUsed": "2319965", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000200000000000000000000000000000000000400000000000000000000000000000000000000000040000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x847acebb1661693466d6e2e70300ab60eb7a1f3d20065523f56b736c8728567b", + "transactionHash": "0xe856a0128642438daa5627d962fe914b5f20b6b736405d48237febd5b6e08ef8", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 1, + "transactionHash": "0xe856a0128642438daa5627d962fe914b5f20b6b736405d48237febd5b6e08ef8", + "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0x847acebb1661693466d6e2e70300ab60eb7a1f3d20065523f56b736c8728567b" + } + ], + "blockNumber": 1, + "cumulativeGasUsed": "2319965", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "2f9114d2ce80f59efb1ecec80159909b", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSnapshotId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"balanceOfAt(address,uint256)\":{\"details\":\"Retrieves the balance of `account` at the time `snapshotId` was created.\"},\"burn(address,uint256)\":{\"params\":{\"account\":\"Address to lose loot\",\"amount\":\"Amount to burn\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"mint(address,uint256)\":{\"params\":{\"amount\":\"Amount to mint\",\"recipient\":\"Address to receive loot\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setUp(string,string)\":{\"details\":\"initializer should prevent this from being called again\",\"params\":{\"name_\":\"Name for ERC20 token trackers\",\"symbol_\":\"Symbol for ERC20 token trackers\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"totalSupplyAt(uint256)\":{\"details\":\"Retrieves the total supply at the time `snapshotId` was created.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(address,uint256)\":{\"notice\":\"Baal-only function to burn loot.\"},\"getCurrentSnapshotId()\":{\"notice\":\"get current SnapshotId\"},\"mint(address,uint256)\":{\"notice\":\"Baal-only function to mint loot.\"},\"pause()\":{\"notice\":\"Baal-only function to pause shares.\"},\"setUp(string,string)\":{\"notice\":\"Configure loot - called by Baal on summon\"},\"snapshot()\":{\"notice\":\"Allows baal to create a snapshot\"},\"unpause()\":{\"notice\":\"Baal-only function to pause shares.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/LootERC20.sol\":\"Loot\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0xb1d9e69cf8073efa574b31b1f840e20709139c19bfb27e60b16393d6073f3d42\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ArraysUpgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\\n * total supply at the time are recorded for later access.\\n *\\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\\n * In naive implementations it's possible to perform a \\\"double spend\\\" attack by reusing the same balance from different\\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\\n * used to create an efficient ERC20 forking mechanism.\\n *\\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\\n * and the account address.\\n *\\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\\n *\\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\\n * alternative consider {ERC20Votes}.\\n *\\n * ==== Gas Costs\\n *\\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\\n *\\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\\n * transfers will have normal cost until the next snapshot, and so on.\\n */\\n\\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\\n function __ERC20Snapshot_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\\n }\\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\\n\\n using ArraysUpgradeable for uint256[];\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\\n // Snapshot struct, but that would impede usage of functions that work on an array.\\n struct Snapshots {\\n uint256[] ids;\\n uint256[] values;\\n }\\n\\n mapping(address => Snapshots) private _accountBalanceSnapshots;\\n Snapshots private _totalSupplySnapshots;\\n\\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\\n CountersUpgradeable.Counter private _currentSnapshotId;\\n\\n /**\\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\\n */\\n event Snapshot(uint256 id);\\n\\n /**\\n * @dev Creates a new snapshot and returns its snapshot id.\\n *\\n * Emits a {Snapshot} event that contains the same id.\\n *\\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\\n *\\n * [WARNING]\\n * ====\\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\\n * you must consider that it can potentially be used by attackers in two ways.\\n *\\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\\n * section above.\\n *\\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\\n * ====\\n */\\n function _snapshot() internal virtual returns (uint256) {\\n _currentSnapshotId.increment();\\n\\n uint256 currentId = _getCurrentSnapshotId();\\n emit Snapshot(currentId);\\n return currentId;\\n }\\n\\n /**\\n * @dev Get the current snapshotId\\n */\\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\\n return _currentSnapshotId.current();\\n }\\n\\n /**\\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\\n */\\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\\n\\n return snapshotted ? value : balanceOf(account);\\n }\\n\\n /**\\n * @dev Retrieves the total supply at the time `snapshotId` was created.\\n */\\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\\n\\n return snapshotted ? value : totalSupply();\\n }\\n\\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n if (from == address(0)) {\\n // mint\\n _updateAccountSnapshot(to);\\n _updateTotalSupplySnapshot();\\n } else if (to == address(0)) {\\n // burn\\n _updateAccountSnapshot(from);\\n _updateTotalSupplySnapshot();\\n } else {\\n // transfer\\n _updateAccountSnapshot(from);\\n _updateAccountSnapshot(to);\\n }\\n }\\n\\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\\n require(snapshotId > 0, \\\"ERC20Snapshot: id is 0\\\");\\n require(snapshotId <= _getCurrentSnapshotId(), \\\"ERC20Snapshot: nonexistent id\\\");\\n\\n // When a valid snapshot is queried, there are three possibilities:\\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\\n // to this id is the current one.\\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\\n // requested id, and its value is the one to return.\\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\\n // larger than the requested one.\\n //\\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\\n // exactly this.\\n\\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\\n\\n if (index == snapshots.ids.length) {\\n return (false, 0);\\n } else {\\n return (true, snapshots.values[index]);\\n }\\n }\\n\\n function _updateAccountSnapshot(address account) private {\\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\\n }\\n\\n function _updateTotalSupplySnapshot() private {\\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\\n }\\n\\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\\n uint256 currentId = _getCurrentSnapshotId();\\n if (_lastSnapshotId(snapshots.ids) < currentId) {\\n snapshots.ids.push(currentId);\\n snapshots.values.push(currentValue);\\n }\\n }\\n\\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\\n if (ids.length == 0) {\\n return 0;\\n } else {\\n return ids[ids.length - 1];\\n }\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[46] private __gap;\\n}\\n\",\"keccak256\":\"0x42da8099f59958af496f6c8f0d9c1ce0a929151e02f877e4be23aca4cc440cbe\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/EIP712Upgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 51\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n mapping(address => CountersUpgradeable.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\\n __EIP712_init_unchained(name, \\\"1\\\");\\n }\\n\\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(address owner) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(address owner) internal virtual returns (uint256 current) {\\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xfe1053f3a6ee4527cde96c8152b8b1dbb98774639a64e819087bc80e618d7f7f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./StorageSlotUpgradeable.sol\\\";\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary ArraysUpgradeable {\\n using StorageSlotUpgradeable for bytes32;\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * `array` is expected to be sorted in ascending order, and to contain no\\n * repeated elements.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n if (array.length == 0) {\\n return 0;\\n }\\n\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n while (low < high) {\\n uint256 mid = MathUpgradeable.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getUint256Slot();\\n }\\n}\\n\",\"keccak256\":\"0xc3821e9d41b2b19b612238b308dcc8f4ab46afcd0f6b3bd174e89789bbf59e26\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary CountersUpgradeable {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0x798741e231b22b81e2dd2eddaaf8832dee4baf5cd8e2dbaa5c1dd12a1c053c4d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"contracts/LootERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\ncontract Loot is\\n ERC20SnapshotUpgradeable,\\n ERC20PermitUpgradeable,\\n PausableUpgradeable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Configure loot - called by Baal on summon\\n /// @dev initializer should prevent this from being called again\\n /// @param name_ Name for ERC20 token trackers\\n /// @param symbol_ Symbol for ERC20 token trackers\\n function setUp(string memory name_, string memory symbol_)\\n external\\n initializer\\n {\\n require(bytes(name_).length != 0, \\\"loot: name empty\\\");\\n require(bytes(symbol_).length != 0, \\\"loot: symbol empty\\\");\\n\\n __ERC20_init(name_, symbol_);\\n __ERC20Permit_init(name_);\\n __Pausable_init();\\n __ERC20Snapshot_init();\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /// @notice Allows baal to create a snapshot\\n function snapshot() external onlyOwner returns(uint256) {\\n return _snapshot();\\n }\\n\\n /// @notice get current SnapshotId\\n function getCurrentSnapshotId() external view returns (uint256) {\\n return _getCurrentSnapshotId();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function pause() public onlyOwner {\\n _pause();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function unpause() public onlyOwner {\\n _unpause();\\n }\\n\\n /// @notice Baal-only function to mint loot.\\n /// @param recipient Address to receive loot\\n /// @param amount Amount to mint\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n // can not be more than half the max because of totalsupply of loot and shares\\n require(totalSupply() + amount <= type(uint256).max / 2, \\\"loot: cap exceeded\\\");\\n _mint(recipient, amount);\\n }\\n\\n /// @notice Baal-only function to burn loot.\\n /// @param account Address to lose loot\\n /// @param amount Amount to burn\\n function burn(address account, uint256 amount) external onlyOwner {\\n _burn(account, amount);\\n }\\n\\n /// @notice Internal hook to restrict token transfers unless allowed by baal\\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\\n /// @param from The address of the source account.\\n /// @param to The address of the destination account.\\n /// @param amount The number of `loot` tokens to transfer.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(\\n from == address(0) || /*Minting allowed*/\\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\\n !paused(),\\n \\\"loot: !transferable\\\"\\n );\\n }\\n\\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0xa3b301421fabcf9fc110e5532cc4368c6e25a80348dbfe47f8e8e4dd72ce02cb\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c61288a62000126600039600081816106480152818161069101528181610838015281816108780152610907015261288a6000f3fe6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "balanceOfAt(address,uint256)": { + "details": "Retrieves the balance of `account` at the time `snapshotId` was created." + }, + "burn(address,uint256)": { + "params": { + "account": "Address to lose loot", + "amount": "Amount to burn" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "mint(address,uint256)": { + "params": { + "amount": "Amount to mint", + "recipient": "Address to receive loot" + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setUp(string,string)": { + "details": "initializer should prevent this from being called again", + "params": { + "name_": "Name for ERC20 token trackers", + "symbol_": "Symbol for ERC20 token trackers" + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "totalSupplyAt(uint256)": { + "details": "Retrieves the total supply at the time `snapshotId` was created." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "burn(address,uint256)": { + "notice": "Baal-only function to burn loot." + }, + "getCurrentSnapshotId()": { + "notice": "get current SnapshotId" + }, + "mint(address,uint256)": { + "notice": "Baal-only function to mint loot." + }, + "pause()": { + "notice": "Baal-only function to pause shares." + }, + "setUp(string,string)": { + "notice": "Configure loot - called by Baal on summon" + }, + "snapshot()": { + "notice": "Allows baal to create a snapshot" + }, + "unpause()": { + "notice": "Baal-only function to pause shares." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4465, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4468, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6734, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4982, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4988, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4990, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 4992, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage" + }, + { + "astId": 4994, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage" + }, + { + "astId": 5574, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 5696, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_accountBalanceSnapshots", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_address,t_struct(Snapshots)5691_storage)" + }, + { + "astId": 5699, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupplySnapshots", + "offset": 0, + "slot": "102", + "type": "t_struct(Snapshots)5691_storage" + }, + { + "astId": 5702, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_currentSnapshotId", + "offset": 0, + "slot": "104", + "type": "t_struct(Counter)6741_storage" + }, + { + "astId": 6000, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "105", + "type": "t_array(t_uint256)46_storage" + }, + { + "astId": 7414, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32" + }, + { + "astId": 7416, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32" + }, + { + "astId": 7554, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 6052, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)6741_storage)" + }, + { + "astId": 6060, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32" + }, + { + "astId": 6216, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4784, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_paused", + "offset": 0, + "slot": "254", + "type": "t_bool" + }, + { + "astId": 4889, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3948, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_owner", + "offset": 0, + "slot": "304", + "type": "t_address" + }, + { + "astId": 4068, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4447, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "354", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4762, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "404", + "type": "t_array(t_uint256)50_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)46_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[46]", + "numberOfBytes": "1472" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_struct(Counter)6741_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)6741_storage" + }, + "t_mapping(t_address,t_struct(Snapshots)5691_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", + "numberOfBytes": "32", + "value": "t_struct(Snapshots)5691_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)6741_storage": { + "encoding": "inplace", + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "astId": 6740, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Snapshots)5691_storage": { + "encoding": "inplace", + "label": "struct ERC20SnapshotUpgradeable.Snapshots", + "members": [ + { + "astId": 5687, + "contract": "contracts/LootERC20.sol:Loot", + "label": "ids", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5690, + "contract": "contracts/LootERC20.sol:Loot", + "label": "values", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/hardhat/solcInputs/2f9114d2ce80f59efb1ecec80159909b.json b/lib/Baal/deployments/hardhat/solcInputs/2f9114d2ce80f59efb1ecec80159909b.json new file mode 100644 index 0000000..8f28a04 --- /dev/null +++ b/lib/Baal/deployments/hardhat/solcInputs/2f9114d2ce80f59efb1ecec80159909b.json @@ -0,0 +1,314 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/GnosisSafeStorage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title GnosisSafeStorage - Storage layout of the Safe contracts to be used in libraries\n/// @author Richard Meissner - \ncontract GnosisSafeStorage {\n // From /common/Singleton.sol\n address internal singleton;\n // From /common/ModuleManager.sol\n mapping(address => address) internal modules;\n // From /common/OwnerManager.sol\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n // From /GnosisSafe.sol\n bytes32 internal nonce;\n bytes32 internal domainSeparator;\n mapping(bytes32 => uint256) internal signedMessages;\n mapping(address => mapping(bytes32 => uint256)) internal approvedHashes;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeStorage.sol\";\nimport \"../../GnosisSafe.sol\";\n\n/// @title SignMessageLib - Allows to set an entry in the signedMessages\n/// @author Richard Meissner - \ncontract SignMessageLib is GnosisSafeStorage {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n event SignMsg(bytes32 indexed msgHash);\n\n /// @dev Marks a message as signed, so that it can be used with EIP-1271\n /// @notice Marks a message (`_data`) as signed.\n /// @param _data Arbitrary length data that should be marked as signed on the behalf of address(this)\n function signMessage(bytes calldata _data) external {\n bytes32 msgHash = getMessageHash(_data);\n signedMessages[msgHash] = 1;\n emit SignMsg(msgHash);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return\n keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), GnosisSafe(payable(address(this))).domainSeparator(), safeMessageHash));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./DefaultCallbackHandler.sol\";\nimport \"../interfaces/ISignatureValidator.sol\";\nimport \"../GnosisSafe.sol\";\n\n/// @title Compatibility Fallback Handler - fallback handler to provider compatibility between pre 1.3.0 and 1.3.0+ Safe contracts\n/// @author Richard Meissner - \ncontract CompatibilityFallbackHandler is DefaultCallbackHandler, ISignatureValidator {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256(\"simulate(address,bytes)\"));\n\n address internal constant SENTINEL_MODULES = address(0x1);\n bytes4 internal constant UPDATED_MAGIC_VALUE = 0x1626ba7e;\n\n /**\n * Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`)\n * @dev Should return whether the signature provided is valid for the provided data.\n * @param _data Arbitrary length data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _data\n * @return a bool upon valid or invalid signature with corresponding _data\n */\n function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n bytes32 messageHash = getMessageHashForSafe(safe, _data);\n if (_signature.length == 0) {\n require(safe.signedMessages(messageHash) != 0, \"Hash not approved\");\n } else {\n safe.checkSignatures(messageHash, _data, _signature);\n }\n return EIP1271_MAGIC_VALUE;\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n return getMessageHashForSafe(GnosisSafe(payable(msg.sender)), message);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param safe Safe to which the message is targeted\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHashForSafe(GnosisSafe safe, bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), safe.domainSeparator(), safeMessageHash));\n }\n\n /**\n * Implementation of updated EIP-1271\n * @dev Should return whether the signature provided is valid for the provided data.\n * The save does not implement the interface since `checkSignatures` is not a view method.\n * The method will not perform any state changes (see parameters of `checkSignatures`)\n * @param _dataHash Hash of the data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _dataHash\n * @return a bool upon valid or invalid signature with corresponding _dataHash\n * @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\n */\n function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) {\n ISignatureValidator validator = ISignatureValidator(msg.sender);\n bytes4 value = validator.isValidSignature(abi.encode(_dataHash), _signature);\n return (value == EIP1271_MAGIC_VALUE) ? UPDATED_MAGIC_VALUE : bytes4(0);\n }\n\n /// @dev Returns array of first 10 modules.\n /// @return Array of modules.\n function getModules() external view returns (address[] memory) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n (address[] memory array, ) = safe.getModulesPaginated(SENTINEL_MODULES, 10);\n return array;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulate(address targetContract, bytes calldata calldataPayload) external returns (bytes memory response) {\n // Suppress compiler warnings about not using parameters, while allowing\n // parameters to keep names for documentation purposes. This does not\n // generate code.\n targetContract;\n calldataPayload;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let internalCalldata := mload(0x40)\n // Store `simulateAndRevert.selector`.\n // String representation is used to force right padding\n mstore(internalCalldata, \"\\xb4\\xfa\\xba\\x09\")\n // Abuse the fact that both this and the internal methods have the\n // same signature, and differ only in symbol name (and therefore,\n // selector) and copy calldata directly. This saves us approximately\n // 250 bytes of code and 300 gas at runtime over the\n // `abi.encodeWithSelector` builtin.\n calldatacopy(add(internalCalldata, 0x04), 0x04, sub(calldatasize(), 0x04))\n\n // `pop` is required here by the compiler, as top level expressions\n // can't have return values in inline assembly. `call` typically\n // returns a 0 or 1 value indicated whether or not it reverted, but\n // since we know it will always revert, we can safely ignore it.\n pop(\n call(\n gas(),\n // address() has been changed to caller() to use the implementation of the Safe\n caller(),\n 0,\n internalCalldata,\n calldatasize(),\n // The `simulateAndRevert` call always reverts, and\n // instead encodes whether or not it was successful in the return\n // data. The first 32-byte word of the return data contains the\n // `success` value, so write it to memory address 0x00 (which is\n // reserved Solidity scratch space and OK to use).\n 0x00,\n 0x20\n )\n )\n\n // Allocate and copy the response bytes, making sure to increment\n // the free memory pointer accordingly (in case this method is\n // called as an internal function). The remaining `returndata[0x20:]`\n // contains the ABI encoded response bytes, so we can just write it\n // as is to memory.\n let responseSize := sub(returndatasize(), 0x20)\n response := mload(0x40)\n mstore(0x40, add(response, responseSize))\n returndatacopy(response, 0x20, responseSize)\n\n if iszero(mload(0x00)) {\n revert(add(response, 0x20), mload(response))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n\n/// @title Default Callback Handler - returns true for known token callbacks\n/// @author Richard Meissner - \ncontract DefaultCallbackHandler is ERC1155TokenReceiver, ERC777TokensRecipient, ERC721TokenReceiver, IERC165 {\n string public constant NAME = \"Default Callback Handler\";\n string public constant VERSION = \"1.0.0\";\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xf23a6e61;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xbc197c81;\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0x150b7a02;\n }\n\n function tokensReceived(\n address,\n address,\n address,\n uint256,\n bytes calldata,\n bytes calldata\n ) external pure override {\n // We implement this for completeness, doesn't really have any value\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC1155TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n Note: The ERC-165 identifier for this interface is 0x4e2312e0.\n*/\ninterface ERC1155TokenReceiver {\n /**\n @notice Handle the receipt of a single ERC1155 token type.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` (i.e. 0xf23a6e61) if it accepts the transfer.\n This function MUST revert if it rejects the transfer.\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _id The ID of the token being transferred\n @param _value The amount of tokens being transferred\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 _id,\n uint256 _value,\n bytes calldata _data\n ) external returns (bytes4);\n\n /**\n @notice Handle the receipt of multiple ERC1155 token types.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` (i.e. 0xbc197c81) if it accepts the transfer(s).\n This function MUST revert if it rejects the transfer(s).\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the batch transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _ids An array containing ids of each token being transferred (order and length must match _values array)\n @param _values An array containing amounts of each token being transferred (order and length must match _ids array)\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata _ids,\n uint256[] calldata _values,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC721TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.\ninterface ERC721TokenReceiver {\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC777TokensRecipient.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ninterface ERC777TokensRecipient {\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Multi Send - Allows to batch multiple transactions into one.\n/// @author Nick Dodson - \n/// @author Gonçalo Sá - \n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract MultiSend {\n address private immutable multisendSingleton;\n\n constructor() {\n multisendSingleton = address(this);\n }\n\n /// @dev Sends multiple transactions and reverts all if one fails.\n /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of\n /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),\n /// to as a address (=> 20 bytes),\n /// value as a uint256 (=> 32 bytes),\n /// data length as a uint256 (=> 32 bytes),\n /// data as bytes.\n /// see abi.encodePacked for more information on packed encoding\n /// @notice This method is payable as delegatecalls keep the msg.value from the previous call\n /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise\n function multiSend(bytes memory transactions) public payable {\n require(address(this) != multisendSingleton, \"MultiSend should only be called via delegatecall\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let length := mload(transactions)\n let i := 0x20\n for {\n // Pre block is not used in \"while mode\"\n } lt(i, length) {\n // Post block is not used in \"while mode\"\n } {\n // First byte of the data is the operation.\n // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).\n // This will also zero out unused data.\n let operation := shr(0xf8, mload(add(transactions, i)))\n // We offset the load address by 1 byte (operation byte)\n // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.\n let to := shr(0x60, mload(add(transactions, add(i, 0x01))))\n // We offset the load address by 21 byte (operation byte + 20 address bytes)\n let value := mload(add(transactions, add(i, 0x15)))\n // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)\n let dataLength := mload(add(transactions, add(i, 0x35)))\n // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)\n let data := add(transactions, add(i, 0x55))\n let success := 0\n switch operation\n case 0 {\n success := call(gas(), to, value, data, dataLength, 0, 0)\n }\n case 1 {\n success := delegatecall(gas(), to, data, dataLength, 0, 0)\n }\n if eq(success, 0) {\n revert(0, 0)\n }\n // Next entry starts at 85 byte + data length\n i := add(i, add(0x55, dataLength))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n /// Check if a transactioon guard is enabled.\n if (guard != address(0)) {\n IGuard(guard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n bytes(\"0x\"),\n msg.sender\n );\n }\n success = IAvatar(target).execTransactionFromModule(\n to,\n value,\n data,\n operation\n );\n if (guard != address(0)) {\n IGuard(guard).checkAfterExecution(bytes32(\"0x\"), success);\n }\n return success;\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n /// Check if a transactioon guard is enabled.\n if (guard != address(0)) {\n IGuard(guard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n bytes(\"0x\"),\n msg.sender\n );\n }\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(to, value, data, operation);\n if (guard != address(0)) {\n IGuard(guard).checkAfterExecution(bytes32(\"0x\"), success);\n }\n return (success, returnData);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ArraysUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it's possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\n *\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\n * alternative consider {ERC20Votes}.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\n\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\n function __ERC20Snapshot_init() internal onlyInitializing {\n }\n\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\n }\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n using ArraysUpgradeable for uint256[];\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n // Snapshot struct, but that would impede usage of functions that work on an array.\n struct Snapshots {\n uint256[] ids;\n uint256[] values;\n }\n\n mapping(address => Snapshots) private _accountBalanceSnapshots;\n Snapshots private _totalSupplySnapshots;\n\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n CountersUpgradeable.Counter private _currentSnapshotId;\n\n /**\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n */\n event Snapshot(uint256 id);\n\n /**\n * @dev Creates a new snapshot and returns its snapshot id.\n *\n * Emits a {Snapshot} event that contains the same id.\n *\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\n *\n * [WARNING]\n * ====\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n * you must consider that it can potentially be used by attackers in two ways.\n *\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n * section above.\n *\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\n * ====\n */\n function _snapshot() internal virtual returns (uint256) {\n _currentSnapshotId.increment();\n\n uint256 currentId = _getCurrentSnapshotId();\n emit Snapshot(currentId);\n return currentId;\n }\n\n /**\n * @dev Get the current snapshotId\n */\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\n return _currentSnapshotId.current();\n }\n\n /**\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n */\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n return snapshotted ? value : balanceOf(account);\n }\n\n /**\n * @dev Retrieves the total supply at the time `snapshotId` was created.\n */\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n return snapshotted ? value : totalSupply();\n }\n\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (from == address(0)) {\n // mint\n _updateAccountSnapshot(to);\n _updateTotalSupplySnapshot();\n } else if (to == address(0)) {\n // burn\n _updateAccountSnapshot(from);\n _updateTotalSupplySnapshot();\n } else {\n // transfer\n _updateAccountSnapshot(from);\n _updateAccountSnapshot(to);\n }\n }\n\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\n require(snapshotId > 0, \"ERC20Snapshot: id is 0\");\n require(snapshotId <= _getCurrentSnapshotId(), \"ERC20Snapshot: nonexistent id\");\n\n // When a valid snapshot is queried, there are three possibilities:\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n // to this id is the current one.\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n // requested id, and its value is the one to return.\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n // larger than the requested one.\n //\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\n // exactly this.\n\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n if (index == snapshots.ids.length) {\n return (false, 0);\n } else {\n return (true, snapshots.values[index]);\n }\n }\n\n function _updateAccountSnapshot(address account) private {\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n }\n\n function _updateTotalSupplySnapshot() private {\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\n }\n\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n uint256 currentId = _getCurrentSnapshotId();\n if (_lastSnapshotId(snapshots.ids) < currentId) {\n snapshots.ids.push(currentId);\n snapshots.values.push(currentValue);\n }\n }\n\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n if (ids.length == 0) {\n return 0;\n } else {\n return ids[ids.length - 1];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[46] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./StorageSlotUpgradeable.sol\";\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary ArraysUpgradeable {\n using StorageSlotUpgradeable for bytes32;\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * `array` is expected to be sorted in ascending order, and to contain no\n * repeated elements.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n if (array.length == 0) {\n return 0;\n }\n\n uint256 low = 0;\n uint256 high = array.length;\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getUint256Slot();\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr)\n public\n returns (address)\n {\n // Deploy new safe but do not set it up yet\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxy(\n gnosisSingleton,\n bytes(\"\")\n )\n )\n );\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal));\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/fixtures/GnosisImports.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\n" + }, + "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../Baal.sol\";\nimport \"../interfaces/IBaalSummoner.sol\";\n\ncontract BaalAdvTokenSummoner is\n Initializable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n IBaalSummoner public _baalSummoner;\n\n event setSummoner(address summoner);\n\n event DeployBaalTokens(address lootToken, address sharesToken);\n\n function initialize() public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /**\n * @dev Sets the address of the BaalSummoner contract\n * @param baalSummoner The address of the BaalSummoner contract\n */\n function setSummonerAddr(address baalSummoner) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /**\n * @dev Summon a new Baal contract with a new set of tokens\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\n * @param _saltNonce The salt nonce to be used for the Safe contract\n * @param initializationMintParams The parameters for minting the tokens\n * @param initializationTokenParams The parameters for deploying the tokens\n * @param postInitializationActions The actions to be performed after the initialization\n */\n function summonBaalFromReferrer(\n address _safeAddr,\n address _forwarderAddr,\n uint256 _saltNonce,\n bytes calldata initializationMintParams,\n bytes calldata initializationTokenParams,\n bytes[] calldata postInitializationActions\n ) external {\n // summon tokens\n (address _lootToken, address _sharesToken) = deployTokens(\n initializationTokenParams\n );\n\n // mint shares loot tokens\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\n\n // summon baal with new tokens\n address _baal = _baalSummoner.summonBaalFromReferrer(\n abi.encode(\n IBaalToken(_sharesToken).name(), \n IBaalToken(_sharesToken).symbol(),\n _safeAddr,\n _forwarderAddr,\n _lootToken,\n _sharesToken\n ),\n postInitializationActions,\n _saltNonce,\n bytes32(bytes(\"DHAdvTokenSummoner\")) // referrer\n );\n\n // change token ownership to baal\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n }\n\n /**\n * @dev mintTokens\n * @param initializationTokens The parameters for minting the tokens\n * @param _lootToken The loot token address\n * @param _sharesToken The shares token address\n */\n function mintTokens(\n bytes calldata initializationTokens,\n address _lootToken,\n address _sharesToken\n ) internal {\n (\n address[] memory summoners, // The address to mint initial tokens to\n uint256[] memory summonerShares, // The amount of shares to mint\n uint256[] memory summonerLoot // The amount of loot to mint\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\n\n require(\n summoners.length == summonerShares.length &&\n summoners.length == summonerLoot.length,\n \"!array parity\"\n ); /*check array lengths match*/\n\n for (uint256 i = 0; i < summoners.length; i++) {\n if (summonerLoot[i] > 0) {\n IBaalToken(_lootToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `loot`*/\n }\n if (summonerShares[i] > 0) {\n IBaalToken(_sharesToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `shares`*/\n }\n }\n }\n\n /**\n * @dev deployTokens\n * @param initializationParams The parameters for deploying the tokens\n */\n function deployTokens(\n bytes calldata initializationParams\n ) internal returns (address lootToken, address sharesToken) {\n (\n string\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\n string\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\n string\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\n string\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\n bool _transferableShares /* if shares is transferable */,\n bool _transferableLoot /* if loot is transferable */\n ) = abi.decode(\n initializationParams,\n (string, string, string, string, bool, bool)\n );\n\n address lootSingleton = _baalSummoner.lootSingleton();\n address sharesSingleton = _baalSummoner.sharesSingleton();\n\n lootToken = address(\n new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector,\n _lootName,\n _lootSymbol\n )\n )\n );\n\n sharesToken = address(\n new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector,\n _name,\n _symbol\n )\n )\n );\n if (!_transferableShares) {\n IBaalToken(sharesToken).pause();\n }\n if (!_transferableLoot) {\n IBaalToken(lootToken).pause();\n }\n\n emit DeployBaalTokens(lootToken, sharesToken);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n}\n" + }, + "contracts/higherOrderFactories/BaalAndVaultSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../interfaces/IBaalSummoner.sol\";\n\n/*\nSummon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)\nCan summon a dao with a new Vault.\nCan summon a new vault for a dao after initial dao setup.\nActs as a register and the owner of the contract or DAO can deactivate\nregister is primarily a helper for UIs\nOwner of the contract can add new vaults, and set current vaults\nContract is upgradable and should be owned by a DAO\n*/\ncontract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n\n IBaalSummoner public _baalSummoner;\n uint256 public vaultIdx;\n\n struct Vault{\n uint256 id;\n bool active;\n address daoAddress;\n address vaultAddress;\n string name;\n }\n mapping(uint256 => Vault) public vaults;\n mapping(address => address) public delegates;\n\n event SetVault(\n Vault vault\n );\n\n event SetDelegate(\n address daoAddress,\n address delegate\n );\n\n event setSummoner(\n address summoner\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n vaultIdx = 0;\n }\n\n function setSummonerAddr(\n address baalSummoner\n ) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /** Summon a new baal and add a Vault */\n function summonBaalAndVault(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 saltNonce,\n bytes32 referrer,\n string memory name\n ) external returns (address _daoAddress, address _vaultAddress) {\n _daoAddress = _baalSummoner.summonBaalFromReferrer(\n initializationParams,\n initializationActions,\n saltNonce,\n referrer\n );\n _vaultAddress = summonVault(_daoAddress, name);\n }\n\n /** create and add a Vault(Safe) to an existing DAO */\n function summonVault(\n address daoAddress,\n string memory name\n ) public returns (address _vaultAddress) {\n _vaultAddress = _baalSummoner.deployAndSetupSafe(\n daoAddress\n );\n _setNewVault(name, daoAddress, _vaultAddress);\n }\n\n /** set a Vault as active or not on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setVault(\n uint256 id,\n bool active\n ) public onlyOwner\n {\n _setVault(id, active);\n }\n\n /** set a new Vault as active on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setNewVault(\n address daoAddress, \n address vaultAddress,\n string memory name\n ) public onlyOwner\n {\n _setNewVault(name, daoAddress, vaultAddress);\n }\n\n /** \n A DAO can set a Vault as inactive \n */\n function deactivateVaultAsDao(\n uint256 id,\n address daoAddress\n ) external\n {\n require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], \"not DAO or delegate\");\n require(vaults[id].daoAddress == daoAddress && vaults[id].active,\"!not active DAO vault\");\n _setVault(id, false);\n }\n\n /** Allow a Dao to set a delegate that can manage vault enteries */\n function setDelegate(\n address daoAddress,\n address delegate\n ) external\n {\n require(msg.sender == daoAddress, \"!DAO\");\n delegates[daoAddress] = delegate;\n emit SetDelegate(daoAddress, delegate);\n }\n\n\n function _setVault(\n uint256 id, \n bool active\n ) internal \n {\n vaults[id].active = active;\n emit SetVault(vaults[id]);\n }\n\n function _setNewVault(\n string memory name,\n address daoAddress, \n address vaultAddress\n ) internal \n {\n vaultIdx += 1;\n vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);\n emit SetVault(vaults[vaultIdx]);\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IAdminShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IAdminShaman {\n function isAdmin(address shaman) external view returns (bool);\n\n // Admin Only\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n}\n" + }, + "contracts/interfaces/IBaal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IBaal {\n function lootPaused() external returns (bool);\n\n function sharesPaused() external returns (bool);\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IBaalSummoner {\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n\n function deployAndSetupSafe(address _moduleAddr)\n external\n returns (address);\n\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n}" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns(uint256);\n\n}\n" + }, + "contracts/interfaces/IGovernorShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IGovernorShaman {\n function isGovernor(address shaman) external view returns (bool);\n // Governor Only\n function setGovernanceConfig(bytes memory _governanceConfig) external;\n}\n" + }, + "contracts/interfaces/IManagerShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\ninterface IManagerShaman {\n\n function isManager(address shaman) external view returns (bool);\n\n // Manager Only\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n\n}\n" + }, + "contracts/LootERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract Loot is\n ERC20SnapshotUpgradeable,\n ERC20PermitUpgradeable,\n PausableUpgradeable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure loot - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"loot: name empty\");\n require(bytes(symbol_).length != 0, \"loot: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to pause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Baal-only function to mint loot.\n /// @param recipient Address to receive loot\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"loot: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn loot.\n /// @param account Address to lose loot\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `loot` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"loot: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/BaalLessToken.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../utils/BaalVotes.sol\";\nimport \"../interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract BaalLessShares is BaalVotes, OwnableUpgradeable, UUPSUpgradeable {\n // Baal Config\n IBaal public baal;\n uint8 public version;\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @param _version new version\n function setUp(uint8 _version)\n external\n reinitializer(_version)\n {\n baal = IBaal(address(0)); /*Configure Baal to setup sender*/\n version = _version;\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n\n /// @notice owner-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n unchecked {\n if (totalSupply() + amount <= type(uint256).max / 2) {\n _mint(recipient, amount);\n }\n }\n }\n\n /// @notice owner-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice new before transfer\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes) {\n super._beforeTokenTransfer(from, to, amount);\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/MockBaal.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\n\nimport \"../Baal.sol\";\n\ncontract MockBaal {\n bool public lootPaused;\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n\n constructor(\n address payable _lootSingleton,\n string memory _name,\n string memory _symbol\n ) {\n /*Clone loot singleton using EIP1167 minimal proxy pattern*/\n lootToken = IBaalToken(Clones.clone(_lootSingleton));\n lootToken.setUp(\n string(abi.encodePacked(_name, \" LOOT\")),\n string(abi.encodePacked(_symbol, \"-LOOT\"))\n );\n }\n\n function setLootPaused(bool paused) external {\n if(!lootToken.paused() && paused){\n lootToken.pause();\n } else if(lootToken.paused() && !paused){\n lootToken.unpause();\n }\n lootPaused = paused;\n }\n\n function mintLoot(address _to, uint256 _amount) external {\n lootToken.mint(_to, _amount);\n }\n\n function burnLoot(address _from, uint256 _amount) external {\n lootToken.burn(_from, _amount);\n }\n}\n" + }, + "contracts/mock/TestAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\ncontract Enum {\n enum Operation {\n Call,\n DelegateCall\n }\n}\n\ncontract TestAvatar {\n address public module;\n\n receive() external payable {}\n\n function enableModule(address _module) external {\n module = _module;\n }\n\n function disableModule(address, address) external {\n module = address(0);\n }\n\n function isModuleEnabled(address _module) external view returns (bool) {\n if (module == _module) {\n return true;\n } else {\n return false;\n }\n }\n\n function execTransactionFromModule(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, ) = to.call{value: value}(data);\n }\n\n function execTransactionFromModuleReturnData(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success, bytes memory returnData) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, returnData) = to.call{value: value}(data);\n }\n\n function getModulesPaginated(address, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next)\n {\n // Init array with max page size\n array = new address[](pageSize);\n\n array[0] = module;\n next = module;\n }\n}\n" + }, + "contracts/mock/TestERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\n/// @notice Basic ERC20 implementation.\ncontract TestERC20 {\n string public name;\n string public symbol;\n uint8 public constant decimals = 18;\n uint256 public totalSupply;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 amount);\n event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n constructor(string memory _name, string memory _symbol, uint256 _totalSupply) {\n name = _name;\n symbol = _symbol;\n totalSupply = _totalSupply;\n balanceOf[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function approve(address to, uint256 amount) external returns (bool) {\n allowance[msg.sender][to] = amount;\n emit Approval(msg.sender, to, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n balanceOf[msg.sender] -= amount;\n balanceOf[to] += amount;\n emit Transfer(msg.sender, to, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max)\n allowance[from][msg.sender] -= amount;\n\n balanceOf[from] -= amount;\n balanceOf[to] += amount;\n emit Transfer(from, to, amount);\n return true;\n }\n}\n" + }, + "contracts/SharesERC20.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\n\nimport \"./utils/BaalVotes.sol\";\nimport \"./interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"shares: name empty\");\n require(bytes(symbol_).length != 0, \"shares: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n __EIP712_init_delegation(\"delegation\", \"4\");\n\n\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to unpause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"shares: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"shares: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/tools/TributeMinion.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"../Baal.sol\";\n\ninterface IERC20 {\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n}\n\ncontract TributeMinion {\n event TributeProposal(\n address indexed baal,\n address token,\n uint256 amount,\n address recipient,\n uint256 proposalId\n );\n struct Escrow {\n address token;\n address applicant;\n uint256 amount;\n bool released;\n address safe;\n }\n mapping(address => mapping(uint256 => Escrow)) public escrows;\n\n event EscrowReleased(\n address indexed baal,\n uint32 proposalId,\n address applicant,\n address safe,\n uint256 amount\n );\n\n function encodeTributeProposal(\n address baal,\n uint256 shares,\n uint256 loot,\n address recipient,\n uint32 proposalId,\n address escrow\n ) public pure returns (bytes memory) {\n // Workaround for solidity dynamic memory array\n address[] memory _recipients = new address[](1);\n _recipients[0] = recipient;\n\n bytes memory _releaseEscrow = abi.encodeWithSignature(\n \"releaseEscrow(address,uint32)\",\n baal,\n proposalId\n );\n\n bytes memory tributeMultisend = abi.encodePacked(\n uint8(0),\n escrow,\n uint256(0),\n uint256(_releaseEscrow.length),\n bytes(_releaseEscrow)\n );\n\n if (shares > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _shares = new uint256[](1);\n _shares[0] = shares;\n\n bytes memory _issueShares = abi.encodeWithSignature(\n \"mintShares(address[],uint256[])\",\n _recipients,\n _shares\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n baal,\n uint256(0),\n uint256(_issueShares.length),\n bytes(_issueShares)\n );\n }\n if (loot > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _loot = new uint256[](1);\n _loot[0] = loot;\n\n bytes memory _issueLoot = abi.encodeWithSignature(\n \"mintLoot(address[],uint256[])\",\n _recipients,\n _loot\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n address(baal),\n uint256(0),\n uint256(_issueLoot.length),\n bytes(_issueLoot)\n );\n }\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n tributeMultisend\n );\n return _multisendAction;\n }\n\n function submitTributeProposal(\n Baal baal,\n address token,\n uint256 amount,\n uint256 shares,\n uint256 loot,\n uint32 expiration,\n uint256 baalgas,\n string memory details\n ) external payable {\n uint32 proposalId = baal.proposalCount() + 1;\n\n bytes memory encodedProposal = encodeTributeProposal(\n address(baal),\n shares,\n loot,\n msg.sender,\n proposalId,\n address(this)\n );\n\n escrows[address(baal)][proposalId] = Escrow(\n token,\n msg.sender,\n amount,\n false,\n baal.target()\n );\n\n baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);\n\n emit TributeProposal(\n address(baal),\n token,\n amount,\n msg.sender,\n proposalId\n );\n }\n\n function releaseEscrow(address _baal, uint32 _proposalId) external {\n Baal baal = Baal(_baal);\n Escrow storage escrow = escrows[address(baal)][_proposalId];\n require(!escrow.released, \"Already released\");\n\n bool[4] memory status = baal.getProposalStatus(_proposalId);\n require(status[2], \"Not passed\");\n escrow.released = true;\n\n IERC20 token = IERC20(escrow.token);\n\n emit EscrowReleased(\n _baal,\n _proposalId,\n escrow.applicant,\n escrow.safe,\n escrow.amount\n );\n\n require(\n token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),\n \"Transfer failed\"\n );\n }\n}\n" + }, + "contracts/utils/BaalVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"./DelegationEIP712Upgradeable.sol\";\n\n/**\n * @dev similar to Openzeplin ERC20Votes\n *\n * uses timestamp instead of block.number and auto self delegates.\n *\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\n * power can be queried through the public accessors {getPriorVotes}.\n *\n */\nabstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {\n using ECDSAUpgradeable for bytes32;\n\n struct Checkpoint {\n /*Baal checkpoint for marking number of delegated votes*/\n uint32 fromTimePoint; /*unix time for referencing voting balance*/\n uint256 votes; /*votes at given unix time*/\n }\n\n // DELEGATE TRACKING\n mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/\n mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/\n mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/\n mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/\n\n // SIGNATURE HELPERS\n bytes32 constant DELEGATION_TYPEHASH = keccak256(\"Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)\");\n\n event DelegateChanged(\n address indexed delegator,\n address indexed fromDelegate,\n address indexed toDelegate\n ); /*emits when an account changes its voting delegate*/\n event DelegateVotesChanged(\n address indexed delegate,\n uint256 previousBalance,\n uint256 newBalance\n ); /*emits when a delegate account's voting balance changes*/\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n /*If recipient is receiving their first shares, auto-self delegate*/\n if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {\n delegates[to] = to;\n }\n\n _moveDelegates(delegates[from], delegates[to], amount);\n }\n\n /// @notice Delegate votes from user to `delegatee`.\n /// @param delegatee The address to delegate votes to.\n function delegate(address delegatee) external virtual {\n _delegate(msg.sender, delegatee);\n }\n\n /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.\n /// @param delegatee The address to delegate 'votes' to.\n /// @param nonce The contract state required to match the signature.\n /// @param expiry The time at which to expire the signature.\n /// @param v The v signature\n /// @param r The r signature\n /// @param s The s signature\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public {\n require(now() <= expiry, \"ERC20Votes: signature expired\");\n address signer = ECDSAUpgradeable.recover(\n _hashTypedDataV4Delegation(\n keccak256(\n abi.encode(\n DELEGATION_TYPEHASH,\n keccak256(abi.encodePacked(name())),\n delegatee,\n nonce,\n expiry\n )\n )\n ),\n v,\n r,\n s\n );\n require(signer != address(0), \"ERC20Votes: invalid signer (0x0)\");\n require(nonce == delegationNonces[signer], \"ERC20Votes: invalid nonce\");\n\n delegationNonces[signer]++;\n _delegate(signer, delegatee);\n }\n\n /// @notice Delegates Baal voting weight.\n /// @param delegator The address to delegate 'votes' from.\n /// @param delegatee The address to delegate 'votes' to.\n function _delegate(address delegator, address delegatee) internal virtual {\n require(balanceOf(delegator) > 0, \"!shares\");\n address currentDelegate = delegates[delegator];\n delegates[delegator] = delegatee;\n\n _moveDelegates(\n currentDelegate,\n delegatee,\n uint256(balanceOf(delegator))\n );\n\n emit DelegateChanged(delegator, currentDelegate, delegatee);\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param srcRep The address to delegate 'votes' from.\n /// @param dstRep The address to delegate 'votes' to.\n /// @param amount The amount of votes to delegate\n function _moveDelegates(\n address srcRep,\n address dstRep,\n uint256 amount\n ) private {\n unchecked {\n if (srcRep != dstRep && amount != 0) {\n if (srcRep != address(0)) {\n uint256 srcRepNum = numCheckpoints[srcRep];\n uint256 srcRepOld = srcRepNum != 0\n ? getCheckpoint(srcRep, srcRepNum - 1).votes\n : 0;\n uint256 srcRepNew = srcRepOld - amount;\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\n }\n\n if (dstRep != address(0)) {\n uint256 dstRepNum = numCheckpoints[dstRep];\n uint256 dstRepOld = dstRepNum != 0\n ? getCheckpoint(dstRep, dstRepNum - 1).votes\n : 0;\n uint256 dstRepNew = dstRepOld + amount;\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\n }\n }\n }\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param delegatee The address to snapshot\n /// @param nCheckpoints The number of checkpoints delegatee has\n /// @param oldVotes The number of votes the delegatee had\n /// @param newVotes The number of votes the delegate has now\n function _writeCheckpoint(\n address delegatee,\n uint256 nCheckpoints,\n uint256 oldVotes,\n uint256 newVotes\n ) private {\n uint32 timePoint = uint32(now());\n\n unchecked {\n if (\n nCheckpoints != 0 &&\n checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint\n ) {\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\n } else {\n checkpoints[delegatee][nCheckpoints] = Checkpoint(\n timePoint,\n newVotes\n );\n numCheckpoints[delegatee] = nCheckpoints + 1;\n }\n }\n\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\n }\n\n /// @notice Returns the current timepoint.\n /// @return timePoint returns unix epoch timestamp\n function now() public view returns (uint256 timePoint) {\n return block.timestamp;\n }\n\n /// @notice Returns the prior number of `votes` for `account` as of `timePoint`.\n /// @param account The user to check `votes` for.\n /// @param timePoint The unix time to check `votes` for.\n /// @return votes Past `votes` delegated to `account`.\n function getPastVotes(address account, uint256 timePoint)\n external\n view\n virtual\n returns (uint256 votes)\n {\n require(timePoint < now(), \"!determined\"); /* Prior votes must be in the past*/\n\n uint256 nCheckpoints = numCheckpoints[account];\n if (nCheckpoints == 0) return 0;\n\n unchecked {\n if (\n getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=\n timePoint\n ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/\n if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;\n uint256 lower = 0;\n uint256 upper = nCheckpoints - 1;\n while (upper > lower) {\n /* Binary search to look for highest timePoint before desired timePoint*/\n uint256 center = upper - (upper - lower) / 2;\n Checkpoint memory cp = getCheckpoint(account, center);\n if (cp.fromTimePoint == timePoint) return cp.votes;\n else if (cp.fromTimePoint < timePoint) lower = center;\n else upper = center - 1;\n }\n votes = getCheckpoint(account, lower).votes;\n }\n }\n\n /// @notice Returns the current delegated `vote` balance for `account`.\n /// @param account The user to check delegated `votes` for.\n /// @return votes Current `votes` delegated to `account`.\n function getVotes(address account)\n external\n view\n virtual\n returns (uint256 votes)\n {\n uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/\n unchecked {\n votes = nCheckpoints != 0\n ? getCheckpoint(account, nCheckpoints - 1).votes\n : 0;\n }\n }\n\n function getCheckpoint(address delegatee, uint256 nCheckpoints)\n public\n view\n virtual\n returns (Checkpoint memory)\n {\n return checkpoints[delegatee][nCheckpoints];\n }\n}\n" + }, + "contracts/utils/DelegationEIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4Delegation}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract DelegationEIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME_DELEGATION;\n bytes32 private _HASHED_VERSION_DELEGATION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained_delegation(name, version);\n }\n\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME_DELEGATION = hashedName;\n _HASHED_VERSION_DELEGATION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\n }\n\n function _buildDomainSeparatorDelegation(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_NAME_DELEGATION;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_VERSION_DELEGATION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "contracts/utils/Poster.sol": { + "content": "/*\n██████╗ ██████╗ ███████╗████████╗███████╗██████╗\n██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗\n██████╔╝██║ ██║███████╗ ██║ █████╗ ██████╔╝\n██╔═══╝ ██║ ██║╚════██║ ██║ ██╔══╝ ██╔══██╗\n██║ ╚██████╔╝███████║ ██║ ███████╗██║ ██║\n╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝\nA ridiculously simple general purpose social media smart contract.\nIt takes two strings (content and tag) as parameters and emits those strings, along with msg.sender, as an event. That's it.\nMade with ❤️ by Auryn.eth\n*/\n// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity 0.8.7;\n\ncontract Poster {\n event NewPost(address indexed user, string content, string indexed tag);\n\n function post(string calldata content, string calldata tag) external {\n emit NewPost(msg.sender, content, tag);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "storageLayout", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/.chainId b/lib/Baal/deployments/mainnet/.chainId new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/lib/Baal/deployments/mainnet/.chainId @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/Baal.json b/lib/Baal/deployments/mainnet/Baal.json new file mode 100644 index 0000000..dd56eb2 --- /dev/null +++ b/lib/Baal/deployments/mainnet/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x5DcE1044A7E2E35D6524001796cee47252f18411", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner.json b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..53e7202 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner.json @@ -0,0 +1,330 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..92bcfd7 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,262 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..1fd3615 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAndVaultSummoner.json b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner.json new file mode 100644 index 0000000..32ea289 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..86492b1 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x882881c5A49A71C31B6956b06AF8C7a33AF1cdD6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..dc73832 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalSummoner.json b/lib/Baal/deployments/mainnet/BaalSummoner.json new file mode 100644 index 0000000..6f63d4f --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalSummoner_Implementation.json b/lib/Baal/deployments/mainnet/BaalSummoner_Implementation.json new file mode 100644 index 0000000..ab77504 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0x00BD22D2cE75422E7B16351F72524174672D5D64", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/BaalSummoner_Proxy.json b/lib/Baal/deployments/mainnet/BaalSummoner_Proxy.json new file mode 100644 index 0000000..bf871e0 --- /dev/null +++ b/lib/Baal/deployments/mainnet/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/Loot.json b/lib/Baal/deployments/mainnet/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/mainnet/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/Poster.json b/lib/Baal/deployments/mainnet/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/mainnet/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/Shares.json b/lib/Baal/deployments/mainnet/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/mainnet/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/mainnet/TributeMinion.json b/lib/Baal/deployments/mainnet/TributeMinion.json new file mode 100644 index 0000000..34e6b6b --- /dev/null +++ b/lib/Baal/deployments/mainnet/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/.chainId b/lib/Baal/deployments/optimisticEthereum/.chainId new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/.chainId @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/Baal.json b/lib/Baal/deployments/optimisticEthereum/Baal.json new file mode 100644 index 0000000..7d300cf --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x17234C0Ae25AF09fAf57B9D5ea2B93C1f220E800", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner.json b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..e6380b8 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner.json @@ -0,0 +1,375 @@ +{ + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0x84561C97156a128662B62952890469214FDC87bf", + "transactionIndex": 8, + "gasUsed": "333346", + "logsBloom": "0x02000000000000000000000000000000400000000000001000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800002000001000000000000000000000040000800000000020000000000000000000800000000000000000000000200000000400000000000000000000000000040000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000000000020000000000000000000001000000000000000000000000000000", + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3", + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e95f3d6a163e79cf057375c97175b1e22eaea02f" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a17a42ccf455f9aab21eb6ee9c41fdd28cf4d900" + ], + "data": "0x", + "logIndex": 22, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 23, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + } + ], + "blockNumber": 108683897, + "cumulativeGasUsed": "1383816", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..c9d0125 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,455 @@ +{ + "address": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "transactionIndex": 9, + "gasUsed": "2166814", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000200000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000", + "blockHash": "0x234e049b9add01f7fbed73317238d7f45c54ac861392b477095303d3a99ad7c1", + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "logs": [ + { + "transactionIndex": 9, + "blockNumber": 108683894, + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "address": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 54, + "blockHash": "0x234e049b9add01f7fbed73317238d7f45c54ac861392b477095303d3a99ad7c1" + } + ], + "blockNumber": 108683894, + "cumulativeGasUsed": "4411837", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "e59d9182173b42b6940606b788cb65c6", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_safeAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_forwarderAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initializationMintParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"initializationTokenParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"postInitializationActions\",\"type\":\"bytes[]\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setSummonerAddr(address)\":{\"details\":\"Sets the address of the BaalSummoner contract\",\"params\":{\"baalSummoner\":\"The address of the BaalSummoner contract\"}},\"summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])\":{\"details\":\"Summon a new Baal contract with a new set of tokens\",\"params\":{\"_forwarderAddr\":\"The address of the forwarder to be used, 0x0 if not set\",\"_safeAddr\":\"The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\",\"_saltNonce\":\"The salt nonce to be used for the Safe contract\",\"initializationMintParams\":\"The parameters for minting the tokens\",\"initializationTokenParams\":\"The parameters for deploying the tokens\",\"postInitializationActions\":\"The actions to be performed after the initialization\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":\"BaalAdvTokenSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../Baal.sol\\\";\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\ncontract BaalAdvTokenSummoner is\\n Initializable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n IBaalSummoner public _baalSummoner;\\n\\n event setSummoner(address summoner);\\n\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize() public initializer {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /**\\n * @dev Sets the address of the BaalSummoner contract\\n * @param baalSummoner The address of the BaalSummoner contract\\n */\\n function setSummonerAddr(address baalSummoner) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /**\\n * @dev Summon a new Baal contract with a new set of tokens\\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\\n * @param _saltNonce The salt nonce to be used for the Safe contract\\n * @param initializationMintParams The parameters for minting the tokens\\n * @param initializationTokenParams The parameters for deploying the tokens\\n * @param postInitializationActions The actions to be performed after the initialization\\n */\\n function summonBaalFromReferrer(\\n address _safeAddr,\\n address _forwarderAddr,\\n uint256 _saltNonce,\\n bytes calldata initializationMintParams,\\n bytes calldata initializationTokenParams,\\n bytes[] calldata postInitializationActions\\n ) external {\\n // summon tokens\\n (address _lootToken, address _sharesToken) = deployTokens(\\n initializationTokenParams\\n );\\n\\n // mint shares loot tokens\\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\\n\\n // summon baal with new tokens\\n address _baal = _baalSummoner.summonBaalFromReferrer(\\n abi.encode(\\n IBaalToken(_sharesToken).name(), \\n IBaalToken(_sharesToken).symbol(),\\n _safeAddr,\\n _forwarderAddr,\\n _lootToken,\\n _sharesToken\\n ),\\n postInitializationActions,\\n _saltNonce,\\n bytes32(bytes(\\\"DHAdvTokenSummoner\\\")) // referrer\\n );\\n\\n // change token ownership to baal\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n }\\n\\n /**\\n * @dev mintTokens\\n * @param initializationTokens The parameters for minting the tokens\\n * @param _lootToken The loot token address\\n * @param _sharesToken The shares token address\\n */\\n function mintTokens(\\n bytes calldata initializationTokens,\\n address _lootToken,\\n address _sharesToken\\n ) internal {\\n (\\n address[] memory summoners, // The address to mint initial tokens to\\n uint256[] memory summonerShares, // The amount of shares to mint\\n uint256[] memory summonerLoot // The amount of loot to mint\\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\\n\\n require(\\n summoners.length == summonerShares.length &&\\n summoners.length == summonerLoot.length,\\n \\\"!array parity\\\"\\n ); /*check array lengths match*/\\n\\n for (uint256 i = 0; i < summoners.length; i++) {\\n if (summonerLoot[i] > 0) {\\n IBaalToken(_lootToken).mint(\\n summoners[i],\\n summonerLoot[i]\\n ); /*grant `to` `amount` `loot`*/\\n }\\n if (summonerShares[i] > 0) {\\n IBaalToken(_sharesToken).mint(\\n summoners[i],\\n summonerShares[i]\\n ); /*grant `to` `amount` `shares`*/\\n }\\n }\\n }\\n\\n /**\\n * @dev deployTokens\\n * @param initializationParams The parameters for deploying the tokens\\n */\\n function deployTokens(\\n bytes calldata initializationParams\\n ) internal returns (address lootToken, address sharesToken) {\\n (\\n string\\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\\n string\\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\\n string\\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\\n string\\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\\n bool _transferableShares /* if shares is transferable */,\\n bool _transferableLoot /* if loot is transferable */\\n ) = abi.decode(\\n initializationParams,\\n (string, string, string, string, bool, bool)\\n );\\n\\n address lootSingleton = _baalSummoner.lootSingleton();\\n address sharesSingleton = _baalSummoner.sharesSingleton();\\n\\n lootToken = address(\\n new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector,\\n _lootName,\\n _lootSymbol\\n )\\n )\\n );\\n\\n sharesToken = address(\\n new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector,\\n _name,\\n _symbol\\n )\\n )\\n );\\n if (!_transferableShares) {\\n IBaalToken(sharesToken).pause();\\n }\\n if (!_transferableLoot) {\\n IBaalToken(lootToken).pause();\\n }\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n }\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x006b6737392584aee27cae0cad838ca0d07004a77b10600884a3813318775807\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b50610020610025565b6100e5565b600054610100900460ff16156100915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6125de61011f600039600081816104ec01528181610538015281816105e10152818161062401526106c001526125de6000f3fe6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setSummonerAddr(address)": { + "details": "Sets the address of the BaalSummoner contract", + "params": { + "baalSummoner": "The address of the BaalSummoner contract" + } + }, + "summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])": { + "details": "Summon a new Baal contract with a new set of tokens", + "params": { + "_forwarderAddr": "The address of the forwarder to be used, 0x0 if not set", + "_safeAddr": "The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe", + "_saltNonce": "The salt nonce to be used for the Safe contract", + "initializationMintParams": "The parameters for minting the tokens", + "initializationTokenParams": "The parameters for deploying the tokens", + "postInitializationActions": "The actions to be performed after the initialization" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3851, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 3854, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 4547, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3334, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 3454, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3833, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4148, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 9571, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)10150" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)10150": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..4e86cb6 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0x84561C97156a128662B62952890469214FDC87bf", + "transactionIndex": 8, + "gasUsed": "333346", + "logsBloom": "0x02000000000000000000000000000000400000000000001000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800002000001000000000000000000000040000800000000020000000000000000000800000000000000000000000200000000400000000000000000000000000040000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000000000020000000000000000000001000000000000000000000000000000", + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3", + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e95f3d6a163e79cf057375c97175b1e22eaea02f" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a17a42ccf455f9aab21eb6ee9c41fdd28cf4d900" + ], + "data": "0x", + "logIndex": 22, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 23, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + } + ], + "blockNumber": 108683897, + "cumulativeGasUsed": "1383816", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner.json b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner.json new file mode 100644 index 0000000..3c3b699 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0xb04111e7b4576164145EF97EB81fd43DA0F2D675", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..058320f --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x2a9886Bd3Dc34f05d56650105F5239F441FA2EDd", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..def96b6 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0xb04111e7b4576164145EF97EB81fd43DA0F2D675", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalSummoner.json b/lib/Baal/deployments/optimisticEthereum/BaalSummoner.json new file mode 100644 index 0000000..d56de61 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0x3E0eAdE343Ddc556a6Cf0f858e4f685ba303ce71", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Implementation.json b/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Implementation.json new file mode 100644 index 0000000..d8080d3 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Proxy.json b/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Proxy.json new file mode 100644 index 0000000..fdd552e --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x3E0eAdE343Ddc556a6Cf0f858e4f685ba303ce71", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/Loot.json b/lib/Baal/deployments/optimisticEthereum/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/Poster.json b/lib/Baal/deployments/optimisticEthereum/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/Shares.json b/lib/Baal/deployments/optimisticEthereum/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/TributeMinion.json b/lib/Baal/deployments/optimisticEthereum/TributeMinion.json new file mode 100644 index 0000000..73e2382 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/lib/Baal/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 0000000..6eb5ed9 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json b/lib/Baal/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json new file mode 100644 index 0000000..e4b3965 --- /dev/null +++ b/lib/Baal/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json @@ -0,0 +1,194 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../Baal.sol\";\nimport \"../interfaces/IBaalSummoner.sol\";\n\ncontract BaalAdvTokenSummoner is\n Initializable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n IBaalSummoner public _baalSummoner;\n\n event setSummoner(address summoner);\n\n event DeployBaalTokens(address lootToken, address sharesToken);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize() public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /**\n * @dev Sets the address of the BaalSummoner contract\n * @param baalSummoner The address of the BaalSummoner contract\n */\n function setSummonerAddr(address baalSummoner) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /**\n * @dev Summon a new Baal contract with a new set of tokens\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\n * @param _saltNonce The salt nonce to be used for the Safe contract\n * @param initializationMintParams The parameters for minting the tokens\n * @param initializationTokenParams The parameters for deploying the tokens\n * @param postInitializationActions The actions to be performed after the initialization\n */\n function summonBaalFromReferrer(\n address _safeAddr,\n address _forwarderAddr,\n uint256 _saltNonce,\n bytes calldata initializationMintParams,\n bytes calldata initializationTokenParams,\n bytes[] calldata postInitializationActions\n ) external {\n // summon tokens\n (address _lootToken, address _sharesToken) = deployTokens(\n initializationTokenParams\n );\n\n // mint shares loot tokens\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\n\n // summon baal with new tokens\n address _baal = _baalSummoner.summonBaalFromReferrer(\n abi.encode(\n IBaalToken(_sharesToken).name(), \n IBaalToken(_sharesToken).symbol(),\n _safeAddr,\n _forwarderAddr,\n _lootToken,\n _sharesToken\n ),\n postInitializationActions,\n _saltNonce,\n bytes32(bytes(\"DHAdvTokenSummoner\")) // referrer\n );\n\n // change token ownership to baal\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n }\n\n /**\n * @dev mintTokens\n * @param initializationTokens The parameters for minting the tokens\n * @param _lootToken The loot token address\n * @param _sharesToken The shares token address\n */\n function mintTokens(\n bytes calldata initializationTokens,\n address _lootToken,\n address _sharesToken\n ) internal {\n (\n address[] memory summoners, // The address to mint initial tokens to\n uint256[] memory summonerShares, // The amount of shares to mint\n uint256[] memory summonerLoot // The amount of loot to mint\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\n\n require(\n summoners.length == summonerShares.length &&\n summoners.length == summonerLoot.length,\n \"!array parity\"\n ); /*check array lengths match*/\n\n for (uint256 i = 0; i < summoners.length; i++) {\n if (summonerLoot[i] > 0) {\n IBaalToken(_lootToken).mint(\n summoners[i],\n summonerLoot[i]\n ); /*grant `to` `amount` `loot`*/\n }\n if (summonerShares[i] > 0) {\n IBaalToken(_sharesToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `shares`*/\n }\n }\n }\n\n /**\n * @dev deployTokens\n * @param initializationParams The parameters for deploying the tokens\n */\n function deployTokens(\n bytes calldata initializationParams\n ) internal returns (address lootToken, address sharesToken) {\n (\n string\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\n string\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\n string\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\n string\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\n bool _transferableShares /* if shares is transferable */,\n bool _transferableLoot /* if loot is transferable */\n ) = abi.decode(\n initializationParams,\n (string, string, string, string, bool, bool)\n );\n\n address lootSingleton = _baalSummoner.lootSingleton();\n address sharesSingleton = _baalSummoner.sharesSingleton();\n\n lootToken = address(\n new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector,\n _lootName,\n _lootSymbol\n )\n )\n );\n\n sharesToken = address(\n new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector,\n _name,\n _symbol\n )\n )\n );\n if (!_transferableShares) {\n IBaalToken(sharesToken).pause();\n }\n if (!_transferableLoot) {\n IBaalToken(lootToken).pause();\n }\n\n emit DeployBaalTokens(lootToken, sharesToken);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/.chainId b/lib/Baal/deployments/polygon/.chainId new file mode 100644 index 0000000..0973804 --- /dev/null +++ b/lib/Baal/deployments/polygon/.chainId @@ -0,0 +1 @@ +137 \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/Baal.json b/lib/Baal/deployments/polygon/Baal.json new file mode 100644 index 0000000..dd56eb2 --- /dev/null +++ b/lib/Baal/deployments/polygon/Baal.json @@ -0,0 +1,1572 @@ +{ + "address": "0x5DcE1044A7E2E35D6524001796cee47252f18411", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAdvTokenSummoner.json b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..53e7202 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner.json @@ -0,0 +1,330 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..92bcfd7 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,262 @@ +{ + "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..1fd3615 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAndVaultSummoner.json b/lib/Baal/deployments/polygon/BaalAndVaultSummoner.json new file mode 100644 index 0000000..32ea289 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAndVaultSummoner.json @@ -0,0 +1,548 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..86492b1 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,480 @@ +{ + "address": "0x882881c5A49A71C31B6956b06AF8C7a33AF1cdD6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..dc73832 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x594E630efbe8dbd810c168e3878817a4094bB312", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalSummoner.json b/lib/Baal/deployments/polygon/BaalSummoner.json new file mode 100644 index 0000000..6f63d4f --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalSummoner.json @@ -0,0 +1,621 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalSummoner_Implementation.json b/lib/Baal/deployments/polygon/BaalSummoner_Implementation.json new file mode 100644 index 0000000..ab77504 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalSummoner_Implementation.json @@ -0,0 +1,553 @@ +{ + "address": "0x00BD22D2cE75422E7B16351F72524174672D5D64", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/BaalSummoner_Proxy.json b/lib/Baal/deployments/polygon/BaalSummoner_Proxy.json new file mode 100644 index 0000000..bf871e0 --- /dev/null +++ b/lib/Baal/deployments/polygon/BaalSummoner_Proxy.json @@ -0,0 +1,149 @@ +{ + "address": "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/Loot.json b/lib/Baal/deployments/polygon/Loot.json new file mode 100644 index 0000000..5c2699c --- /dev/null +++ b/lib/Baal/deployments/polygon/Loot.json @@ -0,0 +1,698 @@ +{ + "address": "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/Poster.json b/lib/Baal/deployments/polygon/Poster.json new file mode 100644 index 0000000..f46030f --- /dev/null +++ b/lib/Baal/deployments/polygon/Poster.json @@ -0,0 +1,48 @@ +{ + "address": "0x000000000000cd17345801aa8147b8D3950260FF", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "NewPost", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "content", + "type": "string" + }, + { + "internalType": "string", + "name": "tag", + "type": "string" + } + ], + "name": "post", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/Shares.json b/lib/Baal/deployments/polygon/Shares.json new file mode 100644 index 0000000..c617021 --- /dev/null +++ b/lib/Baal/deployments/polygon/Shares.json @@ -0,0 +1,977 @@ +{ + "address": "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/polygon/TributeMinion.json b/lib/Baal/deployments/polygon/TributeMinion.json new file mode 100644 index 0000000..9f1aefe --- /dev/null +++ b/lib/Baal/deployments/polygon/TributeMinion.json @@ -0,0 +1,233 @@ +{ + "address": "0x51498dDdd2A8cdeC82932E08A37eBaF346C38EFd", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/.chainId b/lib/Baal/deployments/sepolia/.chainId new file mode 100644 index 0000000..bd8d1cd --- /dev/null +++ b/lib/Baal/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/Baal.json b/lib/Baal/deployments/sepolia/Baal.json new file mode 100644 index 0000000..a87e9b1 --- /dev/null +++ b/lib/Baal/deployments/sepolia/Baal.json @@ -0,0 +1,2362 @@ +{ + "address": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard_", + "type": "address" + } + ], + "name": "NotIERC165Compliant", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAvatar", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAvatar", + "type": "address" + } + ], + "name": "AvatarSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "CancelProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "voting", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "grace", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorum", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetention", + "type": "uint256" + } + ], + "name": "GovernanceConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "adminLock", + "type": "bool" + } + ], + "name": "LockAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "governorLock", + "type": "bool" + } + ], + "name": "LockGovernor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "managerLock", + "type": "bool" + } + ], + "name": "LockManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "LootPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "passed", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "actionFailed", + "type": "bool" + } + ], + "name": "ProcessProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "Ragequit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "SetTrustedForwarder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "lootPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sharesPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gracePeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "votingPeriod", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalOffering", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "quorumPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sponsorThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minRetentionPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalShares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalLoot", + "type": "uint256" + } + ], + "name": "SetupComplete", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "shaman", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "permission", + "type": "uint256" + } + ], + "name": "ShamanSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "SharesPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "votingStarts", + "type": "uint256" + } + ], + "name": "SponsorProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "selfSponsor", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "SubmitProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "SubmitVote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousTarget", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newTarget", + "type": "address" + } + ], + "name": "TargetSet", + "type": "event" + }, + { + "inputs": [], + "name": "adminLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "avatar", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "from", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "burnShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "cancelProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "executeAsBaal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuard", + "outputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "getProposalStatus", + "outputs": [ + { + "internalType": "bool[4]", + "name": "", + "type": "bool[4]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governorLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gracePeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guard", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_transactions", + "type": "bytes" + } + ], + "name": "hashOperation", + "outputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isAdmin", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shaman", + "type": "address" + } + ], + "name": "isManager", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "latestSponsoredProposalId", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managerLock", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "memberVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minRetentionPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintLoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amount", + "type": "uint256[]" + } + ], + "name": "mintShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "multisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + } + ], + "name": "processProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalOffering", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "prevProposalId", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingStarts", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "votingEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "graceEnds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yesVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "noVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAndLootAtVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTotalSharesAtSponsor", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sponsor", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "proposalDataHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sharesToBurn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lootToBurn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "ragequit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "pauseShares", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseLoot", + "type": "bool" + } + ], + "name": "setAdminConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_avatar", + "type": "address" + } + ], + "name": "setAvatar", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_governanceConfig", + "type": "bytes" + } + ], + "name": "setGovernanceConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_shamans", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_permissions", + "type": "uint256[]" + } + ], + "name": "setShamans", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setTarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_trustedForwarderAddress", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_initializationParams", + "type": "bytes" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "shamans", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sharesToken", + "outputs": [ + { + "internalType": "contract IBaalToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "sponsorProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sponsorThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum Baal.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proposalData", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalGas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "submitVote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "id", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "submitVoteWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "target", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalLoot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "versionRecipient", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "votingNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x2e927001ef15a90578a6096fa6005e1d13dbc2d6687b0c3e26c398eeea852d0c", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "transactionIndex": 36, + "gasUsed": "5163841", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000001000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000002000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd0dee02b994ed929a1f2cb2c9e26cfae3b9ca2d6a4a3e189c645c265d5bdb5e3", + "transactionHash": "0x2e927001ef15a90578a6096fa6005e1d13dbc2d6687b0c3e26c398eeea852d0c", + "logs": [ + { + "transactionIndex": 36, + "blockNumber": 4816765, + "transactionHash": "0x2e927001ef15a90578a6096fa6005e1d13dbc2d6687b0c3e26c398eeea852d0c", + "address": "0xc650B598b095613cCddF0f49570FfA475175A5D5", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 7, + "blockHash": "0xd0dee02b994ed929a1f2cb2c9e26cfae3b9ca2d6a4a3e189c645c265d5bdb5e3" + } + ], + "blockNumber": 4816765, + "cumulativeGasUsed": "6658136", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "928daf6847beb441da40e990eb20d125", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guard_\",\"type\":\"address\"}],\"name\":\"NotIERC165Compliant\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAvatar\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAvatar\",\"type\":\"address\"}],\"name\":\"AvatarSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"}],\"name\":\"CancelProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"guard\",\"type\":\"address\"}],\"name\":\"ChangedGuard\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"voting\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"grace\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newOffering\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorum\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sponsor\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minRetention\",\"type\":\"uint256\"}],\"name\":\"GovernanceConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"adminLock\",\"type\":\"bool\"}],\"name\":\"LockAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"governorLock\",\"type\":\"bool\"}],\"name\":\"LockGovernor\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"managerLock\",\"type\":\"bool\"}],\"name\":\"LockManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"name\":\"LootPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"passed\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"actionFailed\",\"type\":\"bool\"}],\"name\":\"ProcessProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"lootToBurn\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"sharesToBurn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"Ragequit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"SetTrustedForwarder\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"lootPaused\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sharesPaused\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gracePeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"votingPeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalOffering\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"quorumPercent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sponsorThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minRetentionPercent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalShares\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalLoot\",\"type\":\"uint256\"}],\"name\":\"SetupComplete\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"permission\",\"type\":\"uint256\"}],\"name\":\"ShamanSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"paused\",\"type\":\"bool\"}],\"name\":\"SharesPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"votingStarts\",\"type\":\"uint256\"}],\"name\":\"SponsorProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"proposalDataHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expiration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"selfSponsor\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"SubmitProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposal\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"SubmitVote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousTarget\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newTarget\",\"type\":\"address\"}],\"name\":\"TargetSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"adminLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"avatar\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"from\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"burnLoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"from\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"burnShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"cancelProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_calls\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"encodeMultisend\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedMultisend\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"executeAsBaal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGuard\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_guard\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"getProposalStatus\",\"outputs\":[{\"internalType\":\"bool[4]\",\"name\":\"\",\"type\":\"bool[4]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governorLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gracePeriod\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"guard\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_transactions\",\"type\":\"bytes\"}],\"name\":\"hashOperation\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isGovernor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"shaman\",\"type\":\"address\"}],\"name\":\"isManager\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSponsoredProposalId\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lootToken\",\"outputs\":[{\"internalType\":\"contract IBaalToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managerLock\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"memberVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minRetentionPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"to\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"mintLoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"to\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amount\",\"type\":\"uint256[]\"}],\"name\":\"mintShares\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"multisendLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"}],\"name\":\"processProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalOffering\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposals\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"prevProposalId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"votingStarts\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"votingEnds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"graceEnds\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"yesVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"noVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTotalSharesAndLootAtVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTotalSharesAtSponsor\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sponsor\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"proposalDataHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sharesToBurn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lootToBurn\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"ragequit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"pauseShares\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"pauseLoot\",\"type\":\"bool\"}],\"name\":\"setAdminConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_avatar\",\"type\":\"address\"}],\"name\":\"setAvatar\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_governanceConfig\",\"type\":\"bytes\"}],\"name\":\"setGovernanceConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_guard\",\"type\":\"address\"}],\"name\":\"setGuard\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_shamans\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_permissions\",\"type\":\"uint256[]\"}],\"name\":\"setShamans\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setTarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_trustedForwarderAddress\",\"type\":\"address\"}],\"name\":\"setTrustedForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_initializationParams\",\"type\":\"bytes\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"shamans\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharesToken\",\"outputs\":[{\"internalType\":\"contract IBaalToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"sponsorProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sponsorThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum Baal.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proposalData\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalGas\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"submitProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"submitVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"id\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"submitVoteWithSig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalLoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"trustedForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"versionRecipient\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"votingNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"burnLoot(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to burn\",\"from\":\"Array of addresses to lose loot\"}},\"burnShares(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to burn\",\"from\":\"Array of addresses to lose shares\"}},\"cancelProposal(uint32)\":{\"details\":\"Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\",\"params\":{\"id\":\"Number of proposal in `proposals` mapping to process for execution.\"}},\"executeAsBaal(address,uint256,bytes)\":{\"details\":\"Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\",\"params\":{\"_data\":\"arbitrary transaction data\",\"_to\":\"address to call\",\"_value\":\"value to include in wei\"}},\"getProposalStatus(uint32)\":{\"params\":{\"id\":\"Number of proposal in proposals\"},\"returns\":{\"_0\":\"[cancelled, processed, passed, actionFailed]\"}},\"isAdmin(address)\":{\"params\":{\"shaman\":\"Address attempting to execute admin permissioned functions\"}},\"isGovernor(address)\":{\"params\":{\"shaman\":\"Address attempting to execute governor permissioned functions\"}},\"isManager(address)\":{\"params\":{\"shaman\":\"Address attempting to execute manager permissioned functions\"}},\"mintLoot(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to mint\",\"to\":\"Array of addresses to mint loot\"}},\"mintShares(address[],uint256[])\":{\"params\":{\"amount\":\"Array of amounts to mint\",\"to\":\"Array of addresses to receive shares\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"processProposal(uint32,bytes)\":{\"details\":\"Proposal must have succeeded, not been processed, not expired, retention threshold must be met\",\"params\":{\"id\":\"Number of proposal in `proposals` mapping to process for execution.\",\"proposalData\":\"Packed multisend data to execute via Gnosis multisend library\"}},\"ragequit(address,uint256,uint256,address[])\":{\"params\":{\"lootToBurn\":\"Baal pure economic weight to burn.\",\"sharesToBurn\":\"Baal voting weight to burn.\",\"to\":\"Account that receives 'fair share'.\",\"tokens\":\"Array of tokens to include in rage quit calculation\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAdminConfig(bool,bool)\":{\"params\":{\"pauseLoot\":\"Turn loot transfers on or off\",\"pauseShares\":\"Turn share transfers on or off\"}},\"setAvatar(address)\":{\"details\":\"Sets the avatar to a new avatar (`newAvatar`).\"},\"setGovernanceConfig(bytes)\":{\"params\":{\"_governanceConfig\":\"Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\"}},\"setGuard(address)\":{\"details\":\"Set a guard that checks transactions before execution.\",\"params\":{\"_guard\":\"The address of the guard to be used or the 0 address to disable the guard.\"}},\"setShamans(address[],uint256[])\":{\"params\":{\"_permissions\":\"Permission level of each shaman in _shamans\",\"_shamans\":\"Addresses of shaman contracts\"}},\"setTarget(address)\":{\"details\":\"Sets the target to a new target (`newTarget`).\"},\"setTrustedForwarder(address)\":{\"params\":{\"_trustedForwarderAddress\":\"Trusted forwarder's address\"}},\"setUp(bytes)\":{\"params\":{\"_initializationParams\":\"Encoded setup information.\"}},\"sponsorProposal(uint32)\":{\"params\":{\"id\":\"Number of proposal in `proposals` mapping to sponsor.\"}},\"state(uint32)\":{\"params\":{\"id\":\"Number of proposal in proposals\"},\"returns\":{\"_0\":\"Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed \\\\-> Cancelled \\\\-> Defeated\"}},\"submitProposal(bytes,uint32,uint256,string)\":{\"params\":{\"details\":\"Context for proposal.\",\"proposalData\":\"Multisend encoded transactions or proposal data\"},\"returns\":{\"_0\":\"proposal Count for submitted proposal.\"}},\"submitVote(uint32,bool)\":{\"params\":{\"approved\":\"If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\",\"id\":\"Number of proposal in `proposals` mapping to cast vote on.\"}},\"submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)\":{\"params\":{\"approved\":\"If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\",\"expiry\":\"Expiration of signature.\",\"id\":\"Number of proposal in `proposals` mapping to cast vote on.\",\"r\":\"r in signature\",\"s\":\"s in signature\",\"v\":\"v in signature\",\"voter\":\"Address of member who submitted vote.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Baal ';_;'.\",\"version\":1},\"userdoc\":{\"errors\":{\"NotIERC165Compliant(address)\":[{\"notice\":\"`guard_` does not implement IERC165.\"}]},\"kind\":\"user\",\"methods\":{\"burnLoot(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to burn loot.\"},\"burnShares(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to burn shares.\"},\"cancelProposal(uint32)\":{\"notice\":\"Cancel proposal prior to execution\"},\"executeAsBaal(address,uint256,bytes)\":{\"notice\":\"Can only be called by the avatar which means this can only be called if passed by another proposal or by a delegated signer on the Safe\"},\"getProposalStatus(uint32)\":{\"notice\":\"Helper to get recorded proposal flags\"},\"hashOperation(bytes)\":{\"notice\":\"Returns the keccak256 hash of calldata\"},\"isAdmin(address)\":{\"notice\":\"Helper to check if shaman permission contains admin capabilities\"},\"isGovernor(address)\":{\"notice\":\"Helper to check if shaman permission contains governor capabilities\"},\"isManager(address)\":{\"notice\":\"Helper to check if shaman permission contains manager capabilities\"},\"isTrustedForwarder(address)\":{\"notice\":\"return if the forwarder is trusted to forward relayed transactions to us. the forwarder is required to verify the sender's signature, and verify the call is not a replay.\"},\"lockAdmin()\":{\"notice\":\"Lock admin so setShamans cannot be called with admin changes\"},\"lockGovernor()\":{\"notice\":\"Lock governor so setShamans cannot be called with governor changes\"},\"lockManager()\":{\"notice\":\"Lock manager so setShamans cannot be called with manager changes\"},\"mintLoot(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to mint loot.\"},\"mintShares(address[],uint256[])\":{\"notice\":\"Baal-or-manager-only function to mint shares.\"},\"processProposal(uint32,bytes)\":{\"notice\":\"Process `proposal` & execute internal functions.\"},\"ragequit(address,uint256,uint256,address[])\":{\"notice\":\"Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\"},\"setAdminConfig(bool,bool)\":{\"notice\":\"Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\"},\"setAvatar(address)\":{\"notice\":\"Can only be called by the current owner.\"},\"setGovernanceConfig(bytes)\":{\"notice\":\"Baal-or-governance-only function to change periods.\"},\"setShamans(address[],uint256[])\":{\"notice\":\"Baal-only function to set shaman status.\"},\"setTarget(address)\":{\"notice\":\"Can only be called by the current owner.\"},\"setTrustedForwarder(address)\":{\"notice\":\"Baal-or-governance only function to set trusted forwarder for meta-transactions.\"},\"setUp(bytes)\":{\"notice\":\"Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\"},\"sponsorProposal(uint32)\":{\"notice\":\"Sponsor proposal to Baal `members` for approval within voting period.\"},\"state(uint32)\":{\"notice\":\"State helper to determine proposal state\"},\"submitProposal(bytes,uint32,uint256,string)\":{\"notice\":\"Submit proposal to Baal `members` for approval within given voting period.\"},\"submitVote(uint32,bool)\":{\"notice\":\"Submit vote - proposal must exist & voting period must not have ended.\"},\"submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)\":{\"notice\":\"Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\"},\"totalLoot()\":{\"notice\":\"Helper to check total supply of child loot contract\"},\"totalShares()\":{\"notice\":\"Helper to check total supply of child shares contract\"},\"totalSupply()\":{\"notice\":\"Helper to check total supply of loot and shares\"}},\"notice\":\"Flexible guild contract inspired by Moloch DAO framework.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Baal.sol\":\"Baal\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615bef80620000f46000396000f3fe6080604052600436106103a25760003560e01c80638009ba1f116101e7578063cf043df31161010d578063ed0cdf15116100a0578063f460124d1161006f578063f460124d14610b99578063f81cbd2614610bb9578063fab514c014610bcf578063fe47668614610bef57600080fd5b8063ed0cdf1514610b19578063ee4d88ed14610b39578063f2fde38b14610b59578063f3ae241514610b7957600080fd5b8063da35c664116100dc578063da35c66414610a95578063da74222814610ab9578063e19a9dd914610ad9578063e43581b814610af957600080fd5b8063cf043df3146109fa578063d33defc714610a1a578063d4b8399214610a55578063d61f27ae14610a7557600080fd5b8063a4f9edbf11610185578063b634e4e011610154578063b634e4e014610979578063c00d077514610996578063c4e931f6146109bd578063c9106389146109dc57600080fd5b8063a4f9edbf14610904578063acca30a214610924578063b1e3f40c14610939578063b3c98bbb1461095957600080fd5b806398a527cc116101c157806398a527cc1461088a5780639a2f747f146108aa578063a06db7dc146108c0578063a26ec96e146108e457600080fd5b80638009ba1f1461083657806383bf8459146108565780638da5cb5b1461086c57600080fd5b80634526d846116102cc5780635ec286961161026a578063715018a611610239578063715018a6146107c3578063776d1a01146107d85780637ceab3b1146107f85780637da0a8771461081857600080fd5b80635ec286961461074e578063635e99aa1461076e57806367f61f0714610783578063706a6e93146107a357600080fd5b806352ba1da7116102a657806352ba1da7146106a4578063572b6c05146106d15780635aef7de6146107005780635cfd6f7e1461073857600080fd5b80634526d846146106355780634630affc14610655578063486ff0cd1461068257600080fd5b8063136d731a11610344578063258bfe2f11610313578063258bfe2f146105c05780633232444c146105e05780633a82ffc81461060d5780633a98ef391461062057600080fd5b8063136d731a1461055357806316fd265d1461056857806318160ddd1461057d57806324d7806c146105a057600080fd5b8063056b0dcd11610380578063056b0dcd146104d1578063086cfca8146104f35780630a796e19146105135780630f656a211461053357600080fd5b8063013cf08b146103a7578063027cdf451461046e57806302a251a314610498575b600080fd5b3480156103b357600080fd5b5061044c6103c2366004614d28565b60d9602052600090815260409020805460018201546002830154600384015460048501546005860154600787015460089097015463ffffffff80881698600160201b8904821698600160401b8104831698600160601b8204841698600160801b8304851698600160a01b90930490941696909593949193909290916001600160a01b03909116908d565b6040516104659d9c9b9a99989796959493929190614d41565b60405180910390f35b34801561047a57600080fd5b5060d5546104889060ff1681565b6040519015158152602001610465565b3480156104a457600080fd5b5060d0546104bc90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610465565b3480156104dd57600080fd5b506104f16104ec366004614ded565b610c1c565b005b3480156104ff57600080fd5b506104f161050e366004614e4b565b611127565b34801561051f57600080fd5b506104f161052e366004614e7a565b611181565b34801561053f57600080fd5b506104f161054e366004614ee2565b6114b5565b34801561055f57600080fd5b506104f1611763565b34801561057457600080fd5b506104f16117f4565b34801561058957600080fd5b5061059261186e565b604051908152602001610465565b3480156105ac57600080fd5b506104886105bb366004614e4b565b61188f565b3480156105cc57600080fd5b506105926105db366004615010565b6118d4565b3480156105ec57600080fd5b506105926105fb366004614e4b565b60d66020526000908152604090205481565b61059261061b36600461508d565b611904565b34801561062c57600080fd5b50610592611f55565b34801561064157600080fd5b506104f1610650366004614ee2565b611fc3565b34801561066157600080fd5b50610675610670366004614e7a565b612092565b604051610465919061511a565b34801561068e57600080fd5b50610697612103565b60405161046591906151a9565b3480156106b057600080fd5b506105926106bf366004614e4b565b60d86020526000908152604090205481565b3480156106dd57600080fd5b506104886106ec366004614e4b565b60ce546001600160a01b0391821691161490565b34801561070c57600080fd5b50606654610720906001600160a01b031681565b6040516001600160a01b039091168152602001610465565b34801561074457600080fd5b5061059260d35481565b34801561075a57600080fd5b506104f1610769366004614ee2565b612191565b34801561077a57600080fd5b50610592612260565b34801561078f57600080fd5b506104f161079e3660046151bc565b6122aa565b3480156107af57600080fd5b506104f16107be3660046151da565b6122ce565b3480156107cf57600080fd5b506104f16126ba565b3480156107e457600080fd5b506104f16107f3366004614e4b565b6126ce565b34801561080457600080fd5b50606554610720906001600160a01b031681565b34801561082457600080fd5b5060ce546001600160a01b0316610720565b34801561084257600080fd5b5060d054610720906001600160a01b031681565b34801561086257600080fd5b5061059260d45481565b34801561087857600080fd5b506033546001600160a01b0316610720565b34801561089657600080fd5b506104f16108a5366004614ee2565b612728565b3480156108b657600080fd5b5061059260d15481565b3480156108cc57600080fd5b5060d0546104bc90600160c01b900463ffffffff1681565b3480156108f057600080fd5b5060d5546104889062010000900460ff1681565b34801561091057600080fd5b506104f161091f366004615010565b6127f7565b34801561093057600080fd5b506104f1612d49565b34801561094557600080fd5b506104f1610954366004614ee2565b612dce565b34801561096557600080fd5b506104f161097436600461522e565b612e9d565b34801561098557600080fd5b5060da546104bc9063ffffffff1681565b3480156109a257600080fd5b5060da5461072090600160201b90046001600160a01b031681565b3480156109c957600080fd5b5060d55461048890610100900460ff1681565b3480156109e857600080fd5b506065546001600160a01b0316610720565b348015610a0657600080fd5b506104f1610a1536600461527d565b612f7e565b348015610a2657600080fd5b50610488610a35366004615306565b60d760209081526000928352604080842090915290825290205460ff1681565b348015610a6157600080fd5b50606754610720906001600160a01b031681565b348015610a8157600080fd5b50610697610a90366004615334565b613249565b348015610aa157600080fd5b5060d0546104bc90600160e01b900463ffffffff1681565b348015610ac557600080fd5b506104f1610ad4366004614e4b565b613310565b348015610ae557600080fd5b506104f1610af4366004614e4b565b6133bf565b348015610b0557600080fd5b50610488610b14366004614e4b565b6134c1565b348015610b2557600080fd5b506104f1610b34366004615408565b613502565b348015610b4557600080fd5b506104f1610b54366004615010565b613611565b348015610b6557600080fd5b506104f1610b74366004614e4b565b61386f565b348015610b8557600080fd5b50610488610b94366004614e4b565b6138e5565b348015610ba557600080fd5b5060cf54610720906001600160a01b031681565b348015610bc557600080fd5b5061059260d25481565b348015610bdb57600080fd5b506104f1610bea366004614e7a565b613925565b348015610bfb57600080fd5b50610c0f610c0a366004614e7a565b613aea565b6040516104659190615487565b6066546001600160a01b0316610c30613cc6565b6001600160a01b03161480610c4b5750610c4b6105bb613cc6565b610c8d5760405162461bcd60e51b815260206004820152600e60248201526d10b130b0b610131010b0b236b4b760911b60448201526064015b60405180910390fd5b818015610d0e575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906154a1565b155b15610db55760d060009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b5050604051600181527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a1610ed8565b81158015610e35575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3591906154a1565b15610ed85760d060009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050604051600081527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a15b808015610f59575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906154a1565b155b156110005760cf60009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b5050604051600181527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb925060200190505b60405180910390a15050565b80158015611080575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108091906154a1565b156111235760cf60009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b5050604051600081527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb9250602001905060405180910390a15b5050565b61112f613cd0565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce34290600090a35050565b611189613d49565b63ffffffff8116600090815260d96020526040902060d35460d0546001600160a01b0316639ab24eb06111ba613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156111fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122291906154be565b101561125b5760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600161126683613aea565b600781111561127757611277615471565b146112b15760405162461bcd60e51b815260206004820152600a602482015269085cdd589b5a5d1d195960b21b6044820152606401610c84565b8054600160a01b900463ffffffff161580611307575060d05463ffffffff600160c01b82048116916112ec91600160a01b90910416426154ed565b6112f691906154ed565b8154600160a01b900463ffffffff16115b61133d5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b805463ffffffff42818116600160401b026bffffffff00000000000000001984168117855560d08054600160a01b90819004851684018516600160601b0263ffffffff60601b1990931667ffffffffffffffff60401b19909616959095179190911780865590549384048316909101600160c01b9093048216929092018116600160801b0263ffffffff60801b1983168117845560da54600160201b92169190910267ffffffff000000001990911673ffffffff0000000000000000ffffffff000000001990921691909117178155611414613cc6565b6007820180546001600160a01b0319166001600160a01b039290921691909117905561143e61186e565b600482015561144b611f55565b600582015560da805463ffffffff191663ffffffff84169081179091554290611472613cc6565b6001600160a01b03167fd45ad122361f16d6f50d7c4a73638f20ee48eff6186af15224e2a4a1f6d5017160405160405180910390a4506114b26001609c55565b50565b6066546001600160a01b03166114c9613cc6565b6001600160a01b0316146114ef5760405162461bcd60e51b8152600401610c8490615505565b82811461150e5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57600083838381811061152d5761152d61554b565b60d5546020909102929092013592505060ff16156115aa5780600114158015611557575080600314155b8015611564575080600514155b8015611571575080600714155b6115aa5760405162461bcd60e51b815260206004820152600a60248201526961646d696e206c6f636b60b01b6044820152606401610c84565b60d554610100900460ff161561162157806002141580156115cc575080600314155b80156115d9575080600614155b80156115e6575080600714155b6116215760405162461bcd60e51b815260206004820152600c60248201526b6d616e61676572206c6f636b60a01b6044820152606401610c84565b60d55462010000900460ff161561169a5780600414158015611644575080600514155b8015611651575080600614155b801561165e575080600714155b61169a5760405162461bcd60e51b815260206004820152600d60248201526c676f7665726e6f72206c6f636b60981b6044820152606401610c84565b8060d660008888868181106116b1576116b161554b565b90506020020160208101906116c69190614e4b565b6001600160a01b031681526020810191909152604001600020558585838181106116f2576116f261554b565b90506020020160208101906117079190614e4b565b6001600160a01b03167fc456d076c1245c6b9759b3cdcb169e14e00a7739897e501844c8fe5fca6cb2608260405161174191815260200190565b60405180910390a2508061175481615561565b915050611511565b5050505050565b6066546001600160a01b0316611777613cc6565b6001600160a01b03161461179d5760405162461bcd60e51b8152600401610c8490615505565b60d5805462ff0000191662010000908117918290556040517fd9574ee4ccdf21db87aa2c1d1fee3248522d79c07c54bde4a9edeb0620bef71f926117ea92900460ff161515815260200190565b60405180910390a1565b6066546001600160a01b0316611808613cc6565b6001600160a01b03161461182e5760405162461bcd60e51b8152600401610c8490615505565b60d5805460ff191660019081179091556040519081527f5e1c9f68365556a24387c25fd0922af31039bcfc65d36caac57401d310948e59906020016117ea565b6000611878611f55565b611880612260565b61188a91906154ed565b905090565b6001600160a01b038116600090815260d6602052604081205460018114806118b75750806003145b806118c25750806005145b806118cd5750806007145b9392505050565b6000816040516020016118e791906151a9565b604051602081830303815290604052805190602001209050919050565b600061190e613d49565b63ffffffff85161580611954575060d05463ffffffff600160c01b820481169161194191600160a01b90910416426154ed565b61194b91906154ed565b8563ffffffff16115b61198a5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b6301312d008411156119d05760405162461bcd60e51b815260206004820152600f60248201526e0c4c2c2d88ec2e640e8de40d0d2ced608b1b6044820152606401610c84565b60d35460d054600091906001600160a01b0316639ab24eb06119f0613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5891906154be565b10611a6557506001611b4c565b60d1543414611ab65760405162461bcd60e51b815260206004820152601960248201527f4261616c20726571756972657320616e206f66666572696e67000000000000006044820152606401610c84565b6067546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611b03576040519150601f19603f3d011682016040523d82523d6000602084013e611b08565b606091505b5050905080611b4a5760405162461bcd60e51b815260206004820152600e60248201526d18dbdd5b19081b9bdd081cd95b9960921b6044820152606401610c84565b505b6000611b8d89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b60d08054919250600160e01b90910463ffffffff1690601c611bae8361557c565b91906101000a81548163ffffffff021916908363ffffffff16021790555050604051806101c0016040528060d0601c9054906101000a900463ffffffff1663ffffffff16815260200183611c03576000611c0d565b60da5463ffffffff165b63ffffffff16815260200183611c24576000611c26565b425b63ffffffff16815260200183611c3d576000611c57565b60d054611c5790600160a01b900463ffffffff16426155a0565b63ffffffff16815260200183611c6e576000611c9d565b60d05463ffffffff600160c01b8204811691611c9391600160a01b90910416426155a0565b611c9d91906155a0565b63ffffffff1681526020018863ffffffff168152602001878152602001600081526020016000815260200183611cd4576000611cdc565b611cdc61186e565b815260200183611ced576000611cf5565b611cf5611f55565b8152604080516080810182526000808252602082810182905282840182905260608301919091528301520183611d2c576000611d34565b611d34613cc6565b6001600160a01b03168152602090810183905260d054600160e01b900463ffffffff908116600090815260d983526040908190208451815494860151928601516060870151608088015160a089015193871667ffffffffffffffff1990981697909717600160201b958716959095029490941767ffffffffffffffff60401b1916600160401b9186169190910263ffffffff60601b191617600160601b938516939093029290921767ffffffffffffffff60801b1916600160801b9484169490940263ffffffff60a01b191693909317600160a01b919092160217815560c0820151600182015560e0820151600282015561010082015160038201556101208201516004808301919091556101408301516005830155610160830151611e5f91600684019190614bef565b506101808201516007820180546001600160a01b0319166001600160a01b039092169190911790556101a0909101516008909101558115611ebf5760d05460da8054600160e01b90920463ffffffff1663ffffffff199092169190911790555b8060d0601c9054906101000a900463ffffffff1663ffffffff167fb9956173924f9c1204bae41dd3737d7ed1161846d13183879cdc03c4b9f8d01960d060149054906101000a900463ffffffff168c8c8c8c89428e8e604051611f2a999897969594939291906155f1565b60405180910390a3505060d0546001609c55600160e01b900463ffffffff1690509695505050505050565b60d054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188a91906154be565b6066546001600160a01b0316611fd7613cc6565b6001600160a01b03161480611ff25750611ff2610b94613cc6565b61200e5760405162461bcd60e51b8152600401610c8490615652565b82811461202d5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761208085858381811061204d5761204d61554b565b90506020020160208101906120629190614e4b565b8484848181106120745761207461554b565b90506020020135613daa565b8061208a81615561565b915050612030565b61209a614c81565b63ffffffff8216600090815260d9602052604080822081516080810192839052926006909101916004918390855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116120c8575094979650505050505050565b60db80546121109061567c565b80601f016020809104026020016040519081016040528092919081815260200182805461213c9061567c565b80156121895780601f1061215e57610100808354040283529160200191612189565b820191906000526020600020905b81548152906001019060200180831161216c57829003601f168201915b505050505081565b6066546001600160a01b03166121a5613cc6565b6001600160a01b031614806121c057506121c0610b94613cc6565b6121dc5760405162461bcd60e51b8152600401610c8490615652565b8281146121fb5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761224e85858381811061221b5761221b61554b565b90506020020160208101906122309190614e4b565b8484848181106122425761224261554b565b90506020020135613e15565b8061225881615561565b9150506121fe565b60cf54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b6122b2613d49565b6122c46122bd613cc6565b8383613e4e565b6111236001609c55565b6122d6613d49565b63ffffffff8316600090815260d96020526040902060078101546001600160a01b03166123305760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600561233b85613aea565b600781111561234c5761234c615471565b146123825760405162461bcd60e51b815260206004820152600660248201526521726561647960d01b6044820152606401610c84565b805460009061239d90600160201b900463ffffffff16613aea565b905060068160078111156123b3576123b3615471565b14806123d0575060038160078111156123ce576123ce615471565b145b806123ec575060078160078111156123ea576123ea615471565b145b806124085750600081600781111561240657612406615471565b145b6124455760405162461bcd60e51b815260206004820152600e60248201526d1c1c995d885c1c9bd8d95cdcd95960921b6044820152606401610c84565b816008015461248985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b146124cb5760405162461bcd60e51b8152602060048201526012602482015271696e636f72726563742063616c6c6461746160701b6044820152606401610c84565b600182015415806124e0575081600101545a10155b61251d5760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420656e6f7567682067617360901b6044820152606401610c84565b60068201805461ff0019166101001790558154600190600160a01b900463ffffffff161580159061255c5750825442600160a01b90910463ffffffff16105b15612565575060005b8080156125915750826005015460d25461257f91906156b1565b600284015461258f9060646156b1565b105b1561259a575060005b8080156125ca5750606460d45484600401546125b691906156b1565b6125c091906156d0565b6125c861186e565b105b156125d3575060005b801561264c5760068301805462ff0000191662010000179055604080516020601f870181900481028201810190925285815260009161262d919088908890819084018382808284376000920191909152506140a292505050565b90508061264a5760068401805463ff000000191663010000001790555b505b60068301546040805160ff62010000840481161515825263010000009093049092161515602083015263ffffffff8816917fb4571f7e4e2c2b6e6185e47ab5caa5fe34087299bd49fbae945a4583101ee3f0910160405180910390a25050506126b56001609c55565b505050565b6126c2613cd0565b6126cc60006140cb565b565b6126d6613cd0565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b6066546001600160a01b031661273c613cc6565b6001600160a01b031614806127575750612757610b94613cc6565b6127735760405162461bcd60e51b8152600401610c8490615652565b8281146127925760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c576127e58585838181106127b2576127b261554b565b90506020020160208101906127c79190614e4b565b8484848181106127d9576127d961554b565b9050602002013561411d565b806127ef81615561565b915050612795565b600054610100900460ff16158080156128175750600054600160ff909116105b806128315750303b158015612831575060005460ff166001145b6128945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c84565b6000805460ff1916600117905580156128b7576000805461ff0019166101001790555b6128bf613d49565b600080600080600080878060200190518101906128dc9190615742565b95509550955095509550955060006001600160a01b0316846001600160a01b03161415801561291357506001600160a01b03831615155b61294d5760405162461bcd60e51b815260206004820152600b60248201526a0c081859191c881d5cd95960aa1b6044820152606401610c84565b6040518060600160405280602d8152602001615b8d602d9139805161297a9160db91602090910190614c9f565b50612983614156565b61298b614185565b6129ca60405180604001604052806004815260200163566f746560e01b815250604051806040016040528060018152602001600d60fa1b8152506141b4565b6129d38361386f565b606680546001600160a01b0385166001600160a01b03199182168117909255606780549091169091179055612a07826141e5565b60cf80546001600160a01b03199081166001600160a01b038981169190911790925560d0805490911687831617905560da8054640100000000600160c01b031916600160201b87841681029190911791829055612a6b929104166000836001614207565b612aac5760405162461bcd60e51b8152602060048201526012602482015271063616c6c206661696c7572652073657475760741b6044820152606401610c84565b60cf5460408051635c975abb60e01b815290517f916f812584e0b001e8c6ab604fa549cc16c9d0b2f60b17aa0b4ff5eefe3e7725926001600160a01b031691635c975abb9160048083019260209291908290030181865afa158015612b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3991906154a1565b60d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb091906154a1565b60d05460d15460d25460d35460d454604080516306fdde0360e01b8152905163ffffffff600160c01b8804811697600160a01b810490911696959493926001600160a01b03909116916306fdde03916004808201926000929091908290030181865afa158015612c24573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4c91908101906157df565b60d060009054906101000a90046001600160a01b03166001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cc791908101906157df565b612ccf611f55565b612cd7612260565b604051612cef9c9b9a99989796959493929190615827565b60405180910390a1505050505050612d076001609c55565b8015611123576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610ff4565b6066546001600160a01b0316612d5d613cc6565b6001600160a01b031614612d835760405162461bcd60e51b8152600401610c8490615505565b60d5805461ff001916610100908117918290556040517fb496b9628e839102454d8b483ba451c4be96675009b637273a00e4ab6a59db72926117ea92900460ff161515815260200190565b6066546001600160a01b0316612de2613cc6565b6001600160a01b03161480612dfd5750612dfd610b94613cc6565b612e195760405162461bcd60e51b8152600401610c8490615652565b828114612e385760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57612e8b858583818110612e5857612e5861554b565b9050602002016020810190612e6d9190614e4b565b848484818110612e7f57612e7f61554b565b9050602002013561421f565b80612e9581615561565b915050612e3b565b6066546001600160a01b0316612eb1613cc6565b6001600160a01b031614612ed75760405162461bcd60e51b8152600401610c8490615505565b6000846001600160a01b0316848484604051612ef49291906158ad565b60006040518083038185875af1925050503d8060008114612f31576040519150601f19603f3d011682016040523d82523d6000602084013e612f36565b606091505b505090508061175c5760405162461bcd60e51b815260206004820152601460248201527363616c6c206661696c757265206578656375746560601b6044820152606401610c84565b612f86613d49565b86421115612fd65760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610c84565b6001600160a01b038816600090815260d8602052604090205486146130265760405162461bcd60e51b8152602060048201526006602482015265216e6f6e636560d01b6044820152606401610c84565b60007f8698fbcc7273f96a670eb203cb707d8ec171123f24eaf075b1e754b71119e59e60d060009054906101000a90046001600160a01b03166001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561309c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c491908101906157df565b6040516020016130d491906158bd565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905263ffffffff871660c082015285151560e082015261010001604051602081830303815290604052805190602001209050600061315182614258565b90506000613161828787876142a6565b90508a6001600160a01b0316816001600160a01b0316146131b85760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610c84565b6001600160a01b0381166131f85760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b6044820152606401610c84565b6001600160a01b038b16600090815260d8602052604081208054600192906132219084906154ed565b909155506132329050818989613e4e565b50505061323f6001609c55565b5050505050505050565b60608060005b84518110156132cc578160008560008885815181106132705761327061554b565b60200260200101515189868151811061328b5761328b61554b565b60200260200101516040516020016132a8969594939291906158d9565b604051602081830303815290604052915080806132c490615561565b91505061324f565b50806040516024016132de91906151a9565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b6066546001600160a01b0316613324613cc6565b6001600160a01b0316148061333f575061333f610b14613cc6565b61337f5760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b613388816141e5565b6040516001600160a01b038216907f8c2bee8063bb4464870b7dfa415ebb2fe80bfa73ba20d6fbf0d42791274667ff90600090a250565b6133c7613cd0565b6001600160a01b0381161561346d576040516301ffc9a760e01b815263736bd41d60e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015613421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061344591906154a1565b61346d576040516358b7533f60e11b81526001600160a01b0382166004820152602401610c84565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa29060200160405180910390a150565b6001600160a01b038116600090815260d6602052604081205460048114806134e95750806005145b806118c2575080600614806118cd575060071492915050565b61350a613d49565b60015b818110156135c7578282613522600184615943565b8181106135315761353161554b565b90506020020160208101906135469190614e4b565b6001600160a01b03168383838181106135615761356161554b565b90506020020160208101906135769190614e4b565b6001600160a01b0316116135b55760405162461bcd60e51b815260206004820152600660248201526510b7b93232b960d11b6044820152606401610c84565b806135bf81615561565b91505061350d565b506136078585858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506142c492505050565b61175c6001609c55565b6066546001600160a01b0316613625613cc6565b6001600160a01b031614806136405750613640610b14613cc6565b6136805760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b6000806000806000808680602001905181019061369d919061595a565b949a5092985090965094509250905060648111156136ea5760405162461bcd60e51b815260206004820152600a6024820152696261642071756f72756d60b01b6044820152606401610c84565b606481111561372e5760405162461bcd60e51b815260206004820152601060248201526f3130b21036b4b72932ba32b73a34b7b760811b6044820152606401610c84565b600060d35411801561374a575060d0546001600160a01b031615155b1561379f57613757611f55565b82111561379f5760405162461bcd60e51b815260206004820152601660248201527573706f6e736f72203e20736861726573537570706c7960501b6044820152606401610c84565b63ffffffff8616156137ca5760d0805463ffffffff60a01b1916600160a01b63ffffffff8916021790555b63ffffffff8516156137f55760d0805463ffffffff60c01b1916600160c01b63ffffffff8816021790555b60d184905560d283905560d382905560d48190556040805163ffffffff808916825287166020820152908101859052606081018490526080810183905260a081018290527fc10758ccd7d1dd3330e7bbe13a1a1d6bbb414967932376ee24989bad95edcdc19060c00160405180910390a150505050505050565b613877613cd0565b6001600160a01b0381166138dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c84565b6114b2816140cb565b6001600160a01b038116600090815260d6602052604081205460028114806134e9575080600314806118c2575080600614806118cd575060071492915050565b61392d613d49565b63ffffffff8116600090815260d960205260409020600261394d83613aea565b600781111561395e5761395e615471565b146139955760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60078101546001600160a01b03166139ab613cc6565b6001600160a01b03161480613a53575060d35460d05460078301546001600160a01b0391821691633a46b1a891166139e4600142615943565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015613a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5191906154be565b105b80613a645750613a64610b14613cc6565b613a9f5760405162461bcd60e51b815260206004820152600c60248201526b2163616e63656c6c61626c6560a01b6044820152606401610c84565b60068101805460ff1916600117905560405163ffffffff8316907f8896f24cff41b54acf76c2560861f33cd20fd76c4df0b68a3515c354e4b6c81a90600090a2506114b26001609c55565b63ffffffff818116600090815260d96020908152604080832081516101c08101835281548087168252600160201b8104871694820194909452600160401b8404861681840152600160601b840486166060820152600160801b84048616608080830191909152600160a01b90940490951660a0860152600181015460c0860152600281015460e08601526003810154610100860152600480820154610120870152600582015461014087015282519384019283905293948594909391926101608501929160068501918288855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411613bb75750505092845250505060078201546001600160a01b03166020820152600890910154604090910152805190915063ffffffff16613c255750600092915050565b6101608101515115613c3a5750600392915050565b604081015163ffffffff16613c525750600192915050565b806060015163ffffffff164211613c6c5750600292915050565b806080015163ffffffff164211613c865750600492915050565b8060e0015181610100015110613c9f5750600792915050565b6101608101516020015115613cb75750600692915050565b50600592915050565b50919050565b600061188a614540565b613cd8613cc6565b6001600160a01b0316613cf36033546001600160a01b031690565b6001600160a01b0316146126cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c84565b6002609c541415613d9c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c84565b6002609c55565b6001609c55565b60cf546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f19906044015b600060405180830381600087803b158015613df957600080fd5b505af1158015613e0d573d6000803e3d6000fd5b505050505050565b60cf54604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b63ffffffff8216600090815260d9602052604090206002613e6e84613aea565b6007811115613e7f57613e7f615471565b14613eb65760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60d0548154604051630748d63560e31b81526001600160a01b038781166004830152600160401b90920463ffffffff1660248201526000929190911690633a46b1a890604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d91906154be565b905060008111613f795760405162461bcd60e51b815260206004820152600760248201526610b6b2b6b132b960c91b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff8816845290915290205460ff1615613fdb5760405162461bcd60e51b81526020600482015260056024820152641d9bdd195960da1b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff881684529091528120805460ff1916600117905561401761186e565b9050826004015481111561402d57600483018190555b8315614042576002830180548301905561404d565b600383018054830190555b8315158563ffffffff16876001600160a01b03167f786755545a7e27c12c90cc7f0934514d03fdacfe3684a340b8c4100531e7ecd58560405161409291815260200190565b60405180910390a4505050505050565b60da546000906140c590600160201b90046001600160a01b031682846001614207565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d054604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b600054610100900460ff1661417d5760405162461bcd60e51b8152600401610c84906159b8565b6126cc614574565b600054610100900460ff166141ac5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145ab565b600054610100900460ff166141db5760405162461bcd60e51b8152600401610c84906159b8565b61112382826145d2565b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b600061421585858585614613565b5095945050505050565b60d0546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401613ddf565b60006140c5614265614812565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006142b78787878761488d565b9150915061421581614951565b60006142ce61186e565b905082156142e7576142e76142e1613cc6565b84613e15565b83156142fe576142fe6142f8613cc6565b8561411d565b60005b82518110156144ec57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031684838151811061433c5761433c61554b565b60200260200101516001600160a01b0316141561436657506067546001600160a01b031631614434565b600084838151811061437a5761437a61554b565b602090810291909101810151606754604080516001600160a01b03928316602480830191909152825180830390910181526044909101825293840180516001600160e01b03166370a0823160e01b179052519116916143d8916158bd565b600060405180830381855afa9150503d8060008114614413576040519150601f19603f3d011682016040523d82523d6000602084013e614418565b606091505b509150508080602001905181019061443091906154be565b9150505b6000838261444289896154ed565b61444c91906156b1565b61445691906156d0565b905080156144d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031685848151811061448e5761448e61554b565b60200260200101516001600160a01b0316146144cd576144c88584815181106144b9576144b961554b565b60200260200101518983614a9f565b6144d7565b6144d78882614b6e565b505080806144e490615561565b915050614301565b5083836144f7613cc6565b6001600160a01b03167fa21c268847f2b8adac3751ed0683330abe9fdd6cc4a7a8fc6787633d4126e0d48886604051614531929190615a03565b60405180910390a45050505050565b60006014361080159061455d575060ce546001600160a01b031633145b1561456f575060131936013560601c90565b503390565b600054610100900460ff1661459b5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145a6613cc6565b6140cb565b600054610100900460ff16613da35760405162461bcd60e51b8152600401610c84906159b8565b600054610100900460ff166145f95760405162461bcd60e51b8152600401610c84906159b8565b815160209283012081519190920120606891909155606955565b6065546000906060906001600160a01b0316801561478557604051633af85da960e11b81526001600160a01b038216906375f0bb529061466a908a908a908a908a9060009081908190819081903390600401615a73565b600060405180830381600087803b15801561468457600080fd5b505af1158015614698573d6000803e3d6000fd5b5050606754604051635229073f60e01b81526001600160a01b039091169250635229073f91506146d2908a908a908a908a90600401615afd565b6000604051808303816000875af11580156146f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526147199190810190615b3c565b604051631264e26d60e31b815260006004820152821515602482015291945092506001600160a01b03821690639327136890604401600060405180830381600087803b15801561476857600080fd5b505af115801561477c573d6000803e3d6000fd5b50505050614808565b606754604051635229073f60e01b81526001600160a01b0390911690635229073f906147bb908a908a908a908a90600401615afd565b6000604051808303816000875af11580156147da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526148029190810190615b3c565b90935091505b5094509492505050565b600061188a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61484160685490565b6069546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156148c45750600090506003614948565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614918573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661494157600060019250925050614948565b9150600090505b94509492505050565b600081600481111561496557614965615471565b141561496e5750565b600181600481111561498257614982615471565b14156149d05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c84565b60028160048111156149e4576149e4615471565b1415614a325760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c84565b6003816004811115614a4657614a46615471565b14156114b25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c84565b600080614b0785600063a9059cbb8787604051602401614ad49291906001600160a01b03929092168252602082015260400190565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506000614bd2565b91509150818015614b30575080511580614b30575080806020019051810190614b3091906154a1565b61175c5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610c84565b6000614b8c8383604051806020016040528060008152506000614bd2565b509050806126b55760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610c84565b60006060614be286868686614613565b9097909650945050505050565b600183019183908215614c715791602002820160005b83821115614c4257835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614c05565b8015614c6f5782816101000a81549060ff0219169055600101602081600001049283019260010302614c42565b505b50614c7d929150614d13565b5090565b60405180608001604052806004906020820280368337509192915050565b828054614cab9061567c565b90600052602060002090601f016020900481019282614ccd5760008555614c71565b82601f10614ce657805160ff1916838001178555614c71565b82800160010185558215614c71579182015b82811115614c71578251825591602001919060010190614cf8565b5b80821115614c7d5760008155600101614d14565b600060208284031215614d3a57600080fd5b5035919050565b60006101a08201905063ffffffff8f16825263ffffffff8e16602083015263ffffffff8d16604083015263ffffffff8c16606083015263ffffffff8b16608083015263ffffffff8a1660a08301528860c08301528760e0830152866101008301528561012083015284610140830152614dc66101608301856001600160a01b03169052565b826101808301529e9d5050505050505050505050505050565b80151581146114b257600080fd5b60008060408385031215614e0057600080fd5b8235614e0b81614ddf565b91506020830135614e1b81614ddf565b809150509250929050565b6001600160a01b03811681146114b257600080fd5b8035614e4681614e26565b919050565b600060208284031215614e5d57600080fd5b81356118cd81614e26565b63ffffffff811681146114b257600080fd5b600060208284031215614e8c57600080fd5b81356118cd81614e68565b60008083601f840112614ea957600080fd5b5081356001600160401b03811115614ec057600080fd5b6020830191508360208260051b8501011115614edb57600080fd5b9250929050565b60008060008060408587031215614ef857600080fd5b84356001600160401b0380821115614f0f57600080fd5b614f1b88838901614e97565b90965094506020870135915080821115614f3457600080fd5b50614f4187828801614e97565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614f8b57614f8b614f4d565b604052919050565b60006001600160401b03821115614fac57614fac614f4d565b50601f01601f191660200190565b600082601f830112614fcb57600080fd5b8135614fde614fd982614f93565b614f63565b818152846020838601011115614ff357600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561502257600080fd5b81356001600160401b0381111561503857600080fd5b61504484828501614fba565b949350505050565b60008083601f84011261505e57600080fd5b5081356001600160401b0381111561507557600080fd5b602083019150836020828501011115614edb57600080fd5b600080600080600080608087890312156150a657600080fd5b86356001600160401b03808211156150bd57600080fd5b6150c98a838b0161504c565b9098509650602089013591506150de82614e68565b90945060408801359350606088013590808211156150fb57600080fd5b5061510889828a0161504c565b979a9699509497509295939492505050565b60808101818360005b60048110156151445781511515835260209283019290910190600101615123565b50505092915050565b60005b83811015615168578181015183820152602001615150565b83811115615177576000848401525b50505050565b6000815180845261519581602086016020860161514d565b601f01601f19169290920160200192915050565b6020815260006118cd602083018461517d565b600080604083850312156151cf57600080fd5b8235614e0b81614e68565b6000806000604084860312156151ef57600080fd5b83356151fa81614e68565b925060208401356001600160401b0381111561521557600080fd5b6152218682870161504c565b9497909650939450505050565b6000806000806060858703121561524457600080fd5b843561524f81614e26565b93506020850135925060408501356001600160401b0381111561527157600080fd5b614f418782880161504c565b600080600080600080600080610100898b03121561529a57600080fd5b88356152a581614e26565b9750602089013596506040890135955060608901356152c381614e68565b945060808901356152d381614ddf565b935060a089013560ff811681146152e957600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806040838503121561531957600080fd5b823561532481614e26565b91506020830135614e1b81614e68565b6000806040838503121561534757600080fd5b82356001600160401b038082111561535e57600080fd5b818501915085601f83011261537257600080fd5b813560208282111561538657615386614f4d565b8160051b615395828201614f63565b928352848101820192828101908a8511156153af57600080fd5b83870192505b848310156153eb578235868111156153cd5760008081fd5b6153db8c86838b0101614fba565b83525091830191908301906153b5565b97506153fb915050878201614e3b565b9450505050509250929050565b60008060008060006080868803121561542057600080fd5b853561542b81614e26565b9450602086013593506040860135925060608601356001600160401b0381111561545457600080fd5b61546088828901614e97565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b602081016008831061549b5761549b615471565b91905290565b6000602082840312156154b357600080fd5b81516118cd81614ddf565b6000602082840312156154d057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615500576155006154d7565b500190565b602080825260059082015264085898585b60da1b604082015260600190565b6020808252600d908201526c2161727261792070617269747960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415615575576155756154d7565b5060010190565b600063ffffffff80831681811415615596576155966154d7565b6001019392505050565b600063ffffffff8083168185168083038211156155bf576155bf6154d7565b01949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600063ffffffff808c16835260e0602084015261561260e084018b8d6155c8565b818a16604085015288606085015287151560808501528660a085015283810360c08501526156418186886155c8565b9d9c50505050505050505050505050565b60208082526010908201526f10b130b0b610131010b6b0b730b3b2b960811b604082015260600190565b600181811c9082168061569057607f821691505b60208210811415613cc057634e487b7160e01b600052602260045260246000fd5b60008160001904831182151516156156cb576156cb6154d7565b500290565b6000826156ed57634e487b7160e01b600052601260045260246000fd5b500490565b6000615700614fd984614f93565b905082815283838301111561571457600080fd5b6118cd83602083018461514d565b600082601f83011261573357600080fd5b6118cd838351602085016156f2565b60008060008060008060c0878903121561575b57600080fd5b865161576681614e26565b602088015190965061577781614e26565b604088015190955061578881614e26565b606088015190945061579981614e26565b60808801519093506157aa81614e26565b60a08801519092506001600160401b038111156157c657600080fd5b6157d289828a01615722565b9150509295509295509295565b6000602082840312156157f157600080fd5b81516001600160401b0381111561580757600080fd5b8201601f8101841361581857600080fd5b615044848251602084016156f2565b60006101808e151583528d1515602084015263ffffffff808e166040850152808d166060850152508a60808401528960a08401528860c08401528760e08401528061010084015261587a8184018861517d565b905082810361012084015261588f818761517d565b610140840195909552505061016001529a9950505050505050505050565b8183823760009101908152919050565b600082516158cf81846020870161514d565b9190910192915050565b600087516158eb818460208c0161514d565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b166001820152856015820152846035820152835161593381605584016020880161514d565b0160550198975050505050505050565b600082821015615955576159556154d7565b500390565b60008060008060008060c0878903121561597357600080fd5b865161597e81614e68565b602088015190965061598f81614e68565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b81811015615a51578551851683529483019491830191600101615a33565b509098975050505050505050565b60028110615a6f57615a6f615471565b9052565b6001600160a01b038b81168252602082018b905261016060408301819052600091615aa08483018d61517d565b9150615aaf606085018c615a5f565b608084019990995260a08301979097525060c081019490945291851660e084015284166101008301528183036101208301526000835290921661014090920191909152602001949350505050565b60018060a01b0385168152836020820152608060408201526000615b24608083018561517d565b9050615b336060830184615a5f565b95945050505050565b60008060408385031215615b4f57600080fd5b8251615b5a81614ddf565b60208401519092506001600160401b03811115615b7657600080fd5b615b8285828601615722565b915050925092905056fe322e322e352b6f70656e67736e2e70617961626c65776974686261616c2e6972656c6179726563697069656e74a2646970667358221220e7f7a8af70f47c4c0a43ae70fdb50ef5f9643adc80e4e50e8e0c3ddc18ff5f7f64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106103a25760003560e01c80638009ba1f116101e7578063cf043df31161010d578063ed0cdf15116100a0578063f460124d1161006f578063f460124d14610b99578063f81cbd2614610bb9578063fab514c014610bcf578063fe47668614610bef57600080fd5b8063ed0cdf1514610b19578063ee4d88ed14610b39578063f2fde38b14610b59578063f3ae241514610b7957600080fd5b8063da35c664116100dc578063da35c66414610a95578063da74222814610ab9578063e19a9dd914610ad9578063e43581b814610af957600080fd5b8063cf043df3146109fa578063d33defc714610a1a578063d4b8399214610a55578063d61f27ae14610a7557600080fd5b8063a4f9edbf11610185578063b634e4e011610154578063b634e4e014610979578063c00d077514610996578063c4e931f6146109bd578063c9106389146109dc57600080fd5b8063a4f9edbf14610904578063acca30a214610924578063b1e3f40c14610939578063b3c98bbb1461095957600080fd5b806398a527cc116101c157806398a527cc1461088a5780639a2f747f146108aa578063a06db7dc146108c0578063a26ec96e146108e457600080fd5b80638009ba1f1461083657806383bf8459146108565780638da5cb5b1461086c57600080fd5b80634526d846116102cc5780635ec286961161026a578063715018a611610239578063715018a6146107c3578063776d1a01146107d85780637ceab3b1146107f85780637da0a8771461081857600080fd5b80635ec286961461074e578063635e99aa1461076e57806367f61f0714610783578063706a6e93146107a357600080fd5b806352ba1da7116102a657806352ba1da7146106a4578063572b6c05146106d15780635aef7de6146107005780635cfd6f7e1461073857600080fd5b80634526d846146106355780634630affc14610655578063486ff0cd1461068257600080fd5b8063136d731a11610344578063258bfe2f11610313578063258bfe2f146105c05780633232444c146105e05780633a82ffc81461060d5780633a98ef391461062057600080fd5b8063136d731a1461055357806316fd265d1461056857806318160ddd1461057d57806324d7806c146105a057600080fd5b8063056b0dcd11610380578063056b0dcd146104d1578063086cfca8146104f35780630a796e19146105135780630f656a211461053357600080fd5b8063013cf08b146103a7578063027cdf451461046e57806302a251a314610498575b600080fd5b3480156103b357600080fd5b5061044c6103c2366004614d28565b60d9602052600090815260409020805460018201546002830154600384015460048501546005860154600787015460089097015463ffffffff80881698600160201b8904821698600160401b8104831698600160601b8204841698600160801b8304851698600160a01b90930490941696909593949193909290916001600160a01b03909116908d565b6040516104659d9c9b9a99989796959493929190614d41565b60405180910390f35b34801561047a57600080fd5b5060d5546104889060ff1681565b6040519015158152602001610465565b3480156104a457600080fd5b5060d0546104bc90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610465565b3480156104dd57600080fd5b506104f16104ec366004614ded565b610c1c565b005b3480156104ff57600080fd5b506104f161050e366004614e4b565b611127565b34801561051f57600080fd5b506104f161052e366004614e7a565b611181565b34801561053f57600080fd5b506104f161054e366004614ee2565b6114b5565b34801561055f57600080fd5b506104f1611763565b34801561057457600080fd5b506104f16117f4565b34801561058957600080fd5b5061059261186e565b604051908152602001610465565b3480156105ac57600080fd5b506104886105bb366004614e4b565b61188f565b3480156105cc57600080fd5b506105926105db366004615010565b6118d4565b3480156105ec57600080fd5b506105926105fb366004614e4b565b60d66020526000908152604090205481565b61059261061b36600461508d565b611904565b34801561062c57600080fd5b50610592611f55565b34801561064157600080fd5b506104f1610650366004614ee2565b611fc3565b34801561066157600080fd5b50610675610670366004614e7a565b612092565b604051610465919061511a565b34801561068e57600080fd5b50610697612103565b60405161046591906151a9565b3480156106b057600080fd5b506105926106bf366004614e4b565b60d86020526000908152604090205481565b3480156106dd57600080fd5b506104886106ec366004614e4b565b60ce546001600160a01b0391821691161490565b34801561070c57600080fd5b50606654610720906001600160a01b031681565b6040516001600160a01b039091168152602001610465565b34801561074457600080fd5b5061059260d35481565b34801561075a57600080fd5b506104f1610769366004614ee2565b612191565b34801561077a57600080fd5b50610592612260565b34801561078f57600080fd5b506104f161079e3660046151bc565b6122aa565b3480156107af57600080fd5b506104f16107be3660046151da565b6122ce565b3480156107cf57600080fd5b506104f16126ba565b3480156107e457600080fd5b506104f16107f3366004614e4b565b6126ce565b34801561080457600080fd5b50606554610720906001600160a01b031681565b34801561082457600080fd5b5060ce546001600160a01b0316610720565b34801561084257600080fd5b5060d054610720906001600160a01b031681565b34801561086257600080fd5b5061059260d45481565b34801561087857600080fd5b506033546001600160a01b0316610720565b34801561089657600080fd5b506104f16108a5366004614ee2565b612728565b3480156108b657600080fd5b5061059260d15481565b3480156108cc57600080fd5b5060d0546104bc90600160c01b900463ffffffff1681565b3480156108f057600080fd5b5060d5546104889062010000900460ff1681565b34801561091057600080fd5b506104f161091f366004615010565b6127f7565b34801561093057600080fd5b506104f1612d49565b34801561094557600080fd5b506104f1610954366004614ee2565b612dce565b34801561096557600080fd5b506104f161097436600461522e565b612e9d565b34801561098557600080fd5b5060da546104bc9063ffffffff1681565b3480156109a257600080fd5b5060da5461072090600160201b90046001600160a01b031681565b3480156109c957600080fd5b5060d55461048890610100900460ff1681565b3480156109e857600080fd5b506065546001600160a01b0316610720565b348015610a0657600080fd5b506104f1610a1536600461527d565b612f7e565b348015610a2657600080fd5b50610488610a35366004615306565b60d760209081526000928352604080842090915290825290205460ff1681565b348015610a6157600080fd5b50606754610720906001600160a01b031681565b348015610a8157600080fd5b50610697610a90366004615334565b613249565b348015610aa157600080fd5b5060d0546104bc90600160e01b900463ffffffff1681565b348015610ac557600080fd5b506104f1610ad4366004614e4b565b613310565b348015610ae557600080fd5b506104f1610af4366004614e4b565b6133bf565b348015610b0557600080fd5b50610488610b14366004614e4b565b6134c1565b348015610b2557600080fd5b506104f1610b34366004615408565b613502565b348015610b4557600080fd5b506104f1610b54366004615010565b613611565b348015610b6557600080fd5b506104f1610b74366004614e4b565b61386f565b348015610b8557600080fd5b50610488610b94366004614e4b565b6138e5565b348015610ba557600080fd5b5060cf54610720906001600160a01b031681565b348015610bc557600080fd5b5061059260d25481565b348015610bdb57600080fd5b506104f1610bea366004614e7a565b613925565b348015610bfb57600080fd5b50610c0f610c0a366004614e7a565b613aea565b6040516104659190615487565b6066546001600160a01b0316610c30613cc6565b6001600160a01b03161480610c4b5750610c4b6105bb613cc6565b610c8d5760405162461bcd60e51b815260206004820152600e60248201526d10b130b0b610131010b0b236b4b760911b60448201526064015b60405180910390fd5b818015610d0e575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c91906154a1565b155b15610db55760d060009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b5050604051600181527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a1610ed8565b81158015610e35575060d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3591906154a1565b15610ed85760d060009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b5050604051600081527f5544d0c1539dae939ba6e81485fb6352e3081f5a74f9bf445038bdcc358e34159250602001905060405180910390a15b808015610f59575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5791906154a1565b155b156110005760cf60009054906101000a90046001600160a01b03166001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610fae57600080fd5b505af1158015610fc2573d6000803e3d6000fd5b5050604051600181527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb925060200190505b60405180910390a15050565b80158015611080575060cf60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108091906154a1565b156111235760cf60009054906101000a90046001600160a01b03166001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110d557600080fd5b505af11580156110e9573d6000803e3d6000fd5b5050604051600081527f21b897e32ff7464f696022c4d6dfbf2d4eb300d162ad28e0d90f1136f5fea9cb9250602001905060405180910390a15b5050565b61112f613cd0565b606680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce34290600090a35050565b611189613d49565b63ffffffff8116600090815260d96020526040902060d35460d0546001600160a01b0316639ab24eb06111ba613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156111fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122291906154be565b101561125b5760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600161126683613aea565b600781111561127757611277615471565b146112b15760405162461bcd60e51b815260206004820152600a602482015269085cdd589b5a5d1d195960b21b6044820152606401610c84565b8054600160a01b900463ffffffff161580611307575060d05463ffffffff600160c01b82048116916112ec91600160a01b90910416426154ed565b6112f691906154ed565b8154600160a01b900463ffffffff16115b61133d5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b805463ffffffff42818116600160401b026bffffffff00000000000000001984168117855560d08054600160a01b90819004851684018516600160601b0263ffffffff60601b1990931667ffffffffffffffff60401b19909616959095179190911780865590549384048316909101600160c01b9093048216929092018116600160801b0263ffffffff60801b1983168117845560da54600160201b92169190910267ffffffff000000001990911673ffffffff0000000000000000ffffffff000000001990921691909117178155611414613cc6565b6007820180546001600160a01b0319166001600160a01b039290921691909117905561143e61186e565b600482015561144b611f55565b600582015560da805463ffffffff191663ffffffff84169081179091554290611472613cc6565b6001600160a01b03167fd45ad122361f16d6f50d7c4a73638f20ee48eff6186af15224e2a4a1f6d5017160405160405180910390a4506114b26001609c55565b50565b6066546001600160a01b03166114c9613cc6565b6001600160a01b0316146114ef5760405162461bcd60e51b8152600401610c8490615505565b82811461150e5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57600083838381811061152d5761152d61554b565b60d5546020909102929092013592505060ff16156115aa5780600114158015611557575080600314155b8015611564575080600514155b8015611571575080600714155b6115aa5760405162461bcd60e51b815260206004820152600a60248201526961646d696e206c6f636b60b01b6044820152606401610c84565b60d554610100900460ff161561162157806002141580156115cc575080600314155b80156115d9575080600614155b80156115e6575080600714155b6116215760405162461bcd60e51b815260206004820152600c60248201526b6d616e61676572206c6f636b60a01b6044820152606401610c84565b60d55462010000900460ff161561169a5780600414158015611644575080600514155b8015611651575080600614155b801561165e575080600714155b61169a5760405162461bcd60e51b815260206004820152600d60248201526c676f7665726e6f72206c6f636b60981b6044820152606401610c84565b8060d660008888868181106116b1576116b161554b565b90506020020160208101906116c69190614e4b565b6001600160a01b031681526020810191909152604001600020558585838181106116f2576116f261554b565b90506020020160208101906117079190614e4b565b6001600160a01b03167fc456d076c1245c6b9759b3cdcb169e14e00a7739897e501844c8fe5fca6cb2608260405161174191815260200190565b60405180910390a2508061175481615561565b915050611511565b5050505050565b6066546001600160a01b0316611777613cc6565b6001600160a01b03161461179d5760405162461bcd60e51b8152600401610c8490615505565b60d5805462ff0000191662010000908117918290556040517fd9574ee4ccdf21db87aa2c1d1fee3248522d79c07c54bde4a9edeb0620bef71f926117ea92900460ff161515815260200190565b60405180910390a1565b6066546001600160a01b0316611808613cc6565b6001600160a01b03161461182e5760405162461bcd60e51b8152600401610c8490615505565b60d5805460ff191660019081179091556040519081527f5e1c9f68365556a24387c25fd0922af31039bcfc65d36caac57401d310948e59906020016117ea565b6000611878611f55565b611880612260565b61188a91906154ed565b905090565b6001600160a01b038116600090815260d6602052604081205460018114806118b75750806003145b806118c25750806005145b806118cd5750806007145b9392505050565b6000816040516020016118e791906151a9565b604051602081830303815290604052805190602001209050919050565b600061190e613d49565b63ffffffff85161580611954575060d05463ffffffff600160c01b820481169161194191600160a01b90910416426154ed565b61194b91906154ed565b8563ffffffff16115b61198a5760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610c84565b6301312d008411156119d05760405162461bcd60e51b815260206004820152600f60248201526e0c4c2c2d88ec2e640e8de40d0d2ced608b1b6044820152606401610c84565b60d35460d054600091906001600160a01b0316639ab24eb06119f0613cc6565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5891906154be565b10611a6557506001611b4c565b60d1543414611ab65760405162461bcd60e51b815260206004820152601960248201527f4261616c20726571756972657320616e206f66666572696e67000000000000006044820152606401610c84565b6067546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611b03576040519150601f19603f3d011682016040523d82523d6000602084013e611b08565b606091505b5050905080611b4a5760405162461bcd60e51b815260206004820152600e60248201526d18dbdd5b19081b9bdd081cd95b9960921b6044820152606401610c84565b505b6000611b8d89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b60d08054919250600160e01b90910463ffffffff1690601c611bae8361557c565b91906101000a81548163ffffffff021916908363ffffffff16021790555050604051806101c0016040528060d0601c9054906101000a900463ffffffff1663ffffffff16815260200183611c03576000611c0d565b60da5463ffffffff165b63ffffffff16815260200183611c24576000611c26565b425b63ffffffff16815260200183611c3d576000611c57565b60d054611c5790600160a01b900463ffffffff16426155a0565b63ffffffff16815260200183611c6e576000611c9d565b60d05463ffffffff600160c01b8204811691611c9391600160a01b90910416426155a0565b611c9d91906155a0565b63ffffffff1681526020018863ffffffff168152602001878152602001600081526020016000815260200183611cd4576000611cdc565b611cdc61186e565b815260200183611ced576000611cf5565b611cf5611f55565b8152604080516080810182526000808252602082810182905282840182905260608301919091528301520183611d2c576000611d34565b611d34613cc6565b6001600160a01b03168152602090810183905260d054600160e01b900463ffffffff908116600090815260d983526040908190208451815494860151928601516060870151608088015160a089015193871667ffffffffffffffff1990981697909717600160201b958716959095029490941767ffffffffffffffff60401b1916600160401b9186169190910263ffffffff60601b191617600160601b938516939093029290921767ffffffffffffffff60801b1916600160801b9484169490940263ffffffff60a01b191693909317600160a01b919092160217815560c0820151600182015560e0820151600282015561010082015160038201556101208201516004808301919091556101408301516005830155610160830151611e5f91600684019190614bef565b506101808201516007820180546001600160a01b0319166001600160a01b039092169190911790556101a0909101516008909101558115611ebf5760d05460da8054600160e01b90920463ffffffff1663ffffffff199092169190911790555b8060d0601c9054906101000a900463ffffffff1663ffffffff167fb9956173924f9c1204bae41dd3737d7ed1161846d13183879cdc03c4b9f8d01960d060149054906101000a900463ffffffff168c8c8c8c89428e8e604051611f2a999897969594939291906155f1565b60405180910390a3505060d0546001609c55600160e01b900463ffffffff1690509695505050505050565b60d054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188a91906154be565b6066546001600160a01b0316611fd7613cc6565b6001600160a01b03161480611ff25750611ff2610b94613cc6565b61200e5760405162461bcd60e51b8152600401610c8490615652565b82811461202d5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761208085858381811061204d5761204d61554b565b90506020020160208101906120629190614e4b565b8484848181106120745761207461554b565b90506020020135613daa565b8061208a81615561565b915050612030565b61209a614c81565b63ffffffff8216600090815260d9602052604080822081516080810192839052926006909101916004918390855b825461010083900a900460ff1615158152602060019283018181049485019490930390920291018084116120c8575094979650505050505050565b60db80546121109061567c565b80601f016020809104026020016040519081016040528092919081815260200182805461213c9061567c565b80156121895780601f1061215e57610100808354040283529160200191612189565b820191906000526020600020905b81548152906001019060200180831161216c57829003601f168201915b505050505081565b6066546001600160a01b03166121a5613cc6565b6001600160a01b031614806121c057506121c0610b94613cc6565b6121dc5760405162461bcd60e51b8152600401610c8490615652565b8281146121fb5760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c5761224e85858381811061221b5761221b61554b565b90506020020160208101906122309190614e4b565b8484848181106122425761224261554b565b90506020020135613e15565b8061225881615561565b9150506121fe565b60cf54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611f9f573d6000803e3d6000fd5b6122b2613d49565b6122c46122bd613cc6565b8383613e4e565b6111236001609c55565b6122d6613d49565b63ffffffff8316600090815260d96020526040902060078101546001600160a01b03166123305760405162461bcd60e51b815260206004820152600860248201526710b9b837b739b7b960c11b6044820152606401610c84565b600561233b85613aea565b600781111561234c5761234c615471565b146123825760405162461bcd60e51b815260206004820152600660248201526521726561647960d01b6044820152606401610c84565b805460009061239d90600160201b900463ffffffff16613aea565b905060068160078111156123b3576123b3615471565b14806123d0575060038160078111156123ce576123ce615471565b145b806123ec575060078160078111156123ea576123ea615471565b145b806124085750600081600781111561240657612406615471565b145b6124455760405162461bcd60e51b815260206004820152600e60248201526d1c1c995d885c1c9bd8d95cdcd95960921b6044820152606401610c84565b816008015461248985858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118d492505050565b146124cb5760405162461bcd60e51b8152602060048201526012602482015271696e636f72726563742063616c6c6461746160701b6044820152606401610c84565b600182015415806124e0575081600101545a10155b61251d5760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420656e6f7567682067617360901b6044820152606401610c84565b60068201805461ff0019166101001790558154600190600160a01b900463ffffffff161580159061255c5750825442600160a01b90910463ffffffff16105b15612565575060005b8080156125915750826005015460d25461257f91906156b1565b600284015461258f9060646156b1565b105b1561259a575060005b8080156125ca5750606460d45484600401546125b691906156b1565b6125c091906156d0565b6125c861186e565b105b156125d3575060005b801561264c5760068301805462ff0000191662010000179055604080516020601f870181900481028201810190925285815260009161262d919088908890819084018382808284376000920191909152506140a292505050565b90508061264a5760068401805463ff000000191663010000001790555b505b60068301546040805160ff62010000840481161515825263010000009093049092161515602083015263ffffffff8816917fb4571f7e4e2c2b6e6185e47ab5caa5fe34087299bd49fbae945a4583101ee3f0910160405180910390a25050506126b56001609c55565b505050565b6126c2613cd0565b6126cc60006140cb565b565b6126d6613cd0565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b6066546001600160a01b031661273c613cc6565b6001600160a01b031614806127575750612757610b94613cc6565b6127735760405162461bcd60e51b8152600401610c8490615652565b8281146127925760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c576127e58585838181106127b2576127b261554b565b90506020020160208101906127c79190614e4b565b8484848181106127d9576127d961554b565b9050602002013561411d565b806127ef81615561565b915050612795565b600054610100900460ff16158080156128175750600054600160ff909116105b806128315750303b158015612831575060005460ff166001145b6128945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c84565b6000805460ff1916600117905580156128b7576000805461ff0019166101001790555b6128bf613d49565b600080600080600080878060200190518101906128dc9190615742565b95509550955095509550955060006001600160a01b0316846001600160a01b03161415801561291357506001600160a01b03831615155b61294d5760405162461bcd60e51b815260206004820152600b60248201526a0c081859191c881d5cd95960aa1b6044820152606401610c84565b6040518060600160405280602d8152602001615b8d602d9139805161297a9160db91602090910190614c9f565b50612983614156565b61298b614185565b6129ca60405180604001604052806004815260200163566f746560e01b815250604051806040016040528060018152602001600d60fa1b8152506141b4565b6129d38361386f565b606680546001600160a01b0385166001600160a01b03199182168117909255606780549091169091179055612a07826141e5565b60cf80546001600160a01b03199081166001600160a01b038981169190911790925560d0805490911687831617905560da8054640100000000600160c01b031916600160201b87841681029190911791829055612a6b929104166000836001614207565b612aac5760405162461bcd60e51b8152602060048201526012602482015271063616c6c206661696c7572652073657475760741b6044820152606401610c84565b60cf5460408051635c975abb60e01b815290517f916f812584e0b001e8c6ab604fa549cc16c9d0b2f60b17aa0b4ff5eefe3e7725926001600160a01b031691635c975abb9160048083019260209291908290030181865afa158015612b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b3991906154a1565b60d060009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb091906154a1565b60d05460d15460d25460d35460d454604080516306fdde0360e01b8152905163ffffffff600160c01b8804811697600160a01b810490911696959493926001600160a01b03909116916306fdde03916004808201926000929091908290030181865afa158015612c24573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4c91908101906157df565b60d060009054906101000a90046001600160a01b03166001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cc791908101906157df565b612ccf611f55565b612cd7612260565b604051612cef9c9b9a99989796959493929190615827565b60405180910390a1505050505050612d076001609c55565b8015611123576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602001610ff4565b6066546001600160a01b0316612d5d613cc6565b6001600160a01b031614612d835760405162461bcd60e51b8152600401610c8490615505565b60d5805461ff001916610100908117918290556040517fb496b9628e839102454d8b483ba451c4be96675009b637273a00e4ab6a59db72926117ea92900460ff161515815260200190565b6066546001600160a01b0316612de2613cc6565b6001600160a01b03161480612dfd5750612dfd610b94613cc6565b612e195760405162461bcd60e51b8152600401610c8490615652565b828114612e385760405162461bcd60e51b8152600401610c8490615524565b60005b8381101561175c57612e8b858583818110612e5857612e5861554b565b9050602002016020810190612e6d9190614e4b565b848484818110612e7f57612e7f61554b565b9050602002013561421f565b80612e9581615561565b915050612e3b565b6066546001600160a01b0316612eb1613cc6565b6001600160a01b031614612ed75760405162461bcd60e51b8152600401610c8490615505565b6000846001600160a01b0316848484604051612ef49291906158ad565b60006040518083038185875af1925050503d8060008114612f31576040519150601f19603f3d011682016040523d82523d6000602084013e612f36565b606091505b505090508061175c5760405162461bcd60e51b815260206004820152601460248201527363616c6c206661696c757265206578656375746560601b6044820152606401610c84565b612f86613d49565b86421115612fd65760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610c84565b6001600160a01b038816600090815260d8602052604090205486146130265760405162461bcd60e51b8152602060048201526006602482015265216e6f6e636560d01b6044820152606401610c84565b60007f8698fbcc7273f96a670eb203cb707d8ec171123f24eaf075b1e754b71119e59e60d060009054906101000a90046001600160a01b03166001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801561309c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130c491908101906157df565b6040516020016130d491906158bd565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905263ffffffff871660c082015285151560e082015261010001604051602081830303815290604052805190602001209050600061315182614258565b90506000613161828787876142a6565b90508a6001600160a01b0316816001600160a01b0316146131b85760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606401610c84565b6001600160a01b0381166131f85760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b6044820152606401610c84565b6001600160a01b038b16600090815260d8602052604081208054600192906132219084906154ed565b909155506132329050818989613e4e565b50505061323f6001609c55565b5050505050505050565b60608060005b84518110156132cc578160008560008885815181106132705761327061554b565b60200260200101515189868151811061328b5761328b61554b565b60200260200101516040516020016132a8969594939291906158d9565b604051602081830303815290604052915080806132c490615561565b91505061324f565b50806040516024016132de91906151a9565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b6066546001600160a01b0316613324613cc6565b6001600160a01b0316148061333f575061333f610b14613cc6565b61337f5760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b613388816141e5565b6040516001600160a01b038216907f8c2bee8063bb4464870b7dfa415ebb2fe80bfa73ba20d6fbf0d42791274667ff90600090a250565b6133c7613cd0565b6001600160a01b0381161561346d576040516301ffc9a760e01b815263736bd41d60e11b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015613421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061344591906154a1565b61346d576040516358b7533f60e11b81526001600160a01b0382166004820152602401610c84565b606580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1151116914515bc0891ff9047a6cb32cf902546f83066499bcf8ba33d2353fa29060200160405180910390a150565b6001600160a01b038116600090815260d6602052604081205460048114806134e95750806005145b806118c2575080600614806118cd575060071492915050565b61350a613d49565b60015b818110156135c7578282613522600184615943565b8181106135315761353161554b565b90506020020160208101906135469190614e4b565b6001600160a01b03168383838181106135615761356161554b565b90506020020160208101906135769190614e4b565b6001600160a01b0316116135b55760405162461bcd60e51b815260206004820152600660248201526510b7b93232b960d11b6044820152606401610c84565b806135bf81615561565b91505061350d565b506136078585858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506142c492505050565b61175c6001609c55565b6066546001600160a01b0316613625613cc6565b6001600160a01b031614806136405750613640610b14613cc6565b6136805760405162461bcd60e51b815260206004820152601160248201527010b130b0b610131010b3b7bb32b93737b960791b6044820152606401610c84565b6000806000806000808680602001905181019061369d919061595a565b949a5092985090965094509250905060648111156136ea5760405162461bcd60e51b815260206004820152600a6024820152696261642071756f72756d60b01b6044820152606401610c84565b606481111561372e5760405162461bcd60e51b815260206004820152601060248201526f3130b21036b4b72932ba32b73a34b7b760811b6044820152606401610c84565b600060d35411801561374a575060d0546001600160a01b031615155b1561379f57613757611f55565b82111561379f5760405162461bcd60e51b815260206004820152601660248201527573706f6e736f72203e20736861726573537570706c7960501b6044820152606401610c84565b63ffffffff8616156137ca5760d0805463ffffffff60a01b1916600160a01b63ffffffff8916021790555b63ffffffff8516156137f55760d0805463ffffffff60c01b1916600160c01b63ffffffff8816021790555b60d184905560d283905560d382905560d48190556040805163ffffffff808916825287166020820152908101859052606081018490526080810183905260a081018290527fc10758ccd7d1dd3330e7bbe13a1a1d6bbb414967932376ee24989bad95edcdc19060c00160405180910390a150505050505050565b613877613cd0565b6001600160a01b0381166138dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c84565b6114b2816140cb565b6001600160a01b038116600090815260d6602052604081205460028114806134e9575080600314806118c2575080600614806118cd575060071492915050565b61392d613d49565b63ffffffff8116600090815260d960205260409020600261394d83613aea565b600781111561395e5761395e615471565b146139955760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60078101546001600160a01b03166139ab613cc6565b6001600160a01b03161480613a53575060d35460d05460078301546001600160a01b0391821691633a46b1a891166139e4600142615943565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381865afa158015613a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5191906154be565b105b80613a645750613a64610b14613cc6565b613a9f5760405162461bcd60e51b815260206004820152600c60248201526b2163616e63656c6c61626c6560a01b6044820152606401610c84565b60068101805460ff1916600117905560405163ffffffff8316907f8896f24cff41b54acf76c2560861f33cd20fd76c4df0b68a3515c354e4b6c81a90600090a2506114b26001609c55565b63ffffffff818116600090815260d96020908152604080832081516101c08101835281548087168252600160201b8104871694820194909452600160401b8404861681840152600160601b840486166060820152600160801b84048616608080830191909152600160a01b90940490951660a0860152600181015460c0860152600281015460e08601526003810154610100860152600480820154610120870152600582015461014087015282519384019283905293948594909391926101608501929160068501918288855b825461010083900a900460ff161515815260206001928301818104948501949093039092029101808411613bb75750505092845250505060078201546001600160a01b03166020820152600890910154604090910152805190915063ffffffff16613c255750600092915050565b6101608101515115613c3a5750600392915050565b604081015163ffffffff16613c525750600192915050565b806060015163ffffffff164211613c6c5750600292915050565b806080015163ffffffff164211613c865750600492915050565b8060e0015181610100015110613c9f5750600792915050565b6101608101516020015115613cb75750600692915050565b50600592915050565b50919050565b600061188a614540565b613cd8613cc6565b6001600160a01b0316613cf36033546001600160a01b031690565b6001600160a01b0316146126cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c84565b6002609c541415613d9c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c84565b6002609c55565b6001609c55565b60cf546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f19906044015b600060405180830381600087803b158015613df957600080fd5b505af1158015613e0d573d6000803e3d6000fd5b505050505050565b60cf54604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b63ffffffff8216600090815260d9602052604090206002613e6e84613aea565b6007811115613e7f57613e7f615471565b14613eb65760405162461bcd60e51b815260206004820152600760248201526621766f74696e6760c81b6044820152606401610c84565b60d0548154604051630748d63560e31b81526001600160a01b038781166004830152600160401b90920463ffffffff1660248201526000929190911690633a46b1a890604401602060405180830381865afa158015613f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f3d91906154be565b905060008111613f795760405162461bcd60e51b815260206004820152600760248201526610b6b2b6b132b960c91b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff8816845290915290205460ff1615613fdb5760405162461bcd60e51b81526020600482015260056024820152641d9bdd195960da1b6044820152606401610c84565b6001600160a01b038516600090815260d76020908152604080832063ffffffff881684529091528120805460ff1916600117905561401761186e565b9050826004015481111561402d57600483018190555b8315614042576002830180548301905561404d565b600383018054830190555b8315158563ffffffff16876001600160a01b03167f786755545a7e27c12c90cc7f0934514d03fdacfe3684a340b8c4100531e7ecd58560405161409291815260200190565b60405180910390a4505050505050565b60da546000906140c590600160201b90046001600160a01b031682846001614207565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d054604051632770a7eb60e21b81526001600160a01b0384811660048301526024820184905290911690639dc29fac90604401613ddf565b600054610100900460ff1661417d5760405162461bcd60e51b8152600401610c84906159b8565b6126cc614574565b600054610100900460ff166141ac5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145ab565b600054610100900460ff166141db5760405162461bcd60e51b8152600401610c84906159b8565b61112382826145d2565b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b600061421585858585614613565b5095945050505050565b60d0546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401613ddf565b60006140c5614265614812565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006142b78787878761488d565b9150915061421581614951565b60006142ce61186e565b905082156142e7576142e76142e1613cc6565b84613e15565b83156142fe576142fe6142f8613cc6565b8561411d565b60005b82518110156144ec57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031684838151811061433c5761433c61554b565b60200260200101516001600160a01b0316141561436657506067546001600160a01b031631614434565b600084838151811061437a5761437a61554b565b602090810291909101810151606754604080516001600160a01b03928316602480830191909152825180830390910181526044909101825293840180516001600160e01b03166370a0823160e01b179052519116916143d8916158bd565b600060405180830381855afa9150503d8060008114614413576040519150601f19603f3d011682016040523d82523d6000602084013e614418565b606091505b509150508080602001905181019061443091906154be565b9150505b6000838261444289896154ed565b61444c91906156b1565b61445691906156d0565b905080156144d75773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b031685848151811061448e5761448e61554b565b60200260200101516001600160a01b0316146144cd576144c88584815181106144b9576144b961554b565b60200260200101518983614a9f565b6144d7565b6144d78882614b6e565b505080806144e490615561565b915050614301565b5083836144f7613cc6565b6001600160a01b03167fa21c268847f2b8adac3751ed0683330abe9fdd6cc4a7a8fc6787633d4126e0d48886604051614531929190615a03565b60405180910390a45050505050565b60006014361080159061455d575060ce546001600160a01b031633145b1561456f575060131936013560601c90565b503390565b600054610100900460ff1661459b5760405162461bcd60e51b8152600401610c84906159b8565b6126cc6145a6613cc6565b6140cb565b600054610100900460ff16613da35760405162461bcd60e51b8152600401610c84906159b8565b600054610100900460ff166145f95760405162461bcd60e51b8152600401610c84906159b8565b815160209283012081519190920120606891909155606955565b6065546000906060906001600160a01b0316801561478557604051633af85da960e11b81526001600160a01b038216906375f0bb529061466a908a908a908a908a9060009081908190819081903390600401615a73565b600060405180830381600087803b15801561468457600080fd5b505af1158015614698573d6000803e3d6000fd5b5050606754604051635229073f60e01b81526001600160a01b039091169250635229073f91506146d2908a908a908a908a90600401615afd565b6000604051808303816000875af11580156146f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526147199190810190615b3c565b604051631264e26d60e31b815260006004820152821515602482015291945092506001600160a01b03821690639327136890604401600060405180830381600087803b15801561476857600080fd5b505af115801561477c573d6000803e3d6000fd5b50505050614808565b606754604051635229073f60e01b81526001600160a01b0390911690635229073f906147bb908a908a908a908a90600401615afd565b6000604051808303816000875af11580156147da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526148029190810190615b3c565b90935091505b5094509492505050565b600061188a7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61484160685490565b6069546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156148c45750600090506003614948565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614918573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661494157600060019250925050614948565b9150600090505b94509492505050565b600081600481111561496557614965615471565b141561496e5750565b600181600481111561498257614982615471565b14156149d05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c84565b60028160048111156149e4576149e4615471565b1415614a325760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c84565b6003816004811115614a4657614a46615471565b14156114b25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c84565b600080614b0785600063a9059cbb8787604051602401614ad49291906001600160a01b03929092168252602082015260400190565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506000614bd2565b91509150818015614b30575080511580614b30575080806020019051810190614b3091906154a1565b61175c5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610c84565b6000614b8c8383604051806020016040528060008152506000614bd2565b509050806126b55760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610c84565b60006060614be286868686614613565b9097909650945050505050565b600183019183908215614c715791602002820160005b83821115614c4257835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614c05565b8015614c6f5782816101000a81549060ff0219169055600101602081600001049283019260010302614c42565b505b50614c7d929150614d13565b5090565b60405180608001604052806004906020820280368337509192915050565b828054614cab9061567c565b90600052602060002090601f016020900481019282614ccd5760008555614c71565b82601f10614ce657805160ff1916838001178555614c71565b82800160010185558215614c71579182015b82811115614c71578251825591602001919060010190614cf8565b5b80821115614c7d5760008155600101614d14565b600060208284031215614d3a57600080fd5b5035919050565b60006101a08201905063ffffffff8f16825263ffffffff8e16602083015263ffffffff8d16604083015263ffffffff8c16606083015263ffffffff8b16608083015263ffffffff8a1660a08301528860c08301528760e0830152866101008301528561012083015284610140830152614dc66101608301856001600160a01b03169052565b826101808301529e9d5050505050505050505050505050565b80151581146114b257600080fd5b60008060408385031215614e0057600080fd5b8235614e0b81614ddf565b91506020830135614e1b81614ddf565b809150509250929050565b6001600160a01b03811681146114b257600080fd5b8035614e4681614e26565b919050565b600060208284031215614e5d57600080fd5b81356118cd81614e26565b63ffffffff811681146114b257600080fd5b600060208284031215614e8c57600080fd5b81356118cd81614e68565b60008083601f840112614ea957600080fd5b5081356001600160401b03811115614ec057600080fd5b6020830191508360208260051b8501011115614edb57600080fd5b9250929050565b60008060008060408587031215614ef857600080fd5b84356001600160401b0380821115614f0f57600080fd5b614f1b88838901614e97565b90965094506020870135915080821115614f3457600080fd5b50614f4187828801614e97565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614f8b57614f8b614f4d565b604052919050565b60006001600160401b03821115614fac57614fac614f4d565b50601f01601f191660200190565b600082601f830112614fcb57600080fd5b8135614fde614fd982614f93565b614f63565b818152846020838601011115614ff357600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561502257600080fd5b81356001600160401b0381111561503857600080fd5b61504484828501614fba565b949350505050565b60008083601f84011261505e57600080fd5b5081356001600160401b0381111561507557600080fd5b602083019150836020828501011115614edb57600080fd5b600080600080600080608087890312156150a657600080fd5b86356001600160401b03808211156150bd57600080fd5b6150c98a838b0161504c565b9098509650602089013591506150de82614e68565b90945060408801359350606088013590808211156150fb57600080fd5b5061510889828a0161504c565b979a9699509497509295939492505050565b60808101818360005b60048110156151445781511515835260209283019290910190600101615123565b50505092915050565b60005b83811015615168578181015183820152602001615150565b83811115615177576000848401525b50505050565b6000815180845261519581602086016020860161514d565b601f01601f19169290920160200192915050565b6020815260006118cd602083018461517d565b600080604083850312156151cf57600080fd5b8235614e0b81614e68565b6000806000604084860312156151ef57600080fd5b83356151fa81614e68565b925060208401356001600160401b0381111561521557600080fd5b6152218682870161504c565b9497909650939450505050565b6000806000806060858703121561524457600080fd5b843561524f81614e26565b93506020850135925060408501356001600160401b0381111561527157600080fd5b614f418782880161504c565b600080600080600080600080610100898b03121561529a57600080fd5b88356152a581614e26565b9750602089013596506040890135955060608901356152c381614e68565b945060808901356152d381614ddf565b935060a089013560ff811681146152e957600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806040838503121561531957600080fd5b823561532481614e26565b91506020830135614e1b81614e68565b6000806040838503121561534757600080fd5b82356001600160401b038082111561535e57600080fd5b818501915085601f83011261537257600080fd5b813560208282111561538657615386614f4d565b8160051b615395828201614f63565b928352848101820192828101908a8511156153af57600080fd5b83870192505b848310156153eb578235868111156153cd5760008081fd5b6153db8c86838b0101614fba565b83525091830191908301906153b5565b97506153fb915050878201614e3b565b9450505050509250929050565b60008060008060006080868803121561542057600080fd5b853561542b81614e26565b9450602086013593506040860135925060608601356001600160401b0381111561545457600080fd5b61546088828901614e97565b969995985093965092949392505050565b634e487b7160e01b600052602160045260246000fd5b602081016008831061549b5761549b615471565b91905290565b6000602082840312156154b357600080fd5b81516118cd81614ddf565b6000602082840312156154d057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615500576155006154d7565b500190565b602080825260059082015264085898585b60da1b604082015260600190565b6020808252600d908201526c2161727261792070617269747960981b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415615575576155756154d7565b5060010190565b600063ffffffff80831681811415615596576155966154d7565b6001019392505050565b600063ffffffff8083168185168083038211156155bf576155bf6154d7565b01949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600063ffffffff808c16835260e0602084015261561260e084018b8d6155c8565b818a16604085015288606085015287151560808501528660a085015283810360c08501526156418186886155c8565b9d9c50505050505050505050505050565b60208082526010908201526f10b130b0b610131010b6b0b730b3b2b960811b604082015260600190565b600181811c9082168061569057607f821691505b60208210811415613cc057634e487b7160e01b600052602260045260246000fd5b60008160001904831182151516156156cb576156cb6154d7565b500290565b6000826156ed57634e487b7160e01b600052601260045260246000fd5b500490565b6000615700614fd984614f93565b905082815283838301111561571457600080fd5b6118cd83602083018461514d565b600082601f83011261573357600080fd5b6118cd838351602085016156f2565b60008060008060008060c0878903121561575b57600080fd5b865161576681614e26565b602088015190965061577781614e26565b604088015190955061578881614e26565b606088015190945061579981614e26565b60808801519093506157aa81614e26565b60a08801519092506001600160401b038111156157c657600080fd5b6157d289828a01615722565b9150509295509295509295565b6000602082840312156157f157600080fd5b81516001600160401b0381111561580757600080fd5b8201601f8101841361581857600080fd5b615044848251602084016156f2565b60006101808e151583528d1515602084015263ffffffff808e166040850152808d166060850152508a60808401528960a08401528860c08401528760e08401528061010084015261587a8184018861517d565b905082810361012084015261588f818761517d565b610140840195909552505061016001529a9950505050505050505050565b8183823760009101908152919050565b600082516158cf81846020870161514d565b9190910192915050565b600087516158eb818460208c0161514d565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b166001820152856015820152846035820152835161593381605584016020880161514d565b0160550198975050505050505050565b600082821015615955576159556154d7565b500390565b60008060008060008060c0878903121561597357600080fd5b865161597e81614e68565b602088015190965061598f81614e68565b6040880151606089015160808a015160a0909a0151989b929a5090989097909650945092505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b81811015615a51578551851683529483019491830191600101615a33565b509098975050505050505050565b60028110615a6f57615a6f615471565b9052565b6001600160a01b038b81168252602082018b905261016060408301819052600091615aa08483018d61517d565b9150615aaf606085018c615a5f565b608084019990995260a08301979097525060c081019490945291851660e084015284166101008301528183036101208301526000835290921661014090920191909152602001949350505050565b60018060a01b0385168152836020820152608060408201526000615b24608083018561517d565b9050615b336060830184615a5f565b95945050505050565b60008060408385031215615b4f57600080fd5b8251615b5a81614ddf565b60208401519092506001600160401b03811115615b7657600080fd5b615b8285828601615722565b915050925092905056fe322e322e352b6f70656e67736e2e70617961626c65776974686261616c2e6972656c6179726563697069656e74a2646970667358221220e7f7a8af70f47c4c0a43ae70fdb50ef5f9643adc80e4e50e8e0c3ddc18ff5f7f64736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "burnLoot(address[],uint256[])": { + "params": { + "amount": "Array of amounts to burn", + "from": "Array of addresses to lose loot" + } + }, + "burnShares(address[],uint256[])": { + "params": { + "amount": "Array of amounts to burn", + "from": "Array of addresses to lose shares" + } + }, + "cancelProposal(uint32)": { + "details": "Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold", + "params": { + "id": "Number of proposal in `proposals` mapping to process for execution." + } + }, + "executeAsBaal(address,uint256,bytes)": { + "details": "Function to Execute arbitrary code as baal - useful if funds are accidentally sent here", + "params": { + "_data": "arbitrary transaction data", + "_to": "address to call", + "_value": "value to include in wei" + } + }, + "getProposalStatus(uint32)": { + "params": { + "id": "Number of proposal in proposals" + }, + "returns": { + "_0": "[cancelled, processed, passed, actionFailed]" + } + }, + "isAdmin(address)": { + "params": { + "shaman": "Address attempting to execute admin permissioned functions" + } + }, + "isGovernor(address)": { + "params": { + "shaman": "Address attempting to execute governor permissioned functions" + } + }, + "isManager(address)": { + "params": { + "shaman": "Address attempting to execute manager permissioned functions" + } + }, + "mintLoot(address[],uint256[])": { + "params": { + "amount": "Array of amounts to mint", + "to": "Array of addresses to mint loot" + } + }, + "mintShares(address[],uint256[])": { + "params": { + "amount": "Array of amounts to mint", + "to": "Array of addresses to receive shares" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "processProposal(uint32,bytes)": { + "details": "Proposal must have succeeded, not been processed, not expired, retention threshold must be met", + "params": { + "id": "Number of proposal in `proposals` mapping to process for execution.", + "proposalData": "Packed multisend data to execute via Gnosis multisend library" + } + }, + "ragequit(address,uint256,uint256,address[])": { + "params": { + "lootToBurn": "Baal pure economic weight to burn.", + "sharesToBurn": "Baal voting weight to burn.", + "to": "Account that receives 'fair share'.", + "tokens": "Array of tokens to include in rage quit calculation" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setAdminConfig(bool,bool)": { + "params": { + "pauseLoot": "Turn loot transfers on or off", + "pauseShares": "Turn share transfers on or off" + } + }, + "setAvatar(address)": { + "details": "Sets the avatar to a new avatar (`newAvatar`)." + }, + "setGovernanceConfig(bytes)": { + "params": { + "_governanceConfig": "Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound" + } + }, + "setGuard(address)": { + "details": "Set a guard that checks transactions before execution.", + "params": { + "_guard": "The address of the guard to be used or the 0 address to disable the guard." + } + }, + "setShamans(address[],uint256[])": { + "params": { + "_permissions": "Permission level of each shaman in _shamans", + "_shamans": "Addresses of shaman contracts" + } + }, + "setTarget(address)": { + "details": "Sets the target to a new target (`newTarget`)." + }, + "setTrustedForwarder(address)": { + "params": { + "_trustedForwarderAddress": "Trusted forwarder's address" + } + }, + "setUp(bytes)": { + "params": { + "_initializationParams": "Encoded setup information." + } + }, + "sponsorProposal(uint32)": { + "params": { + "id": "Number of proposal in `proposals` mapping to sponsor." + } + }, + "state(uint32)": { + "params": { + "id": "Number of proposal in proposals" + }, + "returns": { + "_0": "Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed \\-> Cancelled \\-> Defeated" + } + }, + "submitProposal(bytes,uint32,uint256,string)": { + "params": { + "details": "Context for proposal.", + "proposalData": "Multisend encoded transactions or proposal data" + }, + "returns": { + "_0": "proposal Count for submitted proposal." + } + }, + "submitVote(uint32,bool)": { + "params": { + "approved": "If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.", + "id": "Number of proposal in `proposals` mapping to cast vote on." + } + }, + "submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)": { + "params": { + "approved": "If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.", + "expiry": "Expiration of signature.", + "id": "Number of proposal in `proposals` mapping to cast vote on.", + "r": "r in signature", + "s": "s in signature", + "v": "v in signature", + "voter": "Address of member who submitted vote." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Baal ';_;'.", + "version": 1 + }, + "userdoc": { + "errors": { + "NotIERC165Compliant(address)": [ + { + "notice": "`guard_` does not implement IERC165." + } + ] + }, + "kind": "user", + "methods": { + "burnLoot(address[],uint256[])": { + "notice": "Baal-or-manager-only function to burn loot." + }, + "burnShares(address[],uint256[])": { + "notice": "Baal-or-manager-only function to burn shares." + }, + "cancelProposal(uint32)": { + "notice": "Cancel proposal prior to execution" + }, + "executeAsBaal(address,uint256,bytes)": { + "notice": "Can only be called by the avatar which means this can only be called if passed by another proposal or by a delegated signer on the Safe" + }, + "getProposalStatus(uint32)": { + "notice": "Helper to get recorded proposal flags" + }, + "hashOperation(bytes)": { + "notice": "Returns the keccak256 hash of calldata" + }, + "isAdmin(address)": { + "notice": "Helper to check if shaman permission contains admin capabilities" + }, + "isGovernor(address)": { + "notice": "Helper to check if shaman permission contains governor capabilities" + }, + "isManager(address)": { + "notice": "Helper to check if shaman permission contains manager capabilities" + }, + "isTrustedForwarder(address)": { + "notice": "return if the forwarder is trusted to forward relayed transactions to us. the forwarder is required to verify the sender's signature, and verify the call is not a replay." + }, + "lockAdmin()": { + "notice": "Lock admin so setShamans cannot be called with admin changes" + }, + "lockGovernor()": { + "notice": "Lock governor so setShamans cannot be called with governor changes" + }, + "lockManager()": { + "notice": "Lock manager so setShamans cannot be called with manager changes" + }, + "mintLoot(address[],uint256[])": { + "notice": "Baal-or-manager-only function to mint loot." + }, + "mintShares(address[],uint256[])": { + "notice": "Baal-or-manager-only function to mint shares." + }, + "processProposal(uint32,bytes)": { + "notice": "Process `proposal` & execute internal functions." + }, + "ragequit(address,uint256,uint256,address[])": { + "notice": "Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`" + }, + "setAdminConfig(bool,bool)": { + "notice": "Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token" + }, + "setAvatar(address)": { + "notice": "Can only be called by the current owner." + }, + "setGovernanceConfig(bytes)": { + "notice": "Baal-or-governance-only function to change periods." + }, + "setShamans(address[],uint256[])": { + "notice": "Baal-only function to set shaman status." + }, + "setTarget(address)": { + "notice": "Can only be called by the current owner." + }, + "setTrustedForwarder(address)": { + "notice": "Baal-or-governance only function to set trusted forwarder for meta-transactions." + }, + "setUp(bytes)": { + "notice": "Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights." + }, + "sponsorProposal(uint32)": { + "notice": "Sponsor proposal to Baal `members` for approval within voting period." + }, + "state(uint32)": { + "notice": "State helper to determine proposal state" + }, + "submitProposal(bytes,uint32,uint256,string)": { + "notice": "Submit proposal to Baal `members` for approval within given voting period." + }, + "submitVote(uint32,bool)": { + "notice": "Submit vote - proposal must exist & voting period must not have ended." + }, + "submitVoteWithSig(address,uint256,uint256,uint32,bool,uint8,bytes32,bytes32)": { + "notice": "Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended." + }, + "totalLoot()": { + "notice": "Helper to check total supply of child loot contract" + }, + "totalShares()": { + "notice": "Helper to check total supply of child shares contract" + }, + "totalSupply()": { + "notice": "Helper to check total supply of loot and shares" + } + }, + "notice": "Flexible guild contract inspired by Moloch DAO framework.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/Baal.sol:Baal", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/Baal.sol:Baal", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/Baal.sol:Baal", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3614, + "contract": "contracts/Baal.sol:Baal", + "label": "guard", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 3191, + "contract": "contracts/Baal.sol:Baal", + "label": "avatar", + "offset": 0, + "slot": "102", + "type": "t_address" + }, + { + "astId": 3194, + "contract": "contracts/Baal.sol:Baal", + "label": "target", + "offset": 0, + "slot": "103", + "type": "t_address" + }, + { + "astId": 7403, + "contract": "contracts/Baal.sol:Baal", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "104", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/Baal.sol:Baal", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "105", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "106", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4893, + "contract": "contracts/Baal.sol:Baal", + "label": "_status", + "offset": 0, + "slot": "156", + "type": "t_uint256" + }, + { + "astId": 4951, + "contract": "contracts/Baal.sol:Baal", + "label": "__gap", + "offset": 0, + "slot": "157", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3804, + "contract": "contracts/Baal.sol:Baal", + "label": "_trustedForwarder", + "offset": 0, + "slot": "206", + "type": "t_address" + }, + { + "astId": 10058, + "contract": "contracts/Baal.sol:Baal", + "label": "lootToken", + "offset": 0, + "slot": "207", + "type": "t_contract(IBaalToken)14080" + }, + { + "astId": 10061, + "contract": "contracts/Baal.sol:Baal", + "label": "sharesToken", + "offset": 0, + "slot": "208", + "type": "t_contract(IBaalToken)14080" + }, + { + "astId": 10066, + "contract": "contracts/Baal.sol:Baal", + "label": "votingPeriod", + "offset": 20, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10068, + "contract": "contracts/Baal.sol:Baal", + "label": "gracePeriod", + "offset": 24, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10070, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalCount", + "offset": 28, + "slot": "208", + "type": "t_uint32" + }, + { + "astId": 10072, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalOffering", + "offset": 0, + "slot": "209", + "type": "t_uint256" + }, + { + "astId": 10074, + "contract": "contracts/Baal.sol:Baal", + "label": "quorumPercent", + "offset": 0, + "slot": "210", + "type": "t_uint256" + }, + { + "astId": 10076, + "contract": "contracts/Baal.sol:Baal", + "label": "sponsorThreshold", + "offset": 0, + "slot": "211", + "type": "t_uint256" + }, + { + "astId": 10078, + "contract": "contracts/Baal.sol:Baal", + "label": "minRetentionPercent", + "offset": 0, + "slot": "212", + "type": "t_uint256" + }, + { + "astId": 10080, + "contract": "contracts/Baal.sol:Baal", + "label": "adminLock", + "offset": 0, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10082, + "contract": "contracts/Baal.sol:Baal", + "label": "managerLock", + "offset": 1, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10084, + "contract": "contracts/Baal.sol:Baal", + "label": "governorLock", + "offset": 2, + "slot": "213", + "type": "t_bool" + }, + { + "astId": 10088, + "contract": "contracts/Baal.sol:Baal", + "label": "shamans", + "offset": 0, + "slot": "214", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 10094, + "contract": "contracts/Baal.sol:Baal", + "label": "memberVoted", + "offset": 0, + "slot": "215", + "type": "t_mapping(t_address,t_mapping(t_uint32,t_bool))" + }, + { + "astId": 10098, + "contract": "contracts/Baal.sol:Baal", + "label": "votingNonces", + "offset": 0, + "slot": "216", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 10103, + "contract": "contracts/Baal.sol:Baal", + "label": "proposals", + "offset": 0, + "slot": "217", + "type": "t_mapping(t_uint256,t_struct(Proposal)10146_storage)" + }, + { + "astId": 10105, + "contract": "contracts/Baal.sol:Baal", + "label": "latestSponsoredProposalId", + "offset": 0, + "slot": "218", + "type": "t_uint32" + }, + { + "astId": 10107, + "contract": "contracts/Baal.sol:Baal", + "label": "multisendLibrary", + "offset": 4, + "slot": "218", + "type": "t_address" + }, + { + "astId": 10110, + "contract": "contracts/Baal.sol:Baal", + "label": "versionRecipient", + "offset": 0, + "slot": "219", + "type": "t_string_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bool)4_storage": { + "base": "t_bool", + "encoding": "inplace", + "label": "bool[4]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IBaalToken)14080": { + "encoding": "inplace", + "label": "contract IBaalToken", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_uint32,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint32 => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint32,t_bool)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_struct(Proposal)10146_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Baal.Proposal)", + "numberOfBytes": "32", + "value": "t_struct(Proposal)10146_storage" + }, + "t_mapping(t_uint32,t_bool)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Proposal)10146_storage": { + "encoding": "inplace", + "label": "struct Baal.Proposal", + "members": [ + { + "astId": 10117, + "contract": "contracts/Baal.sol:Baal", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10119, + "contract": "contracts/Baal.sol:Baal", + "label": "prevProposalId", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10121, + "contract": "contracts/Baal.sol:Baal", + "label": "votingStarts", + "offset": 8, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10123, + "contract": "contracts/Baal.sol:Baal", + "label": "votingEnds", + "offset": 12, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10125, + "contract": "contracts/Baal.sol:Baal", + "label": "graceEnds", + "offset": 16, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10127, + "contract": "contracts/Baal.sol:Baal", + "label": "expiration", + "offset": 20, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 10129, + "contract": "contracts/Baal.sol:Baal", + "label": "baalGas", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 10131, + "contract": "contracts/Baal.sol:Baal", + "label": "yesVotes", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 10133, + "contract": "contracts/Baal.sol:Baal", + "label": "noVotes", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 10135, + "contract": "contracts/Baal.sol:Baal", + "label": "maxTotalSharesAndLootAtVote", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 10137, + "contract": "contracts/Baal.sol:Baal", + "label": "maxTotalSharesAtSponsor", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 10141, + "contract": "contracts/Baal.sol:Baal", + "label": "status", + "offset": 0, + "slot": "6", + "type": "t_array(t_bool)4_storage" + }, + { + "astId": 10143, + "contract": "contracts/Baal.sol:Baal", + "label": "sponsor", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 10145, + "contract": "contracts/Baal.sol:Baal", + "label": "proposalDataHash", + "offset": 0, + "slot": "8", + "type": "t_bytes32" + } + ], + "numberOfBytes": "288" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner.json b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner.json new file mode 100644 index 0000000..10eed46 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner.json @@ -0,0 +1,375 @@ +{ + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "transactionIndex": 31, + "gasUsed": "333488", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000004000000080002000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000002000000000020000000200000000000000000402000000000000000000200000000000000000000", + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e", + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "logs": [ + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000004aff5c9eced3a7a6d3b7039fca520a5674a981ea" + ], + "data": "0x", + "logIndex": 18, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + }, + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 19, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + }, + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 20, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + } + ], + "blockNumber": 4816783, + "cumulativeGasUsed": "2058194", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Implementation.json b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Implementation.json new file mode 100644 index 0000000..cac4e93 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Implementation.json @@ -0,0 +1,455 @@ +{ + "address": "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_safeAddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_forwarderAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "initializationMintParams", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "initializationTokenParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "postInitializationActions", + "type": "bytes[]" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xf6db8eab8cd6f3dcb333cb7214503d488d88872f178b94b9668ed2e407049c46", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "transactionIndex": 2, + "gasUsed": "2167438", + "logsBloom": "0x00000040000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000", + "blockHash": "0xdacea96f438681e60e31b577e0864ab78d6b02d2779ad20174838b71229de3d3", + "transactionHash": "0xf6db8eab8cd6f3dcb333cb7214503d488d88872f178b94b9668ed2e407049c46", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 4816782, + "transactionHash": "0xf6db8eab8cd6f3dcb333cb7214503d488d88872f178b94b9668ed2e407049c46", + "address": "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0xdacea96f438681e60e31b577e0864ab78d6b02d2779ad20174838b71229de3d3" + } + ], + "blockNumber": 4816782, + "cumulativeGasUsed": "2937166", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_safeAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_forwarderAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initializationMintParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"initializationTokenParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"postInitializationActions\",\"type\":\"bytes[]\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setSummonerAddr(address)\":{\"details\":\"Sets the address of the BaalSummoner contract\",\"params\":{\"baalSummoner\":\"The address of the BaalSummoner contract\"}},\"summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])\":{\"details\":\"Summon a new Baal contract with a new set of tokens\",\"params\":{\"_forwarderAddr\":\"The address of the forwarder to be used, 0x0 if not set\",\"_safeAddr\":\"The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\",\"_saltNonce\":\"The salt nonce to be used for the Safe contract\",\"initializationMintParams\":\"The parameters for minting the tokens\",\"initializationTokenParams\":\"The parameters for deploying the tokens\",\"postInitializationActions\":\"The actions to be performed after the initialization\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":\"BaalAdvTokenSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../Baal.sol\\\";\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\ncontract BaalAdvTokenSummoner is\\n Initializable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n IBaalSummoner public _baalSummoner;\\n\\n event setSummoner(address summoner);\\n\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize() public initializer {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /**\\n * @dev Sets the address of the BaalSummoner contract\\n * @param baalSummoner The address of the BaalSummoner contract\\n */\\n function setSummonerAddr(address baalSummoner) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /**\\n * @dev Summon a new Baal contract with a new set of tokens\\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\\n * @param _saltNonce The salt nonce to be used for the Safe contract\\n * @param initializationMintParams The parameters for minting the tokens\\n * @param initializationTokenParams The parameters for deploying the tokens\\n * @param postInitializationActions The actions to be performed after the initialization\\n */\\n function summonBaalFromReferrer(\\n address _safeAddr,\\n address _forwarderAddr,\\n uint256 _saltNonce,\\n bytes calldata initializationMintParams,\\n bytes calldata initializationTokenParams,\\n bytes[] calldata postInitializationActions\\n ) external {\\n // summon tokens\\n (address _lootToken, address _sharesToken) = deployTokens(\\n initializationTokenParams\\n );\\n\\n // mint shares loot tokens\\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\\n\\n // summon baal with new tokens\\n address _baal = _baalSummoner.summonBaalFromReferrer(\\n abi.encode(\\n IBaalToken(_sharesToken).name(), \\n IBaalToken(_sharesToken).symbol(),\\n _safeAddr,\\n _forwarderAddr,\\n _lootToken,\\n _sharesToken\\n ),\\n postInitializationActions,\\n _saltNonce,\\n bytes32(bytes(\\\"DHAdvTokenSummoner\\\")) // referrer\\n );\\n\\n // change token ownership to baal\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n }\\n\\n /**\\n * @dev mintTokens\\n * @param initializationTokens The parameters for minting the tokens\\n * @param _lootToken The loot token address\\n * @param _sharesToken The shares token address\\n */\\n function mintTokens(\\n bytes calldata initializationTokens,\\n address _lootToken,\\n address _sharesToken\\n ) internal {\\n (\\n address[] memory summoners, // The address to mint initial tokens to\\n uint256[] memory summonerShares, // The amount of shares to mint\\n uint256[] memory summonerLoot // The amount of loot to mint\\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\\n\\n require(\\n summoners.length == summonerShares.length &&\\n summoners.length == summonerLoot.length,\\n \\\"!array parity\\\"\\n ); /*check array lengths match*/\\n\\n for (uint256 i = 0; i < summoners.length; i++) {\\n if (summonerLoot[i] > 0) {\\n IBaalToken(_lootToken).mint(\\n summoners[i],\\n summonerLoot[i]\\n ); /*grant `to` `amount` `loot`*/\\n }\\n if (summonerShares[i] > 0) {\\n IBaalToken(_sharesToken).mint(\\n summoners[i],\\n summonerShares[i]\\n ); /*grant `to` `amount` `shares`*/\\n }\\n }\\n }\\n\\n /**\\n * @dev deployTokens\\n * @param initializationParams The parameters for deploying the tokens\\n */\\n function deployTokens(\\n bytes calldata initializationParams\\n ) internal returns (address lootToken, address sharesToken) {\\n (\\n string\\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\\n string\\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\\n string\\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\\n string\\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\\n bool _transferableShares /* if shares is transferable */,\\n bool _transferableLoot /* if loot is transferable */\\n ) = abi.decode(\\n initializationParams,\\n (string, string, string, string, bool, bool)\\n );\\n\\n address lootSingleton = _baalSummoner.lootSingleton();\\n address sharesSingleton = _baalSummoner.sharesSingleton();\\n\\n lootToken = address(\\n new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector,\\n _lootName,\\n _lootSymbol\\n )\\n )\\n );\\n\\n sharesToken = address(\\n new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector,\\n _name,\\n _symbol\\n )\\n )\\n );\\n if (!_transferableShares) {\\n IBaalToken(sharesToken).pause();\\n }\\n if (!_transferableLoot) {\\n IBaalToken(lootToken).pause();\\n }\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n }\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x006b6737392584aee27cae0cad838ca0d07004a77b10600884a3813318775807\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b50610020610025565b6100e5565b600054610100900460ff16156100915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6125de61011f600039600081816104ec01528181610538015281816105e10152818161062401526106c001526125de6000f3fe6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setSummonerAddr(address)": { + "details": "Sets the address of the BaalSummoner contract", + "params": { + "baalSummoner": "The address of the BaalSummoner contract" + } + }, + "summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])": { + "details": "Summon a new Baal contract with a new set of tokens", + "params": { + "_forwarderAddr": "The address of the forwarder to be used, 0x0 if not set", + "_safeAddr": "The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe", + "_saltNonce": "The salt nonce to be used for the Safe contract", + "initializationMintParams": "The parameters for minting the tokens", + "initializationTokenParams": "The parameters for deploying the tokens", + "postInitializationActions": "The actions to be performed after the initialization" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 13087, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)14323" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)14323": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Proxy.json b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Proxy.json new file mode 100644 index 0000000..4a57bb3 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAdvTokenSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "transactionIndex": 31, + "gasUsed": "333488", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000002000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000004000000080002000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000002000000000020000000200000000000000000402000000000000000000200000000000000000000", + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e", + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "logs": [ + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000004aff5c9eced3a7a6d3b7039fca520a5674a981ea" + ], + "data": "0x", + "logIndex": 18, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + }, + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 19, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + }, + { + "transactionIndex": 31, + "blockNumber": 4816783, + "transactionHash": "0xb6ce50242d95b777aec2564897621877fc6239fd6684b04c82ab33f40b65da6c", + "address": "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 20, + "blockHash": "0xb1009ac8909c2347bf3928b2f05c66bbe2026d2b8cd12d4951ed5a49e459a28e" + } + ], + "blockNumber": 4816783, + "cumulativeGasUsed": "2058194", + "status": 1, + "byzantium": true + }, + "args": [ + "0x4AFf5C9ECEd3a7a6D3B7039FCA520a5674A981eA", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAndVaultSummoner.json b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner.json new file mode 100644 index 0000000..6d8994c --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner.json @@ -0,0 +1,593 @@ +{ + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "transactionIndex": 24, + "gasUsed": "335695", + "logsBloom": "0x00000000000100000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000004000020000000000000000000800000000080000000000000000000000400000000000200000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000000000000001000000000000000020000000000000000000040000000000000000000000000000010020000000200000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05", + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "logs": [ + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000f8e5e3b80393aef6a3fb9c3dba24ec4233a477de" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + }, + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 16, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + }, + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 17, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + } + ], + "blockNumber": 4816775, + "cumulativeGasUsed": "3003865", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF8E5E3b80393AeF6a3Fb9C3DbA24ec4233A477De", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xF8E5E3b80393AeF6a3Fb9C3DbA24ec4233A477De", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Implementation.json b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Implementation.json new file mode 100644 index 0000000..c7647b3 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Implementation.json @@ -0,0 +1,747 @@ +{ + "address": "0xF8E5E3b80393AeF6a3Fb9C3DbA24ec4233A477De", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "SetDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct BaalAndVaultSummoner.Vault", + "name": "vault", + "type": "tuple" + } + ], + "name": "SetVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "summoner", + "type": "address" + } + ], + "name": "setSummoner", + "type": "event" + }, + { + "inputs": [], + "name": "_baalSummoner", + "outputs": [ + { + "internalType": "contract IBaalSummoner", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "deactivateVaultAsDao", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setNewVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baalSummoner", + "type": "address" + } + ], + "name": "setSummonerAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonBaalAndVault", + "outputs": [ + { + "internalType": "address", + "name": "_daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "summonVault", + "outputs": [ + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultIdx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "vaults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "address", + "name": "daoAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "vaultAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x44c3031d2dfcb0555234cee0ac8f3aad4e732b8270434408e0e236634e3db647", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xF8E5E3b80393AeF6a3Fb9C3DbA24ec4233A477De", + "transactionIndex": 32, + "gasUsed": "1561686", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xaec79ef4f0b3f9e257291be0afd2cdc93809bb433316e476f5c4392eda36f839", + "transactionHash": "0x44c3031d2dfcb0555234cee0ac8f3aad4e732b8270434408e0e236634e3db647", + "logs": [], + "blockNumber": 4816774, + "cumulativeGasUsed": "6589136", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"SetDelegate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"indexed\":false,\"internalType\":\"struct BaalAndVaultSummoner.Vault\",\"name\":\"vault\",\"type\":\"tuple\"}],\"name\":\"SetVault\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"}],\"name\":\"deactivateVaultAsDao\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"}],\"name\":\"setDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"setNewVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"}],\"name\":\"setVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"summonBaalAndVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"summonVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_vaultAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vaultIdx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vaults\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"active\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaultAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"deactivateVaultAsDao(uint256,address)\":{\"notice\":\"A DAO can set a Vault as inactive \"},\"setDelegate(address,address)\":{\"notice\":\"Allow a Dao to set a delegate that can manage vault enteries \"},\"setNewVault(address,address,string)\":{\"notice\":\"set a new Vault as active on existing dao (owner only) \"},\"setVault(uint256,bool)\":{\"notice\":\"set a Vault as active or not on existing dao (owner only) \"},\"summonBaalAndVault(bytes,bytes[],uint256,bytes32,string)\":{\"notice\":\"Summon a new baal and add a Vault \"},\"summonVault(address,string)\":{\"notice\":\"create and add a Vault(Safe) to an existing DAO \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAndVaultSummoner.sol\":\"BaalAndVaultSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAndVaultSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\n/*\\nSummon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)\\nCan summon a dao with a new Vault.\\nCan summon a new vault for a dao after initial dao setup.\\nActs as a register and the owner of the contract or DAO can deactivate\\nregister is primarily a helper for UIs\\nOwner of the contract can add new vaults, and set current vaults\\nContract is upgradable and should be owned by a DAO\\n*/\\ncontract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\\n\\n IBaalSummoner public _baalSummoner;\\n uint256 public vaultIdx;\\n\\n struct Vault{\\n uint256 id;\\n bool active;\\n address daoAddress;\\n address vaultAddress;\\n string name;\\n }\\n mapping(uint256 => Vault) public vaults;\\n mapping(address => address) public delegates;\\n\\n event SetVault(\\n Vault vault\\n );\\n\\n event SetDelegate(\\n address daoAddress,\\n address delegate\\n );\\n\\n event setSummoner(\\n address summoner\\n );\\n\\n function initialize() initializer public {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n vaultIdx = 0;\\n }\\n\\n function setSummonerAddr(\\n address baalSummoner\\n ) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /** Summon a new baal and add a Vault */\\n function summonBaalAndVault(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 saltNonce,\\n bytes32 referrer,\\n string memory name\\n ) external returns (address _daoAddress, address _vaultAddress) {\\n _daoAddress = _baalSummoner.summonBaalFromReferrer(\\n initializationParams,\\n initializationActions,\\n saltNonce,\\n referrer\\n );\\n _vaultAddress = summonVault(_daoAddress, name);\\n }\\n\\n /** create and add a Vault(Safe) to an existing DAO */\\n function summonVault(\\n address daoAddress,\\n string memory name\\n ) public returns (address _vaultAddress) {\\n _vaultAddress = _baalSummoner.deployAndSetupSafe(\\n daoAddress\\n );\\n _setNewVault(name, daoAddress, _vaultAddress);\\n }\\n\\n /** set a Vault as active or not on existing dao (owner only) */\\n // Admin functions to help maintain the registry.\\n function setVault(\\n uint256 id,\\n bool active\\n ) public onlyOwner\\n {\\n _setVault(id, active);\\n }\\n\\n /** set a new Vault as active on existing dao (owner only) */\\n // Admin functions to help maintain the registry.\\n function setNewVault(\\n address daoAddress, \\n address vaultAddress,\\n string memory name\\n ) public onlyOwner\\n {\\n _setNewVault(name, daoAddress, vaultAddress);\\n }\\n\\n /** \\n A DAO can set a Vault as inactive \\n */\\n function deactivateVaultAsDao(\\n uint256 id,\\n address daoAddress\\n ) external\\n {\\n require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], \\\"not DAO or delegate\\\");\\n require(vaults[id].daoAddress == daoAddress && vaults[id].active,\\\"!not active DAO vault\\\");\\n _setVault(id, false);\\n }\\n\\n /** Allow a Dao to set a delegate that can manage vault enteries */\\n function setDelegate(\\n address daoAddress,\\n address delegate\\n ) external\\n {\\n require(msg.sender == daoAddress, \\\"!DAO\\\");\\n delegates[daoAddress] = delegate;\\n emit SetDelegate(daoAddress, delegate);\\n }\\n\\n\\n function _setVault(\\n uint256 id, \\n bool active\\n ) internal \\n {\\n vaults[id].active = active;\\n emit SetVault(vaults[id]);\\n }\\n\\n function _setNewVault(\\n string memory name,\\n address daoAddress, \\n address vaultAddress\\n ) internal \\n {\\n vaultIdx += 1;\\n vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);\\n emit SetVault(vaults[vaultIdx]);\\n }\\n\\n function _authorizeUpgrade(address newImplementation)\\n internal\\n onlyOwner\\n override\\n {}\\n}\\n\",\"keccak256\":\"0x5519dacfb28e1a8ec59e4653d8d85f18a2ecf32a9ec00627d4575c94c2c27553\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b5060805160601c611b4c6100526000396000818161049f015281816104df0152818161057f015281816105bf015261064e0152611b4c6000f3fe6080604052600436106101095760003560e01c80638129fc1c11610095578063ac06a9a911610064578063ac06a9a9146102f2578063b395f08614610312578063bb6decc814610332578063bedfb8d414610352578063f2fde38b1461036857600080fd5b80638129fc1c1461024e5780638c64ea4a146102635780638da5cb5b14610294578063a156d863146102b257600080fd5b806352d1902d116100dc57806352d1902d146101a0578063587cde1e146101c35780635c873849146101f9578063619dd5d414610219578063715018a61461023957600080fd5b8063133afcc01461010e57806314b630f9146101305780633659cfe61461016d5780634f1ef2861461018d575b600080fd5b34801561011a57600080fd5b5061012e610129366004611678565b610388565b005b34801561013c57600080fd5b5060c954610150906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017957600080fd5b5061012e6101883660046113f5565b610494565b61012e61019b3660046114ca565b610574565b3480156101ac57600080fd5b506101b5610641565b604051908152602001610164565b3480156101cf57600080fd5b506101506101de3660046113f5565b60cc602052600090815260409020546001600160a01b031681565b34801561020557600080fd5b5061012e61021436600461142f565b6106f4565b34801561022557600080fd5b5061012e61023436600461169d565b6107a1565b34801561024557600080fd5b5061012e6107b3565b34801561025a57600080fd5b5061012e6107c7565b34801561026f57600080fd5b5061028361027e36600461165f565b6108e5565b6040516101649594939291906119d2565b3480156102a057600080fd5b506033546001600160a01b0316610150565b3480156102be57600080fd5b506102d26102cd36600461158d565b6109b0565b604080516001600160a01b03938416815292909116602083015201610164565b3480156102fe57600080fd5b5061015061030d36600461152e565b610a5b565b34801561031e57600080fd5b5061012e61032d366004611468565b610aee565b34801561033e57600080fd5b5061012e61034d3660046113f5565b610b06565b34801561035e57600080fd5b506101b560ca5481565b34801561037457600080fd5b5061012e6103833660046113f5565b610ba1565b336001600160a01b03821614806103b857506001600160a01b03818116600090815260cc60205260409020541633145b6103ff5760405162461bcd60e51b81526020600482015260136024820152726e6f742044414f206f722064656c656761746560681b60448201526064015b60405180910390fd5b600082815260cb60205260409020600101546001600160a01b03828116610100909204161480156104415750600082815260cb602052604090206001015460ff165b6104855760405162461bcd60e51b8152602060048201526015602482015274085b9bdd081858dd1a5d9948111053c81d985d5b1d605a1b60448201526064016103f6565b610490826000610c17565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156104dd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610526600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461054c5760405162461bcd60e51b81526004016103f690611852565b61055581610c64565b6040805160008082526020820190925261057191839190610c6c565b50565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156105bd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610606600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461062c5760405162461bcd60e51b81526004016103f690611852565b61063582610c64565b61049082826001610c6c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106e15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f6565b50600080516020611ad083398151915290565b336001600160a01b038316146107355760405162461bcd60e51b81526004016103f6906020808252600490820152632144414f60e01b604082015260600190565b6001600160a01b03828116600081815260cc602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fbeebfeebc9d1af8057ca45af36b2171fea34cb5b251e394f0bc5fcabde119d7f91015b60405180910390a15050565b6107a9610de6565b6104908282610c17565b6107bb610de6565b6107c56000610e40565b565b600054610100900460ff16158080156107e75750600054600160ff909116105b806108015750303b158015610801575060005460ff166001145b6108645760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f6565b6000805460ff191660011790558015610887576000805461ff0019166101001790555b61088f610e92565b610897610ec1565b600060ca558015610571576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b60cb602052600090815260409020805460018201546002830154600384018054939460ff8416946101009094046001600160a01b039081169493169290919061092d90611a69565b80601f016020809104026020016040519081016040528092919081815260200182805461095990611a69565b80156109a65780601f1061097b576101008083540402835291602001916109a6565b820191906000526020600020905b81548152906001019060200180831161098957829003601f168201915b5050505050905085565b60c95460405163209f369560e01b815260009182916001600160a01b039091169063209f3695906109ef908c908c908c908c908c908c90600401611738565b602060405180830381600087803b158015610a0957600080fd5b505af1158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190611412565b9150610a4d8284610a5b565b905097509795505050505050565b60c954604051633e2108c760e21b81526001600160a01b038481166004830152600092169063f884231c90602401602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adb9190611412565b9050610ae8828483610ee8565b92915050565b610af6610de6565b610b01818484610ee8565b505050565b610b0e610de6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f6565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016108da565b610ba9610de6565b6001600160a01b038116610c0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b61057181610e40565b600082815260cb60205260409081902060018101805460ff191684151517905590517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f7891610795916118e9565b610571610de6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c9f57610b0183611005565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd857600080fd5b505afa925050508015610d08575060408051601f3d908101601f19168201909252610d0591810190611574565b60015b610d6b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f6565b600080516020611ad08339815191528114610dda5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f6565b50610b018383836110a1565b6033546001600160a01b031633146107c55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f6565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610eb95760405162461bcd60e51b81526004016103f69061189e565b6107c56110cc565b600054610100900460ff166107c55760405162461bcd60e51b81526004016103f69061189e565b600160ca6000828254610efb9190611a17565b90915550506040805160a08101825260ca54808252600160208084018281526001600160a01b0388811686880190815288821660608801908152608088018c8152600097885260cb865298909620875181559251948301805491516001600160a81b0319909216951515610100600160a81b03191695909517610100918316919091021790935592516002840180546001600160a01b03191691909316179091559251805192939192610fb4926003850192019061127a565b505060ca54600090815260cb60205260409081902090517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f789250610ff891906118e9565b60405180910390a1505050565b6001600160a01b0381163b6110725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f6565b600080516020611ad083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6110aa836110fc565b6000825111806110b75750805b15610b01576110c6838361113c565b50505050565b600054610100900460ff166110f35760405162461bcd60e51b81526004016103f69061189e565b6107c533610e40565b61110581611005565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6111a45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016103f6565b600080846001600160a01b0316846040516111bf919061171c565b600060405180830381855af49150503d80600081146111fa576040519150601f19603f3d011682016040523d82523d6000602084013e6111ff565b606091505b50915091506112278282604051806060016040528060278152602001611af060279139611230565b95945050505050565b6060831561123f575081611249565b6112498383611250565b9392505050565b8151156112605781518083602001fd5b8060405162461bcd60e51b81526004016103f691906117f3565b82805461128690611a69565b90600052602060002090601f0160209004810192826112a857600085556112ee565b82601f106112c157805160ff19168380011785556112ee565b828001600101855582156112ee579182015b828111156112ee5782518255916020019190600101906112d3565b506112fa9291506112fe565b5090565b5b808211156112fa57600081556001016112ff565b600067ffffffffffffffff8084111561132e5761132e611aa4565b604051601f8501601f19908116603f0116810190828211818310171561135657611356611aa4565b8160405280935085815286868601111561136f57600080fd5b858560208301376000602087830101525050509392505050565b60008083601f84011261139b57600080fd5b50813567ffffffffffffffff8111156113b357600080fd5b6020830191508360208260051b85010111156113ce57600080fd5b9250929050565b600082601f8301126113e657600080fd5b61124983833560208501611313565b60006020828403121561140757600080fd5b813561124981611aba565b60006020828403121561142457600080fd5b815161124981611aba565b6000806040838503121561144257600080fd5b823561144d81611aba565b9150602083013561145d81611aba565b809150509250929050565b60008060006060848603121561147d57600080fd5b833561148881611aba565b9250602084013561149881611aba565b9150604084013567ffffffffffffffff8111156114b457600080fd5b6114c0868287016113d5565b9150509250925092565b600080604083850312156114dd57600080fd5b82356114e881611aba565b9150602083013567ffffffffffffffff81111561150457600080fd5b8301601f8101851361151557600080fd5b61152485823560208401611313565b9150509250929050565b6000806040838503121561154157600080fd5b823561154c81611aba565b9150602083013567ffffffffffffffff81111561156857600080fd5b611524858286016113d5565b60006020828403121561158657600080fd5b5051919050565b600080600080600080600060a0888a0312156115a857600080fd5b873567ffffffffffffffff808211156115c057600080fd5b818a0191508a601f8301126115d457600080fd5b8135818111156115e357600080fd5b8b60208285010111156115f557600080fd5b60209283019950975090890135908082111561161057600080fd5b61161c8b838c01611389565b909750955060408a0135945060608a0135935060808a013591508082111561164357600080fd5b506116508a828b016113d5565b91505092959891949750929550565b60006020828403121561167157600080fd5b5035919050565b6000806040838503121561168b57600080fd5b82359150602083013561145d81611aba565b600080604083850312156116b057600080fd5b823591506020830135801515811461145d57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452611708816020860160208601611a3d565b601f01601f19169290920160200192915050565b6000825161172e818460208701611a3d565b9190910192915050565b60808152600061174c60808301888a6116c7565b602083820381850152818783528183019050818860051b8401018960005b8a8110156117d957858303601f190184528135368d9003601e1901811261179057600080fd5b8c01803567ffffffffffffffff8111156117a957600080fd5b8036038e13156117b857600080fd5b6117c585828985016116c7565b95870195945050509084019060010161176a565b505060408601979097525050505060600152949350505050565b60208152600061124960208301846116f0565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b602080825282548282015260018084015460ff81161515604085015260081c6001600160a01b039081166060850152600285015416608084015260a080840152600384018054600093929190849080841c8185168061194957607f821691505b86821081141561196757634e487b7160e01b84526022600452602484fd5b60c0890182905260e089018180156119865760018114611997576119c2565b60ff198516825288820195506119c2565b60008781526020902060005b858110156119bc57815484820152908901908a016119a3565b83019650505b50939a9950505050505050505050565b85815284151560208201526001600160a01b0384811660408301528316606082015260a060808201819052600090611a0c908301846116f0565b979650505050505050565b60008219821115611a3857634e487b7160e01b600052601160045260246000fd5b500190565b60005b83811015611a58578181015183820152602001611a40565b838111156110c65750506000910152565b600181811c90821680611a7d57607f821691505b60208210811415611a9e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461057157600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a147e58c05b20357cb3919a570b985d63b405a5c57197b71f94854fda882a9a64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101095760003560e01c80638129fc1c11610095578063ac06a9a911610064578063ac06a9a9146102f2578063b395f08614610312578063bb6decc814610332578063bedfb8d414610352578063f2fde38b1461036857600080fd5b80638129fc1c1461024e5780638c64ea4a146102635780638da5cb5b14610294578063a156d863146102b257600080fd5b806352d1902d116100dc57806352d1902d146101a0578063587cde1e146101c35780635c873849146101f9578063619dd5d414610219578063715018a61461023957600080fd5b8063133afcc01461010e57806314b630f9146101305780633659cfe61461016d5780634f1ef2861461018d575b600080fd5b34801561011a57600080fd5b5061012e610129366004611678565b610388565b005b34801561013c57600080fd5b5060c954610150906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017957600080fd5b5061012e6101883660046113f5565b610494565b61012e61019b3660046114ca565b610574565b3480156101ac57600080fd5b506101b5610641565b604051908152602001610164565b3480156101cf57600080fd5b506101506101de3660046113f5565b60cc602052600090815260409020546001600160a01b031681565b34801561020557600080fd5b5061012e61021436600461142f565b6106f4565b34801561022557600080fd5b5061012e61023436600461169d565b6107a1565b34801561024557600080fd5b5061012e6107b3565b34801561025a57600080fd5b5061012e6107c7565b34801561026f57600080fd5b5061028361027e36600461165f565b6108e5565b6040516101649594939291906119d2565b3480156102a057600080fd5b506033546001600160a01b0316610150565b3480156102be57600080fd5b506102d26102cd36600461158d565b6109b0565b604080516001600160a01b03938416815292909116602083015201610164565b3480156102fe57600080fd5b5061015061030d36600461152e565b610a5b565b34801561031e57600080fd5b5061012e61032d366004611468565b610aee565b34801561033e57600080fd5b5061012e61034d3660046113f5565b610b06565b34801561035e57600080fd5b506101b560ca5481565b34801561037457600080fd5b5061012e6103833660046113f5565b610ba1565b336001600160a01b03821614806103b857506001600160a01b03818116600090815260cc60205260409020541633145b6103ff5760405162461bcd60e51b81526020600482015260136024820152726e6f742044414f206f722064656c656761746560681b60448201526064015b60405180910390fd5b600082815260cb60205260409020600101546001600160a01b03828116610100909204161480156104415750600082815260cb602052604090206001015460ff165b6104855760405162461bcd60e51b8152602060048201526015602482015274085b9bdd081858dd1a5d9948111053c81d985d5b1d605a1b60448201526064016103f6565b610490826000610c17565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156104dd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610526600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461054c5760405162461bcd60e51b81526004016103f690611852565b61055581610c64565b6040805160008082526020820190925261057191839190610c6c565b50565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156105bd5760405162461bcd60e51b81526004016103f690611806565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610606600080516020611ad0833981519152546001600160a01b031690565b6001600160a01b03161461062c5760405162461bcd60e51b81526004016103f690611852565b61063582610c64565b61049082826001610c6c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106e15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016103f6565b50600080516020611ad083398151915290565b336001600160a01b038316146107355760405162461bcd60e51b81526004016103f6906020808252600490820152632144414f60e01b604082015260600190565b6001600160a01b03828116600081815260cc602090815260409182902080546001600160a01b031916948616948517905581519283528201929092527fbeebfeebc9d1af8057ca45af36b2171fea34cb5b251e394f0bc5fcabde119d7f91015b60405180910390a15050565b6107a9610de6565b6104908282610c17565b6107bb610de6565b6107c56000610e40565b565b600054610100900460ff16158080156107e75750600054600160ff909116105b806108015750303b158015610801575060005460ff166001145b6108645760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103f6565b6000805460ff191660011790558015610887576000805461ff0019166101001790555b61088f610e92565b610897610ec1565b600060ca558015610571576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b60cb602052600090815260409020805460018201546002830154600384018054939460ff8416946101009094046001600160a01b039081169493169290919061092d90611a69565b80601f016020809104026020016040519081016040528092919081815260200182805461095990611a69565b80156109a65780601f1061097b576101008083540402835291602001916109a6565b820191906000526020600020905b81548152906001019060200180831161098957829003601f168201915b5050505050905085565b60c95460405163209f369560e01b815260009182916001600160a01b039091169063209f3695906109ef908c908c908c908c908c908c90600401611738565b602060405180830381600087803b158015610a0957600080fd5b505af1158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a419190611412565b9150610a4d8284610a5b565b905097509795505050505050565b60c954604051633e2108c760e21b81526001600160a01b038481166004830152600092169063f884231c90602401602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adb9190611412565b9050610ae8828483610ee8565b92915050565b610af6610de6565b610b01818484610ee8565b505050565b610b0e610de6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016103f6565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016108da565b610ba9610de6565b6001600160a01b038116610c0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b61057181610e40565b600082815260cb60205260409081902060018101805460ff191684151517905590517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f7891610795916118e9565b610571610de6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c9f57610b0183611005565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd857600080fd5b505afa925050508015610d08575060408051601f3d908101601f19168201909252610d0591810190611574565b60015b610d6b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016103f6565b600080516020611ad08339815191528114610dda5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016103f6565b50610b018383836110a1565b6033546001600160a01b031633146107c55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103f6565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610eb95760405162461bcd60e51b81526004016103f69061189e565b6107c56110cc565b600054610100900460ff166107c55760405162461bcd60e51b81526004016103f69061189e565b600160ca6000828254610efb9190611a17565b90915550506040805160a08101825260ca54808252600160208084018281526001600160a01b0388811686880190815288821660608801908152608088018c8152600097885260cb865298909620875181559251948301805491516001600160a81b0319909216951515610100600160a81b03191695909517610100918316919091021790935592516002840180546001600160a01b03191691909316179091559251805192939192610fb4926003850192019061127a565b505060ca54600090815260cb60205260409081902090517f70720885c820c73facaa75bc2669991b591d9fd2a1e2507a4a9a8022f9336f789250610ff891906118e9565b60405180910390a1505050565b6001600160a01b0381163b6110725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103f6565b600080516020611ad083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6110aa836110fc565b6000825111806110b75750805b15610b01576110c6838361113c565b50505050565b600054610100900460ff166110f35760405162461bcd60e51b81526004016103f69061189e565b6107c533610e40565b61110581611005565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6111a45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016103f6565b600080846001600160a01b0316846040516111bf919061171c565b600060405180830381855af49150503d80600081146111fa576040519150601f19603f3d011682016040523d82523d6000602084013e6111ff565b606091505b50915091506112278282604051806060016040528060278152602001611af060279139611230565b95945050505050565b6060831561123f575081611249565b6112498383611250565b9392505050565b8151156112605781518083602001fd5b8060405162461bcd60e51b81526004016103f691906117f3565b82805461128690611a69565b90600052602060002090601f0160209004810192826112a857600085556112ee565b82601f106112c157805160ff19168380011785556112ee565b828001600101855582156112ee579182015b828111156112ee5782518255916020019190600101906112d3565b506112fa9291506112fe565b5090565b5b808211156112fa57600081556001016112ff565b600067ffffffffffffffff8084111561132e5761132e611aa4565b604051601f8501601f19908116603f0116810190828211818310171561135657611356611aa4565b8160405280935085815286868601111561136f57600080fd5b858560208301376000602087830101525050509392505050565b60008083601f84011261139b57600080fd5b50813567ffffffffffffffff8111156113b357600080fd5b6020830191508360208260051b85010111156113ce57600080fd5b9250929050565b600082601f8301126113e657600080fd5b61124983833560208501611313565b60006020828403121561140757600080fd5b813561124981611aba565b60006020828403121561142457600080fd5b815161124981611aba565b6000806040838503121561144257600080fd5b823561144d81611aba565b9150602083013561145d81611aba565b809150509250929050565b60008060006060848603121561147d57600080fd5b833561148881611aba565b9250602084013561149881611aba565b9150604084013567ffffffffffffffff8111156114b457600080fd5b6114c0868287016113d5565b9150509250925092565b600080604083850312156114dd57600080fd5b82356114e881611aba565b9150602083013567ffffffffffffffff81111561150457600080fd5b8301601f8101851361151557600080fd5b61152485823560208401611313565b9150509250929050565b6000806040838503121561154157600080fd5b823561154c81611aba565b9150602083013567ffffffffffffffff81111561156857600080fd5b611524858286016113d5565b60006020828403121561158657600080fd5b5051919050565b600080600080600080600060a0888a0312156115a857600080fd5b873567ffffffffffffffff808211156115c057600080fd5b818a0191508a601f8301126115d457600080fd5b8135818111156115e357600080fd5b8b60208285010111156115f557600080fd5b60209283019950975090890135908082111561161057600080fd5b61161c8b838c01611389565b909750955060408a0135945060608a0135935060808a013591508082111561164357600080fd5b506116508a828b016113d5565b91505092959891949750929550565b60006020828403121561167157600080fd5b5035919050565b6000806040838503121561168b57600080fd5b82359150602083013561145d81611aba565b600080604083850312156116b057600080fd5b823591506020830135801515811461145d57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452611708816020860160208601611a3d565b601f01601f19169290920160200192915050565b6000825161172e818460208701611a3d565b9190910192915050565b60808152600061174c60808301888a6116c7565b602083820381850152818783528183019050818860051b8401018960005b8a8110156117d957858303601f190184528135368d9003601e1901811261179057600080fd5b8c01803567ffffffffffffffff8111156117a957600080fd5b8036038e13156117b857600080fd5b6117c585828985016116c7565b95870195945050509084019060010161176a565b505060408601979097525050505060600152949350505050565b60208152600061124960208301846116f0565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b602080825282548282015260018084015460ff81161515604085015260081c6001600160a01b039081166060850152600285015416608084015260a080840152600384018054600093929190849080841c8185168061194957607f821691505b86821081141561196757634e487b7160e01b84526022600452602484fd5b60c0890182905260e089018180156119865760018114611997576119c2565b60ff198516825288820195506119c2565b60008781526020902060005b858110156119bc57815484820152908901908a016119a3565b83019650505b50939a9950505050505050505050565b85815284151560208201526001600160a01b0384811660408301528316606082015260a060808201819052600090611a0c908301846116f0565b979650505050505050565b60008219821115611a3857634e487b7160e01b600052601160045260246000fd5b500190565b60005b83811015611a58578181015183820152602001611a40565b838111156110c65750506000910152565b600181811c90821680611a7d57607f821691505b60208210811415611a9e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461057157600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a147e58c05b20357cb3919a570b985d63b405a5c57197b71f94854fda882a9a64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "deactivateVaultAsDao(uint256,address)": { + "notice": "A DAO can set a Vault as inactive " + }, + "setDelegate(address,address)": { + "notice": "Allow a Dao to set a delegate that can manage vault enteries " + }, + "setNewVault(address,address,string)": { + "notice": "set a new Vault as active on existing dao (owner only) " + }, + "setVault(uint256,bool)": { + "notice": "set a Vault as active or not on existing dao (owner only) " + }, + "summonBaalAndVault(bytes,bytes[],uint256,bytes32,string)": { + "notice": "Summon a new baal and add a Vault " + }, + "summonVault(address,string)": { + "notice": "create and add a Vault(Safe) to an existing DAO " + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 13477, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)14323" + }, + { + "astId": 13479, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaultIdx", + "offset": 0, + "slot": "202", + "type": "t_uint256" + }, + { + "astId": 13495, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaults", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_uint256,t_struct(Vault)13490_storage)" + }, + { + "astId": 13499, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "delegates", + "offset": 0, + "slot": "204", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)14323": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_struct(Vault)13490_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct BaalAndVaultSummoner.Vault)", + "numberOfBytes": "32", + "value": "t_struct(Vault)13490_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Vault)13490_storage": { + "encoding": "inplace", + "label": "struct BaalAndVaultSummoner.Vault", + "members": [ + { + "astId": 13481, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "id", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 13483, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "active", + "offset": 0, + "slot": "1", + "type": "t_bool" + }, + { + "astId": 13485, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "daoAddress", + "offset": 1, + "slot": "1", + "type": "t_address" + }, + { + "astId": 13487, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "vaultAddress", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 13489, + "contract": "contracts/higherOrderFactories/BaalAndVaultSummoner.sol:BaalAndVaultSummoner", + "label": "name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Proxy.json b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Proxy.json new file mode 100644 index 0000000..103dfa2 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalAndVaultSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "transactionIndex": 24, + "gasUsed": "335695", + "logsBloom": "0x00000000000100000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000004000020000000000000000000800000000080000000000000000000000400000000000200000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000000000000001000000000000000020000000000000000000040000000000000000000000000000010020000000200000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05", + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "logs": [ + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000f8e5e3b80393aef6a3fb9c3dba24ec4233a477de" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + }, + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 16, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + }, + { + "transactionIndex": 24, + "blockNumber": 4816775, + "transactionHash": "0x93cb86efb3e9f57fa881cea0a93896282363865aa66de002304573869e4573fb", + "address": "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 17, + "blockHash": "0x3bd136a1c4912d967ffc235e9b32c6ece4a08cd4094e1f2e391e1670c0f6ea05" + } + ], + "blockNumber": 4816775, + "cumulativeGasUsed": "3003865", + "status": 1, + "byzantium": true + }, + "args": [ + "0xF8E5E3b80393AeF6a3Fb9C3DbA24ec4233A477De", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalSummoner.json b/lib/Baal/deployments/sepolia/BaalSummoner.json new file mode 100644 index 0000000..19989f5 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalSummoner.json @@ -0,0 +1,666 @@ +{ + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "transactionIndex": 27, + "gasUsed": "333576", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001020000000000000000000000000000080000020000000000000000000800000000020000000000000000000000400000200000000000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040040000000000000000000000000000020000000200000000000002000000000000000000000000000000000000000000000", + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7", + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "logs": [ + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e0f33e95af46ead1fe181d2a74919bff903cd5d4" + ], + "data": "0x", + "logIndex": 29, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + }, + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 30, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + }, + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 31, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + } + ], + "blockNumber": 4816767, + "cumulativeGasUsed": "5390384", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalSummoner_Implementation.json b/lib/Baal/deployments/sepolia/BaalSummoner_Implementation.json new file mode 100644 index 0000000..8812335 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalSummoner_Implementation.json @@ -0,0 +1,785 @@ +{ + "address": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "daoAddress", + "type": "address" + } + ], + "name": "DaoReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "baalSafe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "moduleAddr", + "type": "address" + } + ], + "name": "DeployBaalSafe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "name": "DeployBaalTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "version", + "type": "uint256" + } + ], + "name": "SetAddrsVersion", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "loot", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "shares", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "forwarder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "existingAddrs", + "type": "uint256" + } + ], + "name": "SummonBaal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "addrsVersion", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_moduleAddr", + "type": "address" + } + ], + "name": "deployAndSetupSafe", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "deployTokens", + "outputs": [ + { + "internalType": "address", + "name": "lootToken", + "type": "address" + }, + { + "internalType": "address", + "name": "sharesToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "_calls", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "encodeMultisend", + "outputs": [ + { + "internalType": "bytes", + "name": "encodedMultisend", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisFallbackLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisMultisendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "gnosisSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lootSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisFallbackLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisMultisendLibrary", + "type": "address" + }, + { + "internalType": "address", + "name": "_gnosisSafeProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_moduleProxyFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_lootSingleton", + "type": "address" + }, + { + "internalType": "address", + "name": "_sharesSingleton", + "type": "address" + } + ], + "name": "setAddrs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharesSingleton", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "summonBaal", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "initializationParams", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "initializationActions", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referrer", + "type": "bytes32" + } + ], + "name": "summonBaalFromReferrer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "template", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x4fe2a05a989e1391ef6b9f70f0617198e3997940d11cd5b1e922a8f2211a0e48", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "transactionIndex": 29, + "gasUsed": "2541676", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa5784341d22bf1d58d0f800f8e71edced1bbbfd5b8f3d99d1bc7b8a47f9ae150", + "transactionHash": "0x4fe2a05a989e1391ef6b9f70f0617198e3997940d11cd5b1e922a8f2211a0e48", + "logs": [], + "blockNumber": 4816766, + "cumulativeGasUsed": "5420235", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "928daf6847beb441da40e990eb20d125", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"daoAddress\",\"type\":\"address\"}],\"name\":\"DaoReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"baalSafe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"moduleAddr\",\"type\":\"address\"}],\"name\":\"DeployBaalSafe\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"SetAddrsVersion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loot\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"shares\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"existingAddrs\",\"type\":\"uint256\"}],\"name\":\"SummonBaal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addrsVersion\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_moduleAddr\",\"type\":\"address\"}],\"name\":\"deployAndSetupSafe\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"name\":\"deployTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"_calls\",\"type\":\"bytes[]\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"encodeMultisend\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedMultisend\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisFallbackLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisMultisendLibrary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gnosisSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lootSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_template\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisFallbackLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisMultisendLibrary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_gnosisSafeProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_moduleProxyFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_lootSingleton\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sharesSingleton\",\"type\":\"address\"}],\"name\":\"setAddrs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharesSingleton\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"summonBaal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initializationParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"initializationActions\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"referrer\",\"type\":\"bytes32\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"template\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/BaalSummoner.sol\":\"BaalSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/BaalSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"./Baal.sol\\\";\\n\\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\\n // when some of the init addresses are updated\\n uint256 public addrsVersion;\\n\\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\\n\\n // Template contract to use for new Gnosis safe proxies\\n address public gnosisSingleton;\\n\\n // Library to use for EIP1271 compatability\\n address public gnosisFallbackLibrary;\\n\\n // Library to use for all safe transaction executions\\n address public gnosisMultisendLibrary;\\n\\n // template contract to clone for loot ERC20 token\\n address public lootSingleton;\\n\\n // template contract to clone for shares ERC20 token\\n address public sharesSingleton;\\n\\n // Proxy summoners\\n //\\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\\n ModuleProxyFactory moduleProxyFactory;\\n\\n event SetAddrsVersion(\\n uint256 version\\n );\\n\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n\\n event DaoReferral(\\n bytes32 referrer,\\n address daoAddress\\n );\\n\\n event DeployBaalTokens(\\n address lootToken, \\n address sharesToken\\n );\\n\\n event DeployBaalSafe(\\n address baalSafe,\\n address moduleAddr\\n );\\n\\n function initialize() initializer public {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n // must be called after deploy to set libraries\\n function setAddrs(\\n address payable _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) public onlyOwner {\\n require(_lootSingleton != address(0), \\\"!lootSingleton\\\");\\n require(_sharesSingleton != address(0), \\\"!sharesSingleton\\\");\\n require(_gnosisSingleton != address(0), \\\"!gnosisSingleton\\\");\\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\\n\\n template = _template;\\n gnosisSingleton = _gnosisSingleton;\\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\\n lootSingleton = _lootSingleton;\\n sharesSingleton = _sharesSingleton;\\n\\n emit SetAddrsVersion(\\n addrsVersion++\\n );\\n \\n }\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n public\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n function summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) external returns (address) {\\n \\n return\\n _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n }\\n\\n // Add a referrer to help keep track of where deploies are coming from\\n function summonBaalFromReferrer(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address) {\\n address daoAddress;\\n\\n daoAddress = _summonBaal(\\n initializationParams,\\n initializationActions,\\n _saltNonce\\n );\\n\\n emit DaoReferral(referrer, daoAddress);\\n return daoAddress;\\n }\\n\\n // deploy new share and loot contracts\\n function deployTokens(string memory _name, string memory _symbol) \\n public \\n returns (address lootToken, address sharesToken) \\n {\\n lootToken = address(new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector, \\n string(abi.encodePacked(_name, \\\" LOOT\\\")), \\n string(abi.encodePacked(_symbol, \\\"-LOOT\\\")))\\n ));\\n\\n sharesToken = address(new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector, \\n _name, \\n _symbol)\\n ));\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n\\n }\\n\\n // deploy a safe with module and single module signer setup\\n function deployAndSetupSafe(address _moduleAddr)\\n public\\n returns (address)\\n {\\n // Deploy new safe but do not set it up yet\\n GnosisSafe _safe = GnosisSafe(\\n payable(\\n gnosisSafeProxyFactory.createProxy(\\n gnosisSingleton,\\n bytes(\\\"\\\")\\n )\\n )\\n );\\n // Generate delegate calls so the safe calls enableModule on itself during setup\\n bytes memory _enableBaal = abi.encodeWithSignature(\\n \\\"enableModule(address)\\\",\\n address(_moduleAddr)\\n );\\n bytes memory _enableBaalMultisend = abi.encodePacked(\\n uint8(0),\\n address(_safe),\\n uint256(0),\\n uint256(_enableBaal.length),\\n bytes(_enableBaal)\\n );\\n\\n bytes memory _multisendAction = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n _enableBaalMultisend\\n );\\n\\n // Workaround for solidity dynamic memory array\\n address[] memory _owners = new address[](1);\\n _owners[0] = address(_moduleAddr);\\n\\n // Call setup on safe to enable our new module and set the module as the only signer\\n _safe.setup(\\n _owners,\\n 1,\\n gnosisMultisendLibrary,\\n _multisendAction,\\n gnosisFallbackLibrary,\\n address(0),\\n 0,\\n payable(address(0))\\n );\\n\\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\\n\\n return address(_safe);\\n }\\n\\n // advanced summon baal with different configurations\\n // name and symbol can be blank if bringing own baal tokens\\n // zero address for either loot or shares token will summon new ones\\n // if bringing own tokens the ownership must be transfered to the new DAO\\n // zero address for Safe with summon and setup a new Safe\\n // if bringing existing safe the new dao must be enabled as a module\\n // todo: add a simple summon that just creates a dao with a single summoner\\n function _summonBaal(\\n bytes calldata initializationParams,\\n bytes[] calldata initializationActions,\\n uint256 _saltNonce\\n ) internal returns (address) {\\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\\n (\\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\\n address _safeAddr, /*address of safe, 0 addr if new*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\\n address _lootToken, /*predeployed loot token, 0 addr if new*/\\n address _sharesToken /*predeployed shares token, 0 addr if new*/\\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\\n\\n Baal _baal = Baal(\\n moduleProxyFactory.deployModule(\\n template, \\n abi.encodeWithSignature(\\\"avatar()\\\"), \\n _saltNonce\\n )\\n );\\n\\n // if loot or shares are zero address new tokens are deployed\\n // tokens need to be baalTokens\\n if(_lootToken == address(0) || _sharesToken == address(0)){\\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\\n // pause tokens by default and transfer to the DAO\\n IBaalToken(_lootToken).pause();\\n IBaalToken(_sharesToken).pause();\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n } else {\\n existingAddrs += 1;\\n }\\n\\n // if zero address deploy a new safe\\n // Needs to be a valid zodiac treasury\\n if(_safeAddr == address(0)){\\n _safeAddr = deployAndSetupSafe(address(_baal));\\n } else {\\n existingAddrs += 2;\\n }\\n\\n bytes memory _initializationMultisendData = encodeMultisend(\\n initializationActions,\\n address(_baal)\\n );\\n bytes memory _initializer = abi.encode(\\n _lootToken,\\n _sharesToken,\\n gnosisMultisendLibrary,\\n _safeAddr,\\n _forwarder,\\n _initializationMultisendData\\n );\\n // can run the actions now because we have a baal\\n _baal.setUp(_initializer);\\n\\n emit SummonBaal(\\n address(_baal),\\n address(_baal.lootToken()),\\n address(_baal.sharesToken()),\\n _safeAddr,\\n _forwarder,\\n existingAddrs\\n );\\n\\n return (address(_baal));\\n }\\n\\n function _authorizeUpgrade(address newImplementation)\\n internal\\n onlyOwner\\n override\\n {}\\n}\\n\",\"keccak256\":\"0x4053036af806c618440986e05da32008fd83cfee2e631fd3bed8b581045ee913\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060805234801561001457600080fd5b50608051612d2161004c60003960008181610483015281816104cf01528181610593015281816105d601526106720152612d216000f3fe608060405260043610620001375760003560e01c8063881e4ea411620000ad578063d9118ce7116200006c578063d9118ce71462000364578063ebfb8a431462000386578063f0fa28b914620003ab578063f2fde38b14620003cd578063f884231c14620003f257600080fd5b8063881e4ea414620002865780638da5cb5b14620002a857806397fc9fbb14620002c8578063a2346618146200030e578063d61f27ae146200033057600080fd5b80634f1ef28611620000fa5780634f1ef286146200020557806352d1902d146200021c5780636f2ddd931462000234578063715018a614620002565780638129fc1c146200026e57600080fd5b8063209f3695146200013c57806321d56a43146200017057806323626b4514620001925780633659cfe614620001b95780634a8b0b3214620001e0575b600080fd5b620001536200014d36600462001b6e565b62000417565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017d57600080fd5b5060cb5462000153906001600160a01b031681565b3480156200019f57600080fd5b50620001aa60c95481565b60405190815260200162000167565b348015620001c657600080fd5b50620001de620001d836600462001c09565b62000478565b005b348015620001ed57600080fd5b5062000153620001ff36600462001c29565b6200056d565b620001de6200021636600462001d65565b62000588565b3480156200022957600080fd5b50620001aa62000665565b3480156200024157600080fd5b5060ca5462000153906001600160a01b031681565b3480156200026357600080fd5b50620001de6200071b565b3480156200027b57600080fd5b50620001de62000733565b3480156200029357600080fd5b5060cd5462000153906001600160a01b031681565b348015620002b557600080fd5b506033546001600160a01b031662000153565b348015620002d557600080fd5b50620002ed620002e736600462001dbb565b62000856565b604080516001600160a01b0393841681529290911660208301520162000167565b3480156200031b57600080fd5b5060cf5462000153906001600160a01b031681565b3480156200033d57600080fd5b50620003556200034f36600462001eac565b62000a17565b60405162000167919062001f76565b3480156200037157600080fd5b5060ce5462000153906001600160a01b031681565b3480156200039357600080fd5b50620001de620003a536600462001f8b565b62000aec565b348015620003b857600080fd5b5060cc5462000153906001600160a01b031681565b348015620003da57600080fd5b50620001de620003ec36600462001c09565b62000df0565b348015620003ff57600080fd5b50620001536200041136600462001c09565b62000e6c565b600080620004298888888888620010c4565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004cd5760405162461bcd60e51b8152600401620004c49062002045565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200051860008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620005415760405162461bcd60e51b8152600401620004c49062002091565b6200054c81620015a4565b604080516000808252602082019092526200056a91839190620015ae565b50565b60006200057e8686868686620010c4565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005d45760405162461bcd60e51b8152600401620004c49062002045565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061f60008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620006485760405162461bcd60e51b8152600401620004c49062002091565b6200065382620015a4565b6200066182826001620015ae565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007075760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004c4565b5060008051602062002ca583398151915290565b620007256200172b565b62000731600062001787565b565b600054610100900460ff1615808015620007545750600054600160ff909116105b80620007705750303b15801562000770575060005460ff166001145b620007d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004c4565b6000805460ff191660011790558015620007f9576000805461ff0019166101001790555b62000803620017d9565b6200080d6200180d565b80156200056a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b9062000886908790602001620020dd565b60405160208183030381529060405285604051602001620008a8919062002108565b60408051601f1981840301815290829052620008c8929160240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009079062001acc565b620009149291906200215c565b604051809103906000f08015801562000931573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b9062000960908790879060240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516200099f9062001acc565b620009ac9291906200215c565b604051809103906000f080158015620009c9573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000aa65781600085600088858151811062000a425762000a426200218a565b60200260200101515189868151811062000a605762000a606200218a565b602002602001015160405160200162000a7f96959493929190620021a0565b6040516020818303038152906040529150808062000a9d9062002224565b91505062000a1d565b508060405160240162000aba919062001f76565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000af66200172b565b6001600160a01b03821662000b3f5760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004c4565b6001600160a01b03811662000b8a5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03871662000bd55760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03861662000c265760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004c4565b6001600160a01b03851662000c7e5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004c4565b6001600160a01b03841662000cd65760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004c4565b6001600160a01b03831662000d245760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004c4565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000dd18362002224565b9091555060405190815260200160405180910390a15050505050505050565b62000dfa6200172b565b6001600160a01b03811662000e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004c4565b6200056a8162001787565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000eb69390921691906004016200215c565b6020604051808303816000875af115801562000ed6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000efc919062002242565b6040516001600160a01b038516602482015290915060009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b1790528251915192935060009262000f61928492879284929188910162002262565b604051602081830303815290604052905060008160405160240162000f87919062001f76565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b1790528151600180825281840190935292935060009291908281019080368337019050509050868160008151811062000fec5762000fec6200218a565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001041938793600193928316928a92169060009081908190600401620022ba565b600060405180830381600087803b1580156200105c57600080fd5b505af115801562001071573d6000803e3d6000fd5b5050604080516001600160a01b03808a1682528b1660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0935001905060405180910390a1509295945050505050565b600080808080808080620010db8c8e018e6200237c565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b815260040162001184939291906200243a565b6020604051808303816000875af1158015620011a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011ca919062002242565b90506001600160a01b0383161580620011ea57506001600160a01b038216155b156200136e57620011fc878762000856565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200124057600080fd5b505af115801562001255573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200129557600080fd5b505af1158015620012aa573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b158015620012f257600080fd5b505af115801562001307573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b1580156200134f57600080fd5b505af115801562001364573d6000803e3d6000fd5b505050506200137e565b6200137b60018962002470565b97505b6001600160a01b038516620013a057620013988162000e6c565b9450620013b0565b620013ad60028962002470565b97505b6000620013c9620013c28d8f6200248b565b8362000a17565b60cd54604051919250600091620013f791879187916001600160a01b0316908b908b9088906020016200249a565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf906200143590849060040162001f76565b600060405180830381600087803b1580156200145057600080fd5b505af115801562001465573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014a8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014ce919062002242565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001516573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200153c919062002242565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200056a6200172b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620015e957620015e48362001837565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562001646575060408051601f3d908101601f191682019092526200164391810190620024ec565b60015b620016ab5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004c4565b60008051602062002ca583398151915281146200171d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004c4565b50620015e4838383620018d6565b6033546001600160a01b03163314620007315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004c4565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620018035760405162461bcd60e51b8152600401620004c49062002506565b6200073162001907565b600054610100900460ff16620007315760405162461bcd60e51b8152600401620004c49062002506565b6001600160a01b0381163b620018a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004c4565b60008051602062002ca583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620018e1836200193c565b600082511180620018ef5750805b15620015e4576200190183836200197e565b50505050565b600054610100900460ff16620019315760405162461bcd60e51b8152600401620004c49062002506565b620007313362001787565b620019478162001837565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620019e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004c4565b600080846001600160a01b03168460405162001a05919062002551565b600060405180830381855af49150503d806000811462001a42576040519150601f19603f3d011682016040523d82523d6000602084013e62001a47565b606091505b509150915062001a72828260405180606001604052806027815260200162002cc56027913962001a7b565b95945050505050565b6060831562001a8c57508162001a98565b62001a98838362001a9f565b9392505050565b81511562001ab05781518083602001fd5b8060405162461bcd60e51b8152600401620004c4919062001f76565b610735806200257083390190565b60008083601f84011262001aed57600080fd5b50813567ffffffffffffffff81111562001b0657600080fd5b60208301915083602082850101111562001b1f57600080fd5b9250929050565b60008083601f84011262001b3957600080fd5b50813567ffffffffffffffff81111562001b5257600080fd5b6020830191508360208260051b850101111562001b1f57600080fd5b6000806000806000806080878903121562001b8857600080fd5b863567ffffffffffffffff8082111562001ba157600080fd5b62001baf8a838b0162001ada565b9098509650602089013591508082111562001bc957600080fd5b5062001bd889828a0162001b26565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200056a57600080fd5b60006020828403121562001c1c57600080fd5b813562001a988162001bf3565b60008060008060006060868803121562001c4257600080fd5b853567ffffffffffffffff8082111562001c5b57600080fd5b62001c6989838a0162001ada565b9097509550602088013591508082111562001c8357600080fd5b5062001c928882890162001b26565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001ce65762001ce662001ca4565b604052919050565b600082601f83011262001d0057600080fd5b813567ffffffffffffffff81111562001d1d5762001d1d62001ca4565b62001d32601f8201601f191660200162001cba565b81815284602083860101111562001d4857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001d7957600080fd5b823562001d868162001bf3565b9150602083013567ffffffffffffffff81111562001da357600080fd5b62001db18582860162001cee565b9150509250929050565b6000806040838503121562001dcf57600080fd5b823567ffffffffffffffff8082111562001de857600080fd5b62001df68683870162001cee565b9350602085013591508082111562001e0d57600080fd5b5062001db18582860162001cee565b600067ffffffffffffffff8084111562001e3a5762001e3a62001ca4565b8360051b602062001e4d81830162001cba565b8681529350908401908084018783111562001e6757600080fd5b855b8381101562001ea05780358581111562001e835760008081fd5b62001e918a828a0162001cee565b83525090820190820162001e69565b50505050509392505050565b6000806040838503121562001ec057600080fd5b823567ffffffffffffffff81111562001ed857600080fd5b8301601f8101851362001eea57600080fd5b62001efb8582356020840162001e1c565b925050602083013562001f0e8162001bf3565b809150509250929050565b60005b8381101562001f3657818101518382015260200162001f1c565b83811115620019015750506000910152565b6000815180845262001f6281602086016020860162001f19565b601f01601f19169290920160200192915050565b60208152600062001a98602083018462001f48565b600080600080600080600080610100898b03121562001fa957600080fd5b883562001fb68162001bf3565b9750602089013562001fc88162001bf3565b9650604089013562001fda8162001bf3565b9550606089013562001fec8162001bf3565b9450608089013562001ffe8162001bf3565b935060a0890135620020108162001bf3565b925060c0890135620020228162001bf3565b915060e0890135620020348162001bf3565b809150509295985092959890939650565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008251620020f181846020870162001f19565b64081313d3d560da1b920191825250600501919050565b600082516200211c81846020870162001f19565b640b5313d3d560da1b920191825250600501919050565b60408152600062002148604083018562001f48565b828103602084015262001a72818562001f48565b6001600160a01b0383168152604060208201819052600090620021829083018462001f48565b949350505050565b634e487b7160e01b600052603260045260246000fd5b60008751620021b4818460208c0162001f19565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351620021fe81605584016020880162001f19565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156200223b576200223b6200220e565b5060010190565b6000602082840312156200225557600080fd5b815162001a988162001bf3565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620022a981605585016020870162001f19565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b82811015620023005781516001600160a01b031685529383019390830190600101620022d9565b50505083018a90526001600160a01b038916604084015282810360608401526200232b818962001f48565b9150506200234460808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200236f60e08301846001600160a01b03169052565b9998505050505050505050565b60008060008060008060c087890312156200239657600080fd5b863567ffffffffffffffff80821115620023af57600080fd5b620023bd8a838b0162001cee565b97506020890135915080821115620023d457600080fd5b50620023e389828a0162001cee565b9550506040870135620023f68162001bf3565b93506060870135620024088162001bf3565b925060808701356200241a8162001bf3565b915060a08701356200242c8162001bf3565b809150509295509295509295565b6001600160a01b0384168152606060208201819052600090620024609083018562001f48565b9050826040830152949350505050565b600082198211156200248657620024866200220e565b500190565b600062001a9836848462001e1c565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a08201819052600090620024e09083018462001f48565b98975050505050505050565b600060208284031215620024ff57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516200256581846020870162001f19565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220bc2877b2a93adc52a277122972e8c6137b7c0334e3648c825f4d4baaefb717c364736f6c634300080a0033", + "deployedBytecode": "0x608060405260043610620001375760003560e01c8063881e4ea411620000ad578063d9118ce7116200006c578063d9118ce71462000364578063ebfb8a431462000386578063f0fa28b914620003ab578063f2fde38b14620003cd578063f884231c14620003f257600080fd5b8063881e4ea414620002865780638da5cb5b14620002a857806397fc9fbb14620002c8578063a2346618146200030e578063d61f27ae146200033057600080fd5b80634f1ef28611620000fa5780634f1ef286146200020557806352d1902d146200021c5780636f2ddd931462000234578063715018a614620002565780638129fc1c146200026e57600080fd5b8063209f3695146200013c57806321d56a43146200017057806323626b4514620001925780633659cfe614620001b95780634a8b0b3214620001e0575b600080fd5b620001536200014d36600462001b6e565b62000417565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156200017d57600080fd5b5060cb5462000153906001600160a01b031681565b3480156200019f57600080fd5b50620001aa60c95481565b60405190815260200162000167565b348015620001c657600080fd5b50620001de620001d836600462001c09565b62000478565b005b348015620001ed57600080fd5b5062000153620001ff36600462001c29565b6200056d565b620001de6200021636600462001d65565b62000588565b3480156200022957600080fd5b50620001aa62000665565b3480156200024157600080fd5b5060ca5462000153906001600160a01b031681565b3480156200026357600080fd5b50620001de6200071b565b3480156200027b57600080fd5b50620001de62000733565b3480156200029357600080fd5b5060cd5462000153906001600160a01b031681565b348015620002b557600080fd5b506033546001600160a01b031662000153565b348015620002d557600080fd5b50620002ed620002e736600462001dbb565b62000856565b604080516001600160a01b0393841681529290911660208301520162000167565b3480156200031b57600080fd5b5060cf5462000153906001600160a01b031681565b3480156200033d57600080fd5b50620003556200034f36600462001eac565b62000a17565b60405162000167919062001f76565b3480156200037157600080fd5b5060ce5462000153906001600160a01b031681565b3480156200039357600080fd5b50620001de620003a536600462001f8b565b62000aec565b348015620003b857600080fd5b5060cc5462000153906001600160a01b031681565b348015620003da57600080fd5b50620001de620003ec36600462001c09565b62000df0565b348015620003ff57600080fd5b50620001536200041136600462001c09565b62000e6c565b600080620004298888888888620010c4565b604080518581526001600160a01b03831660208201529192507fe1e7ecd08b1e119c2755872e95180d0d070137a7c2af361de1d7256bc3674107910160405180910390a1979650505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620004cd5760405162461bcd60e51b8152600401620004c49062002045565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200051860008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620005415760405162461bcd60e51b8152600401620004c49062002091565b6200054c81620015a4565b604080516000808252602082019092526200056a91839190620015ae565b50565b60006200057e8686868686620010c4565b9695505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005d45760405162461bcd60e51b8152600401620004c49062002045565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200061f60008051602062002ca5833981519152546001600160a01b031690565b6001600160a01b031614620006485760405162461bcd60e51b8152600401620004c49062002091565b6200065382620015a4565b6200066182826001620015ae565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007075760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401620004c4565b5060008051602062002ca583398151915290565b620007256200172b565b62000731600062001787565b565b600054610100900460ff1615808015620007545750600054600160ff909116105b80620007705750303b15801562000770575060005460ff166001145b620007d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620004c4565b6000805460ff191660011790558015620007f9576000805461ff0019166101001790555b62000803620017d9565b6200080d6200180d565b80156200056a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b60ce5460405160009182916001600160a01b039091169063562d190d60e01b9062000886908790602001620020dd565b60405160208183030381529060405285604051602001620008a8919062002108565b60408051601f1981840301815290829052620008c8929160240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051620009079062001acc565b620009149291906200215c565b604051809103906000f08015801562000931573d6000803e3d6000fd5b5060cf546040519193506001600160a01b03169063562d190d60e01b9062000960908790879060240162002133565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516200099f9062001acc565b620009ac9291906200215c565b604051809103906000f080158015620009c9573d6000803e3d6000fd5b50604080516001600160a01b038086168252831660208201529192507ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a19250929050565b60608060005b845181101562000aa65781600085600088858151811062000a425762000a426200218a565b60200260200101515189868151811062000a605762000a606200218a565b602002602001015160405160200162000a7f96959493929190620021a0565b6040516020818303038152906040529150808062000a9d9062002224565b91505062000a1d565b508060405160240162000aba919062001f76565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b179052949350505050565b62000af66200172b565b6001600160a01b03821662000b3f5760405162461bcd60e51b815260206004820152600e60248201526d10b637b7ba29b4b733b632ba37b760911b6044820152606401620004c4565b6001600160a01b03811662000b8a5760405162461bcd60e51b815260206004820152601060248201526f10b9b430b932b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03871662000bd55760405162461bcd60e51b815260206004820152601060248201526f10b3b737b9b4b9a9b4b733b632ba37b760811b6044820152606401620004c4565b6001600160a01b03861662000c265760405162461bcd60e51b815260206004820152601660248201527521676e6f73697346616c6c6261636b4c69627261727960501b6044820152606401620004c4565b6001600160a01b03851662000c7e5760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369734d756c746973656e644c6962726172790000000000000000006044820152606401620004c4565b6001600160a01b03841662000cd65760405162461bcd60e51b815260206004820152601760248201527f21676e6f7369735361666550726f7879466163746f72790000000000000000006044820152606401620004c4565b6001600160a01b03831662000d245760405162461bcd60e51b8152602060048201526013602482015272216d6f64756c6550726f7879466163746f727960681b6044820152606401620004c4565b60ca80546001600160a01b03199081166001600160a01b038b81169190911790925560cb805482168a841617905560cc8054821689841617905560cd8054821688841617905560d08054821687841617905560d18054821686841617905560ce8054821685841617905560cf805490911691831691909117905560c980547fe6fb5c8c5a2615df9d8de2df2fdebdae949bcf3a2a80cb8ff90ace3459de85cc91600062000dd18362002224565b9091555060405190815260200160405180910390a15050505050505050565b62000dfa6200172b565b6001600160a01b03811662000e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620004c4565b6200056a8162001787565b60d05460cb5460408051602081018252600080825291516361b69abd60e01b8152919384936001600160a01b03918216936361b69abd9362000eb69390921691906004016200215c565b6020604051808303816000875af115801562000ed6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000efc919062002242565b6040516001600160a01b038516602482015290915060009060440160408051601f19818403018152918152602080830180516001600160e01b031663610b592560e01b1790528251915192935060009262000f61928492879284929188910162002262565b604051602081830303815290604052905060008160405160240162000f87919062001f76565b60408051601f19818403018152918152602080830180516001600160e01b03166346c07f8560e11b1790528151600180825281840190935292935060009291908281019080368337019050509050868160008151811062000fec5762000fec6200218a565b6001600160a01b03928316602091820292909201015260cd5460cc5460405163b63e800d60e01b81528884169363b63e800d9362001041938793600193928316928a92169060009081908190600401620022ba565b600060405180830381600087803b1580156200105c57600080fd5b505af115801562001071573d6000803e3d6000fd5b5050604080516001600160a01b03808a1682528b1660208201527f7ad675e6593a2c3bdf52607876353caf39853572dd787d2a5eed1cc99097b3f0935001905060405180910390a1509295945050505050565b600080808080808080620010db8c8e018e6200237c565b955095509550955095509550600060d160009054906101000a90046001600160a01b03166001600160a01b031663f1ab873c60ca60009054906101000a90046001600160a01b0316604051602401604051602081830303815290604052632d77bef360e11b6001600160e01b0319166020820180516001600160e01b0383818316178352505050508d6040518463ffffffff1660e01b815260040162001184939291906200243a565b6020604051808303816000875af1158015620011a4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011ca919062002242565b90506001600160a01b0383161580620011ea57506001600160a01b038216155b156200136e57620011fc878762000856565b8093508194505050826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200124057600080fd5b505af115801562001255573d6000803e3d6000fd5b50505050816001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200129557600080fd5b505af1158015620012aa573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528616925063f2fde38b9150602401600060405180830381600087803b158015620012f257600080fd5b505af115801562001307573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b1580156200134f57600080fd5b505af115801562001364573d6000803e3d6000fd5b505050506200137e565b6200137b60018962002470565b97505b6001600160a01b038516620013a057620013988162000e6c565b9450620013b0565b620013ad60028962002470565b97505b6000620013c9620013c28d8f6200248b565b8362000a17565b60cd54604051919250600091620013f791879187916001600160a01b0316908b908b9088906020016200249a565b60408051601f198184030181529082905263a4f9edbf60e01b825291506001600160a01b0384169063a4f9edbf906200143590849060040162001f76565b600060405180830381600087803b1580156200145057600080fd5b505af115801562001465573d6000803e3d6000fd5b50505050826001600160a01b0316638009ba1f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620014a8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620014ce919062002242565b6001600160a01b0316836001600160a01b031663f460124d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562001516573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200153c919062002242565b604080516001600160a01b038b811682528a811660208301529181018e905291811691908616907fcf2f09cd0dbc149b12a3630a11b7d73476660f3d08d3dc7dcc79c6dec555ee7a9060600160405180910390a450909e9d5050505050505050505050505050565b6200056a6200172b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620015e957620015e48362001837565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562001646575060408051601f3d908101601f191682019092526200164391810190620024ec565b60015b620016ab5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401620004c4565b60008051602062002ca583398151915281146200171d5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401620004c4565b50620015e4838383620018d6565b6033546001600160a01b03163314620007315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620004c4565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620018035760405162461bcd60e51b8152600401620004c49062002506565b6200073162001907565b600054610100900460ff16620007315760405162461bcd60e51b8152600401620004c49062002506565b6001600160a01b0381163b620018a65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620004c4565b60008051602062002ca583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620018e1836200193c565b600082511180620018ef5750805b15620015e4576200190183836200197e565b50505050565b600054610100900460ff16620019315760405162461bcd60e51b8152600401620004c49062002506565b620007313362001787565b620019478162001837565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620019e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401620004c4565b600080846001600160a01b03168460405162001a05919062002551565b600060405180830381855af49150503d806000811462001a42576040519150601f19603f3d011682016040523d82523d6000602084013e62001a47565b606091505b509150915062001a72828260405180606001604052806027815260200162002cc56027913962001a7b565b95945050505050565b6060831562001a8c57508162001a98565b62001a98838362001a9f565b9392505050565b81511562001ab05781518083602001fd5b8060405162461bcd60e51b8152600401620004c4919062001f76565b610735806200257083390190565b60008083601f84011262001aed57600080fd5b50813567ffffffffffffffff81111562001b0657600080fd5b60208301915083602082850101111562001b1f57600080fd5b9250929050565b60008083601f84011262001b3957600080fd5b50813567ffffffffffffffff81111562001b5257600080fd5b6020830191508360208260051b850101111562001b1f57600080fd5b6000806000806000806080878903121562001b8857600080fd5b863567ffffffffffffffff8082111562001ba157600080fd5b62001baf8a838b0162001ada565b9098509650602089013591508082111562001bc957600080fd5b5062001bd889828a0162001b26565b979a9699509760408101359660609091013595509350505050565b6001600160a01b03811681146200056a57600080fd5b60006020828403121562001c1c57600080fd5b813562001a988162001bf3565b60008060008060006060868803121562001c4257600080fd5b853567ffffffffffffffff8082111562001c5b57600080fd5b62001c6989838a0162001ada565b9097509550602088013591508082111562001c8357600080fd5b5062001c928882890162001b26565b96999598509660400135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001ce65762001ce662001ca4565b604052919050565b600082601f83011262001d0057600080fd5b813567ffffffffffffffff81111562001d1d5762001d1d62001ca4565b62001d32601f8201601f191660200162001cba565b81815284602083860101111562001d4857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121562001d7957600080fd5b823562001d868162001bf3565b9150602083013567ffffffffffffffff81111562001da357600080fd5b62001db18582860162001cee565b9150509250929050565b6000806040838503121562001dcf57600080fd5b823567ffffffffffffffff8082111562001de857600080fd5b62001df68683870162001cee565b9350602085013591508082111562001e0d57600080fd5b5062001db18582860162001cee565b600067ffffffffffffffff8084111562001e3a5762001e3a62001ca4565b8360051b602062001e4d81830162001cba565b8681529350908401908084018783111562001e6757600080fd5b855b8381101562001ea05780358581111562001e835760008081fd5b62001e918a828a0162001cee565b83525090820190820162001e69565b50505050509392505050565b6000806040838503121562001ec057600080fd5b823567ffffffffffffffff81111562001ed857600080fd5b8301601f8101851362001eea57600080fd5b62001efb8582356020840162001e1c565b925050602083013562001f0e8162001bf3565b809150509250929050565b60005b8381101562001f3657818101518382015260200162001f1c565b83811115620019015750506000910152565b6000815180845262001f6281602086016020860162001f19565b601f01601f19169290920160200192915050565b60208152600062001a98602083018462001f48565b600080600080600080600080610100898b03121562001fa957600080fd5b883562001fb68162001bf3565b9750602089013562001fc88162001bf3565b9650604089013562001fda8162001bf3565b9550606089013562001fec8162001bf3565b9450608089013562001ffe8162001bf3565b935060a0890135620020108162001bf3565b925060c0890135620020228162001bf3565b915060e0890135620020348162001bf3565b809150509295985092959890939650565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60008251620020f181846020870162001f19565b64081313d3d560da1b920191825250600501919050565b600082516200211c81846020870162001f19565b640b5313d3d560da1b920191825250600501919050565b60408152600062002148604083018562001f48565b828103602084015262001a72818562001f48565b6001600160a01b0383168152604060208201819052600090620021829083018462001f48565b949350505050565b634e487b7160e01b600052603260045260246000fd5b60008751620021b4818460208c0162001f19565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351620021fe81605584016020880162001f19565b0160550198975050505050505050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156200223b576200223b6200220e565b5060010190565b6000602082840312156200225557600080fd5b815162001a988162001bf3565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251620022a981605585016020870162001f19565b919091016055019695505050505050565b6101008082528951908201819052600090610120830190602090818d01845b82811015620023005781516001600160a01b031685529383019390830190600101620022d9565b50505083018a90526001600160a01b038916604084015282810360608401526200232b818962001f48565b9150506200234460808301876001600160a01b03169052565b6001600160a01b03851660a08301528360c08301526200236f60e08301846001600160a01b03169052565b9998505050505050505050565b60008060008060008060c087890312156200239657600080fd5b863567ffffffffffffffff80821115620023af57600080fd5b620023bd8a838b0162001cee565b97506020890135915080821115620023d457600080fd5b50620023e389828a0162001cee565b9550506040870135620023f68162001bf3565b93506060870135620024088162001bf3565b925060808701356200241a8162001bf3565b915060a08701356200242c8162001bf3565b809150509295509295509295565b6001600160a01b0384168152606060208201819052600090620024609083018562001f48565b9050826040830152949350505050565b600082198211156200248657620024866200220e565b500190565b600062001a9836848462001e1c565b6001600160a01b0387811682528681166020830152858116604083015284811660608301528316608082015260c060a08201819052600090620024e09083018462001f48565b98975050505050505050565b600060208284031215620024ff57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516200256581846020870162001f19565b919091019291505056fe60806040526040516107353803806107358339810160408190526100229161031e565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ec565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b81526004016101489190610408565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561030d5781810151838201526020016102f5565b838111156100645750506000910152565b6000806040838503121561033157600080fd5b82516001600160a01b038116811461034857600080fd5b60208401519092506001600160401b038082111561036557600080fd5b818501915085601f83011261037957600080fd5b81518181111561038b5761038b6102dc565b604051601f8201601f19908116603f011681019083821181831017156103b3576103b36102dc565b816040528281528860208487010111156103cc57600080fd5b6103dd8360208301602088016102f2565b80955050505050509250929050565b600082516103fe8184602087016102f2565b9190910192915050565b60208152600082518060208401526104278160408501602087016102f2565b601f01601f19169190910160400192915050565b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e09190610218565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610234565b60005b838110156102035781810151838201526020016101eb565b83811115610212576000848401525b50505050565b6000825161022a8184602087016101e8565b9190910192915050565b60208152600082518060208401526102538160408501602087016101e8565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207412a0b3e226211217f19a3b0db835079d54492e8c6a40cf0ec680c2ad3f06ee64736f6c634300080a0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220bc2877b2a93adc52a277122972e8c6137b7c0334e3648c825f4d4baaefb717c364736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3937, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 12611, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "addrsVersion", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 12613, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "template", + "offset": 0, + "slot": "202", + "type": "t_address_payable" + }, + { + "astId": 12615, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSingleton", + "offset": 0, + "slot": "203", + "type": "t_address" + }, + { + "astId": 12617, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisFallbackLibrary", + "offset": 0, + "slot": "204", + "type": "t_address" + }, + { + "astId": 12619, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisMultisendLibrary", + "offset": 0, + "slot": "205", + "type": "t_address" + }, + { + "astId": 12621, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "lootSingleton", + "offset": 0, + "slot": "206", + "type": "t_address" + }, + { + "astId": 12623, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "sharesSingleton", + "offset": 0, + "slot": "207", + "type": "t_address" + }, + { + "astId": 12626, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "gnosisSafeProxyFactory", + "offset": 0, + "slot": "208", + "type": "t_contract(GnosisSafeProxyFactory)3163" + }, + { + "astId": 12629, + "contract": "contracts/BaalSummoner.sol:BaalSummoner", + "label": "moduleProxyFactory", + "offset": 0, + "slot": "209", + "type": "t_contract(ModuleProxyFactory)3539" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "encoding": "inplace", + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(GnosisSafeProxyFactory)3163": { + "encoding": "inplace", + "label": "contract GnosisSafeProxyFactory", + "numberOfBytes": "20" + }, + "t_contract(ModuleProxyFactory)3539": { + "encoding": "inplace", + "label": "contract ModuleProxyFactory", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/BaalSummoner_Proxy.json b/lib/Baal/deployments/sepolia/BaalSummoner_Proxy.json new file mode 100644 index 0000000..ea801e8 --- /dev/null +++ b/lib/Baal/deployments/sepolia/BaalSummoner_Proxy.json @@ -0,0 +1,158 @@ +{ + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "transactionIndex": 27, + "gasUsed": "333576", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000001020000000000000000000000000000080000020000000000000000000800000000020000000000000000000000400000200000000000000000000000000000004000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040040000000000000000000000000000020000000200000000000002000000000000000000000000000000000000000000000", + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7", + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "logs": [ + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e0f33e95af46ead1fe181d2a74919bff903cd5d4" + ], + "data": "0x", + "logIndex": 29, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + }, + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000007c510abf45c10a9ab949ef69ccbba5d77312d814" + ], + "data": "0x", + "logIndex": 30, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + }, + { + "transactionIndex": 27, + "blockNumber": 4816767, + "transactionHash": "0xd3da6276b6e9164b799b6600297ce0e829d3a1363bd4301069ef910bbf17e9fa", + "address": "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 31, + "blockHash": "0xce54b13e6bdb8530cacc9ce6fd98328c6e04d9586a140da8d9c7deb342283da7" + } + ], + "blockNumber": 4816767, + "cumulativeGasUsed": "5390384", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/Loot.json b/lib/Baal/deployments/sepolia/Loot.json new file mode 100644 index 0000000..200df2f --- /dev/null +++ b/lib/Baal/deployments/sepolia/Loot.json @@ -0,0 +1,1186 @@ +{ + "address": "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0xb7aa8207c333cc29126aacd92da239361a7dfb99420272f40a55954e476c94be", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + "transactionIndex": 45, + "gasUsed": "2320633", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x30670a9f856f17a25450e2397dd40bbcdf7ab26c2761a23c1be788b4e1477999", + "transactionHash": "0xb7aa8207c333cc29126aacd92da239361a7dfb99420272f40a55954e476c94be", + "logs": [ + { + "transactionIndex": 45, + "blockNumber": 4816763, + "transactionHash": "0xb7aa8207c333cc29126aacd92da239361a7dfb99420272f40a55954e476c94be", + "address": "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 23, + "blockHash": "0x30670a9f856f17a25450e2397dd40bbcdf7ab26c2761a23c1be788b4e1477999" + } + ], + "blockNumber": 4816763, + "cumulativeGasUsed": "8151961", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSnapshotId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"balanceOfAt(address,uint256)\":{\"details\":\"Retrieves the balance of `account` at the time `snapshotId` was created.\"},\"burn(address,uint256)\":{\"params\":{\"account\":\"Address to lose loot\",\"amount\":\"Amount to burn\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"mint(address,uint256)\":{\"params\":{\"amount\":\"Amount to mint\",\"recipient\":\"Address to receive loot\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setUp(string,string)\":{\"details\":\"initializer should prevent this from being called again\",\"params\":{\"name_\":\"Name for ERC20 token trackers\",\"symbol_\":\"Symbol for ERC20 token trackers\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"totalSupplyAt(uint256)\":{\"details\":\"Retrieves the total supply at the time `snapshotId` was created.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(address,uint256)\":{\"notice\":\"Baal-only function to burn loot.\"},\"getCurrentSnapshotId()\":{\"notice\":\"get current SnapshotId\"},\"mint(address,uint256)\":{\"notice\":\"Baal-only function to mint loot.\"},\"pause()\":{\"notice\":\"Baal-only function to pause shares.\"},\"setUp(string,string)\":{\"notice\":\"Configure loot - called by Baal on summon\"},\"snapshot()\":{\"notice\":\"Allows baal to create a snapshot\"},\"unpause()\":{\"notice\":\"Baal-only function to pause shares.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/LootERC20.sol\":\"Loot\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0xb1d9e69cf8073efa574b31b1f840e20709139c19bfb27e60b16393d6073f3d42\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ArraysUpgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\\n * total supply at the time are recorded for later access.\\n *\\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\\n * In naive implementations it's possible to perform a \\\"double spend\\\" attack by reusing the same balance from different\\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\\n * used to create an efficient ERC20 forking mechanism.\\n *\\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\\n * and the account address.\\n *\\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\\n *\\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\\n * alternative consider {ERC20Votes}.\\n *\\n * ==== Gas Costs\\n *\\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\\n *\\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\\n * transfers will have normal cost until the next snapshot, and so on.\\n */\\n\\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\\n function __ERC20Snapshot_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\\n }\\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\\n\\n using ArraysUpgradeable for uint256[];\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\\n // Snapshot struct, but that would impede usage of functions that work on an array.\\n struct Snapshots {\\n uint256[] ids;\\n uint256[] values;\\n }\\n\\n mapping(address => Snapshots) private _accountBalanceSnapshots;\\n Snapshots private _totalSupplySnapshots;\\n\\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\\n CountersUpgradeable.Counter private _currentSnapshotId;\\n\\n /**\\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\\n */\\n event Snapshot(uint256 id);\\n\\n /**\\n * @dev Creates a new snapshot and returns its snapshot id.\\n *\\n * Emits a {Snapshot} event that contains the same id.\\n *\\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\\n *\\n * [WARNING]\\n * ====\\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\\n * you must consider that it can potentially be used by attackers in two ways.\\n *\\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\\n * section above.\\n *\\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\\n * ====\\n */\\n function _snapshot() internal virtual returns (uint256) {\\n _currentSnapshotId.increment();\\n\\n uint256 currentId = _getCurrentSnapshotId();\\n emit Snapshot(currentId);\\n return currentId;\\n }\\n\\n /**\\n * @dev Get the current snapshotId\\n */\\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\\n return _currentSnapshotId.current();\\n }\\n\\n /**\\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\\n */\\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\\n\\n return snapshotted ? value : balanceOf(account);\\n }\\n\\n /**\\n * @dev Retrieves the total supply at the time `snapshotId` was created.\\n */\\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\\n\\n return snapshotted ? value : totalSupply();\\n }\\n\\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n if (from == address(0)) {\\n // mint\\n _updateAccountSnapshot(to);\\n _updateTotalSupplySnapshot();\\n } else if (to == address(0)) {\\n // burn\\n _updateAccountSnapshot(from);\\n _updateTotalSupplySnapshot();\\n } else {\\n // transfer\\n _updateAccountSnapshot(from);\\n _updateAccountSnapshot(to);\\n }\\n }\\n\\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\\n require(snapshotId > 0, \\\"ERC20Snapshot: id is 0\\\");\\n require(snapshotId <= _getCurrentSnapshotId(), \\\"ERC20Snapshot: nonexistent id\\\");\\n\\n // When a valid snapshot is queried, there are three possibilities:\\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\\n // to this id is the current one.\\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\\n // requested id, and its value is the one to return.\\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\\n // larger than the requested one.\\n //\\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\\n // exactly this.\\n\\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\\n\\n if (index == snapshots.ids.length) {\\n return (false, 0);\\n } else {\\n return (true, snapshots.values[index]);\\n }\\n }\\n\\n function _updateAccountSnapshot(address account) private {\\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\\n }\\n\\n function _updateTotalSupplySnapshot() private {\\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\\n }\\n\\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\\n uint256 currentId = _getCurrentSnapshotId();\\n if (_lastSnapshotId(snapshots.ids) < currentId) {\\n snapshots.ids.push(currentId);\\n snapshots.values.push(currentValue);\\n }\\n }\\n\\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\\n if (ids.length == 0) {\\n return 0;\\n } else {\\n return ids[ids.length - 1];\\n }\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[46] private __gap;\\n}\\n\",\"keccak256\":\"0x42da8099f59958af496f6c8f0d9c1ce0a929151e02f877e4be23aca4cc440cbe\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/EIP712Upgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 51\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n mapping(address => CountersUpgradeable.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\\n __EIP712_init_unchained(name, \\\"1\\\");\\n }\\n\\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(address owner) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(address owner) internal virtual returns (uint256 current) {\\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xfe1053f3a6ee4527cde96c8152b8b1dbb98774639a64e819087bc80e618d7f7f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./StorageSlotUpgradeable.sol\\\";\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary ArraysUpgradeable {\\n using StorageSlotUpgradeable for bytes32;\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * `array` is expected to be sorted in ascending order, and to contain no\\n * repeated elements.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n if (array.length == 0) {\\n return 0;\\n }\\n\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n while (low < high) {\\n uint256 mid = MathUpgradeable.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getUint256Slot();\\n }\\n}\\n\",\"keccak256\":\"0xc3821e9d41b2b19b612238b308dcc8f4ab46afcd0f6b3bd174e89789bbf59e26\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary CountersUpgradeable {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0x798741e231b22b81e2dd2eddaaf8832dee4baf5cd8e2dbaa5c1dd12a1c053c4d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"contracts/LootERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\n\\ncontract Loot is\\n ERC20SnapshotUpgradeable,\\n ERC20PermitUpgradeable,\\n PausableUpgradeable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Configure loot - called by Baal on summon\\n /// @dev initializer should prevent this from being called again\\n /// @param name_ Name for ERC20 token trackers\\n /// @param symbol_ Symbol for ERC20 token trackers\\n function setUp(string memory name_, string memory symbol_)\\n external\\n initializer\\n {\\n require(bytes(name_).length != 0, \\\"loot: name empty\\\");\\n require(bytes(symbol_).length != 0, \\\"loot: symbol empty\\\");\\n\\n __ERC20_init(name_, symbol_);\\n __ERC20Permit_init(name_);\\n __Pausable_init();\\n __ERC20Snapshot_init();\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /// @notice Allows baal to create a snapshot\\n function snapshot() external onlyOwner returns(uint256) {\\n return _snapshot();\\n }\\n\\n /// @notice get current SnapshotId\\n function getCurrentSnapshotId() external view returns (uint256) {\\n return _getCurrentSnapshotId();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function pause() public onlyOwner {\\n _pause();\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function unpause() public onlyOwner {\\n _unpause();\\n }\\n\\n /// @notice Baal-only function to mint loot.\\n /// @param recipient Address to receive loot\\n /// @param amount Amount to mint\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n // can not be more than half the max because of totalsupply of loot and shares\\n require(totalSupply() + amount <= type(uint256).max / 2, \\\"loot: cap exceeded\\\");\\n _mint(recipient, amount);\\n }\\n\\n /// @notice Baal-only function to burn loot.\\n /// @param account Address to lose loot\\n /// @param amount Amount to burn\\n function burn(address account, uint256 amount) external onlyOwner {\\n _burn(account, amount);\\n }\\n\\n /// @notice Internal hook to restrict token transfers unless allowed by baal\\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\\n /// @param from The address of the source account.\\n /// @param to The address of the destination account.\\n /// @param amount The number of `loot` tokens to transfer.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(\\n from == address(0) || /*Minting allowed*/\\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\\n !paused(),\\n \\\"loot: !transferable\\\"\\n );\\n }\\n\\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0xa3b301421fabcf9fc110e5532cc4368c6e25a80348dbfe47f8e8e4dd72ce02cb\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c61288a62000126600039600081816106480152818161069101528181610838015281816108780152610907015261288a6000f3fe6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106101cd5760003560e01c80635c975abb116100f75780639711715a11610095578063a9059cbb11610064578063a9059cbb146104dc578063d505accf146104fc578063dd62ed3e1461051c578063f2fde38b1461053c57600080fd5b80639711715a14610467578063981b24d01461047c5780639dc29fac1461049c578063a457c2d7146104bc57600080fd5b80637ecebe00116100d15780637ecebe00146103f45780638456cb59146104145780638da5cb5b1461042957806395d89b411461045257600080fd5b80635c975abb1461039157806370a08231146103a9578063715018a6146103df57600080fd5b8063395093511161016f5780634f1ef2861161013e5780634f1ef2861461033457806352d1902d146103475780635439ad861461035c578063562d190d1461037157600080fd5b806339509351146102bf5780633f4ba83a146102df57806340c10f19146102f45780634ee2cd7e1461031457600080fd5b806323b872dd116101ab57806323b872dd1461024c578063313ce5671461026c5780633644e515146102885780633659cfe61461029d57600080fd5b806306fdde03146101d2578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b3480156101de57600080fd5b506101e761055c565b6040516101f491906125ed565b60405180910390f35b34801561020957600080fd5b5061021d61021836600461251b565b6105ee565b60405190151581526020016101f4565b34801561023957600080fd5b506035545b6040519081526020016101f4565b34801561025857600080fd5b5061021d61026736600461240a565b610608565b34801561027857600080fd5b50604051601281526020016101f4565b34801561029457600080fd5b5061023e61062e565b3480156102a957600080fd5b506102bd6102b83660046123bc565b61063d565b005b3480156102cb57600080fd5b5061021d6102da36600461251b565b610726565b3480156102eb57600080fd5b506102bd610748565b34801561030057600080fd5b506102bd61030f36600461251b565b61075a565b34801561032057600080fd5b5061023e61032f36600461251b565b6107d4565b6102bd6103423660046124b9565b61082d565b34801561035357600080fd5b5061023e6108fa565b34801561036857600080fd5b5061023e6109ad565b34801561037d57600080fd5b506102bd61038c36600461255e565b6109b7565b34801561039d57600080fd5b5060fe5460ff1661021d565b3480156103b557600080fd5b5061023e6103c43660046123bc565b6001600160a01b031660009081526033602052604090205490565b3480156103eb57600080fd5b506102bd610b79565b34801561040057600080fd5b5061023e61040f3660046123bc565b610b8b565b34801561042057600080fd5b506102bd610ba9565b34801561043557600080fd5b50610130546040516001600160a01b0390911681526020016101f4565b34801561045e57600080fd5b506101e7610bb9565b34801561047357600080fd5b5061023e610bc8565b34801561048857600080fd5b5061023e6104973660046125b8565b610bda565b3480156104a857600080fd5b506102bd6104b736600461251b565b610c05565b3480156104c857600080fd5b5061021d6104d736600461251b565b610c17565b3480156104e857600080fd5b5061021d6104f736600461251b565b610c9d565b34801561050857600080fd5b506102bd610517366004612446565b610cab565b34801561052857600080fd5b5061023e6105373660046123d7565b610e0f565b34801561054857600080fd5b506102bd6105573660046123bc565b610e3a565b60606036805461056b90612780565b80601f016020809104026020016040519081016040528092919081815260200182805461059790612780565b80156105e45780601f106105b9576101008083540402835291602001916105e4565b820191906000526020600020905b8154815290600101906020018083116105c757829003601f168201915b5050505050905090565b6000336105fc818585610eb0565b60019150505b92915050565b600033610616858285610fd4565b61062185858561104e565b60019150505b9392505050565b6000610638611204565b905090565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016141561068f5760405162461bcd60e51b815260040161068690612620565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106d860008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146106fe5760405162461bcd60e51b81526004016106869061266c565b6107078161127f565b6040805160008082526020820190925261072391839190611287565b50565b6000336105fc8185856107398383610e0f565b6107439190612703565b610eb0565b610750611401565b61075861145c565b565b610762611401565b61076f600260001961271b565b8161077960355490565b6107839190612703565b11156107c65760405162461bcd60e51b81526020600482015260126024820152711b1bdbdd0e8818d85c08195e18d95959195960721b6044820152606401610686565b6107d082826114ae565b5050565b6001600160a01b0382166000908152606560205260408120819081906107fb90859061157b565b9150915081610822576001600160a01b038516600090815260336020526040902054610824565b805b95945050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108765760405162461bcd60e51b815260040161068690612620565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166108bf60008051602061280e833981519152546001600160a01b031690565b6001600160a01b0316146108e55760405162461bcd60e51b81526004016106869061266c565b6108ee8261127f565b6107d082826001611287565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461099a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610686565b5060008051602061280e83398151915290565b6000610638611672565b600054610100900460ff16158080156109d75750600054600160ff909116105b806109f15750303b1580156109f1575060005460ff166001145b610a545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610686565b6000805460ff191660011790558015610a77576000805461ff0019166101001790555b8251610ab85760405162461bcd60e51b815260206004820152601060248201526f6c6f6f743a206e616d6520656d70747960801b6044820152606401610686565b8151610afb5760405162461bcd60e51b81526020600482015260126024820152716c6f6f743a2073796d626f6c20656d70747960701b6044820152606401610686565b610b05838361167d565b610b0e836116ae565b610b166116f8565b610b1e611727565b610b2661174e565b610b2e611727565b8015610b74576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610b81611401565b610758600061177d565b6001600160a01b038116600090815260cb6020526040812054610602565b610bb1611401565b6107586117d0565b60606037805461056b90612780565b6000610bd2611401565b61063861180d565b6000806000610bea84606661157b565b9150915081610bfb57603554610bfd565b805b949350505050565b610c0d611401565b6107d08282611867565b60003381610c258286610e0f565b905083811015610c855760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610686565b610c928286868403610eb0565b506001949350505050565b6000336105fc81858561104e565b83421115610cfb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610686565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610d2a8c6119a7565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610d85826119cf565b90506000610d9582878787611a1d565b9050896001600160a01b0316816001600160a01b031614610df85760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610686565b610e038a8a8a610eb0565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b610e42611401565b6001600160a01b038116610ea75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6107238161177d565b6001600160a01b038316610f125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610686565b6001600160a01b038216610f735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610686565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610fe08484610e0f565b90506000198114611048578181101561103b5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610686565b6110488484848403610eb0565b50505050565b6001600160a01b0383166110b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610686565b6001600160a01b0382166111145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610686565b61111f838383611a45565b6001600160a01b038316600090815260336020526040902054818110156111975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610686565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111f79086815260200190565b60405180910390a3611048565b60006106387f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61123360975490565b6098546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b610723611401565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156112ba57610b7483611ad3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112f357600080fd5b505afa925050508015611323575060408051601f3d908101601f1916820190925261132091810190612545565b60015b6113865760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610686565b60008051602061280e83398151915281146113f55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610686565b50610b74838383611b6f565b610130546001600160a01b031633146107585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610686565b611464611b94565b60fe805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166115045760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610686565b61151060008383611a45565b80603560008282546115229190612703565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080600084116115c75760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610686565b6115cf611672565b84111561161e5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610686565b600061162a8486611bdd565b845490915081141561164357600080925092505061166b565b600184600101828154811061165a5761165a6127e1565b906000526020600020015492509250505b9250929050565b600061063860685490565b600054610100900460ff166116a45760405162461bcd60e51b8152600401610686906126b8565b6107d08282611c88565b600054610100900460ff166116d55760405162461bcd60e51b8152600401610686906126b8565b61072381604051806040016040528060018152602001603160f81b815250611cd6565b600054610100900460ff1661171f5760405162461bcd60e51b8152600401610686906126b8565b610758611d17565b600054610100900460ff166107585760405162461bcd60e51b8152600401610686906126b8565b600054610100900460ff166117755760405162461bcd60e51b8152600401610686906126b8565b610758611d4a565b61013080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6117d8611d7a565b60fe805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114913390565b600061181d606880546001019055565b6000611827611672565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb678160405161185a91815260200190565b60405180910390a1919050565b6001600160a01b0382166118c75760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610686565b6118d382600083611a45565b6001600160a01b038216600090815260336020526040902054818110156119475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610686565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6001600160a01b038116600090815260cb602052604090208054600181018255905b50919050565b60006106026119dc611204565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000611a2e87878787611dc0565b91509150611a3b81611e84565b5095945050505050565b611a50838383611fd2565b6001600160a01b0383161580611a835750610130546001600160a01b031633148015611a8357506001600160a01b038216155b80611a91575060fe5460ff16155b610b745760405162461bcd60e51b81526020600482015260136024820152726c6f6f743a20217472616e7366657261626c6560681b6044820152606401610686565b6001600160a01b0381163b611b405760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610686565b60008051602061280e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611b788361201a565b600082511180611b855750805b15610b7457611048838361205a565b60fe5460ff166107585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610686565b8154600090611bee57506000610602565b82546000905b80821015611c3b576000611c088383612145565b60008781526020902090915085908201541115611c2757809150611c35565b611c32816001612703565b92505b50611bf4565b600082118015611c67575083611c6486611c5660018661273d565b600091825260209091200190565b54145b15611c8057611c7760018361273d565b92505050610602565b509050610602565b600054610100900460ff16611caf5760405162461bcd60e51b8152600401610686906126b8565b8151611cc2906036906020850190612276565b508051610b74906037906020840190612276565b600054610100900460ff16611cfd5760405162461bcd60e51b8152600401610686906126b8565b815160209283012081519190920120609791909155609855565b600054610100900460ff16611d3e5760405162461bcd60e51b8152600401610686906126b8565b60fe805460ff19169055565b600054610100900460ff16611d715760405162461bcd60e51b8152600401610686906126b8565b6107583361177d565b60fe5460ff16156107585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610686565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611df75750600090506003611e7b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611e4b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611e7457600060019250925050611e7b565b9150600090505b94509492505050565b6000816004811115611e9857611e986127cb565b1415611ea15750565b6001816004811115611eb557611eb56127cb565b1415611f035760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610686565b6002816004811115611f1757611f176127cb565b1415611f655760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610686565b6003816004811115611f7957611f796127cb565b14156107235760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610686565b6001600160a01b038316611ff157611fe982612160565b610b74612193565b6001600160a01b03821661200857611fe983612160565b61201183612160565b610b7482612160565b61202381611ad3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6120c25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610686565b600080846001600160a01b0316846040516120dd91906125d1565b600060405180830381855af49150503d8060008114612118576040519150601f19603f3d011682016040523d82523d6000602084013e61211d565b606091505b5091509150610824828260405180606001604052806027815260200161282e602791396121a1565b6000612154600284841861271b565b61062790848416612703565b6001600160a01b038116600090815260656020908152604080832060339092529091205461072391906121ba565b6121ba565b610758606661218e60355490565b606083156121b0575081610627565b6106278383612204565b60006121c4611672565b9050806121d08461222e565b1015610b74578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8151156122145781518083602001fd5b8060405162461bcd60e51b815260040161068691906125ed565b805460009061223f57506000919050565b8154829061224f9060019061273d565b8154811061225f5761225f6127e1565b90600052602060002001549050919050565b919050565b82805461228290612780565b90600052602060002090601f0160209004810192826122a457600085556122ea565b82601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b5b808211156122f657600081556001016122fb565b600067ffffffffffffffff8084111561232a5761232a6127f7565b604051601f8501601f19908116603f01168101908282118183101715612352576123526127f7565b8160405280935085815286868601111561236b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b038116811461227157600080fd5b600082601f8301126123ad57600080fd5b6106278383356020850161230f565b6000602082840312156123ce57600080fd5b61062782612385565b600080604083850312156123ea57600080fd5b6123f383612385565b915061240160208401612385565b90509250929050565b60008060006060848603121561241f57600080fd5b61242884612385565b925061243660208501612385565b9150604084013590509250925092565b600080600080600080600060e0888a03121561246157600080fd5b61246a88612385565b965061247860208901612385565b95506040880135945060608801359350608088013560ff8116811461249c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156124cc57600080fd5b6124d583612385565b9150602083013567ffffffffffffffff8111156124f157600080fd5b8301601f8101851361250257600080fd5b6125118582356020840161230f565b9150509250929050565b6000806040838503121561252e57600080fd5b61253783612385565b946020939093013593505050565b60006020828403121561255757600080fd5b5051919050565b6000806040838503121561257157600080fd5b823567ffffffffffffffff8082111561258957600080fd5b6125958683870161239c565b935060208501359150808211156125ab57600080fd5b506125118582860161239c565b6000602082840312156125ca57600080fd5b5035919050565b600082516125e3818460208701612754565b9190910192915050565b602081526000825180602084015261260c816040850160208701612754565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612716576127166127b5565b500190565b60008261273857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561274f5761274f6127b5565b500390565b60005b8381101561276f578181015183820152602001612757565b838111156110485750506000910152565b600181811c9082168061279457607f821691505b602082108114156119c957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204196986f131ab75e482c8e8e87b668e2e5b20fa8d630b5bb7623e2871e6c4b6f64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "balanceOfAt(address,uint256)": { + "details": "Retrieves the balance of `account` at the time `snapshotId` was created." + }, + "burn(address,uint256)": { + "params": { + "account": "Address to lose loot", + "amount": "Amount to burn" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "mint(address,uint256)": { + "params": { + "amount": "Amount to mint", + "recipient": "Address to receive loot" + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setUp(string,string)": { + "details": "initializer should prevent this from being called again", + "params": { + "name_": "Name for ERC20 token trackers", + "symbol_": "Symbol for ERC20 token trackers" + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "totalSupplyAt(uint256)": { + "details": "Retrieves the total supply at the time `snapshotId` was created." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "burn(address,uint256)": { + "notice": "Baal-only function to burn loot." + }, + "getCurrentSnapshotId()": { + "notice": "get current SnapshotId" + }, + "mint(address,uint256)": { + "notice": "Baal-only function to mint loot." + }, + "pause()": { + "notice": "Baal-only function to pause shares." + }, + "setUp(string,string)": { + "notice": "Configure loot - called by Baal on summon" + }, + "snapshot()": { + "notice": "Allows baal to create a snapshot" + }, + "unpause()": { + "notice": "Baal-only function to pause shares." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4971, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4977, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4979, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 4981, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage" + }, + { + "astId": 4983, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage" + }, + { + "astId": 5563, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 5685, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_accountBalanceSnapshots", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_address,t_struct(Snapshots)5680_storage)" + }, + { + "astId": 5688, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_totalSupplySnapshots", + "offset": 0, + "slot": "102", + "type": "t_struct(Snapshots)5680_storage" + }, + { + "astId": 5691, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_currentSnapshotId", + "offset": 0, + "slot": "104", + "type": "t_struct(Counter)6730_storage" + }, + { + "astId": 5989, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "105", + "type": "t_array(t_uint256)46_storage" + }, + { + "astId": 7403, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 6041, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)6730_storage)" + }, + { + "astId": 6049, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32" + }, + { + "astId": 6205, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4773, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_paused", + "offset": 0, + "slot": "254", + "type": "t_bool" + }, + { + "astId": 4878, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3937, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_owner", + "offset": 0, + "slot": "304", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "354", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/LootERC20.sol:Loot", + "label": "__gap", + "offset": 0, + "slot": "404", + "type": "t_array(t_uint256)50_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)46_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[46]", + "numberOfBytes": "1472" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_struct(Counter)6730_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)6730_storage" + }, + "t_mapping(t_address,t_struct(Snapshots)5680_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", + "numberOfBytes": "32", + "value": "t_struct(Snapshots)5680_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)6730_storage": { + "encoding": "inplace", + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "astId": 6729, + "contract": "contracts/LootERC20.sol:Loot", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Snapshots)5680_storage": { + "encoding": "inplace", + "label": "struct ERC20SnapshotUpgradeable.Snapshots", + "members": [ + { + "astId": 5676, + "contract": "contracts/LootERC20.sol:Loot", + "label": "ids", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5679, + "contract": "contracts/LootERC20.sol:Loot", + "label": "values", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/Shares.json b/lib/Baal/deployments/sepolia/Shares.json new file mode 100644 index 0000000..846fce7 --- /dev/null +++ b/lib/Baal/deployments/sepolia/Shares.json @@ -0,0 +1,1624 @@ +{ + "address": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "Snapshot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "balanceOfAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegationNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nCheckpoints", + "type": "uint256" + } + ], + "name": "getCheckpoint", + "outputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "fromTimePoint", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "internalType": "struct BaalVotes.Checkpoint", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentSnapshotId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "now", + "outputs": [ + { + "internalType": "uint256", + "name": "timePoint", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "setUp", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "snapshotId", + "type": "uint256" + } + ], + "name": "totalSupplyAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x66d7df5aa43ee5e818b14fb7eecd4791b2ff7603a63014507092a6f064c54aa0", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "transactionIndex": 0, + "gasUsed": "2950689", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000004000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb807aa1ea1d9d402fbbe2c8b7f15eb5e5cb0feaddccb8ce28dd18c4483ee3e92", + "transactionHash": "0x66d7df5aa43ee5e818b14fb7eecd4791b2ff7603a63014507092a6f064c54aa0", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 4816764, + "transactionHash": "0x66d7df5aa43ee5e818b14fb7eecd4791b2ff7603a63014507092a6f064c54aa0", + "address": "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0xb807aa1ea1d9d402fbbe2c8b7f15eb5e5cb0feaddccb8ce28dd18c4483ee3e92" + } + ], + "blockNumber": 4816764, + "cumulativeGasUsed": "2950689", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"checkpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"fromTimePoint\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"delegationNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nCheckpoints\",\"type\":\"uint256\"}],\"name\":\"getCheckpoint\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromTimePoint\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"internalType\":\"struct BaalVotes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSnapshotId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timePoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"now\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timePoint\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"name\":\"setUp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"balanceOfAt(address,uint256)\":{\"details\":\"Retrieves the balance of `account` at the time `snapshotId` was created.\"},\"burn(address,uint256)\":{\"params\":{\"account\":\"Address to lose shares\",\"amount\":\"Amount to burn\"}},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"delegate(address)\":{\"params\":{\"delegatee\":\"The address to delegate votes to.\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"params\":{\"delegatee\":\"The address to delegate 'votes' to.\",\"expiry\":\"The time at which to expire the signature.\",\"nonce\":\"The contract state required to match the signature.\",\"r\":\"The r signature\",\"s\":\"The s signature\",\"v\":\"The v signature\"}},\"getPastVotes(address,uint256)\":{\"params\":{\"account\":\"The user to check `votes` for.\",\"timePoint\":\"The unix time to check `votes` for.\"},\"returns\":{\"votes\":\"Past `votes` delegated to `account`.\"}},\"getVotes(address)\":{\"params\":{\"account\":\"The user to check delegated `votes` for.\"},\"returns\":{\"votes\":\"Current `votes` delegated to `account`.\"}},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"mint(address,uint256)\":{\"params\":{\"amount\":\"Amount to mint\",\"recipient\":\"Address to receive shares\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"now()\":{\"returns\":{\"timePoint\":\"returns unix epoch timestamp\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setUp(string,string)\":{\"details\":\"initializer should prevent this from being called again\",\"params\":{\"name_\":\"Name for ERC20 token trackers\",\"symbol_\":\"Symbol for ERC20 token trackers\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"totalSupplyAt(uint256)\":{\"details\":\"Retrieves the total supply at the time `snapshotId` was created.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"title\":\"Shares\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"burn(address,uint256)\":{\"notice\":\"Baal-only function to burn shares.\"},\"delegate(address)\":{\"notice\":\"Delegate votes from user to `delegatee`.\"},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"notice\":\"Delegates votes from `signer` to `delegatee` with EIP-712 signature.\"},\"getCurrentSnapshotId()\":{\"notice\":\"get current SnapshotId\"},\"getPastVotes(address,uint256)\":{\"notice\":\"Returns the prior number of `votes` for `account` as of `timePoint`.\"},\"getVotes(address)\":{\"notice\":\"Returns the current delegated `vote` balance for `account`.\"},\"mint(address,uint256)\":{\"notice\":\"Baal-only function to mint shares.\"},\"now()\":{\"notice\":\"Returns the current timepoint.\"},\"pause()\":{\"notice\":\"Baal-only function to pause shares.\"},\"setUp(string,string)\":{\"notice\":\"Configure shares - called by Baal on summon\"},\"snapshot()\":{\"notice\":\"Allows baal to create a snapshot\"},\"unpause()\":{\"notice\":\"Baal-only function to unpause shares.\"}},\"notice\":\"Accounting for Baal non voting shares\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SharesERC20.sol\":\"Shares\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0xb1d9e69cf8073efa574b31b1f840e20709139c19bfb27e60b16393d6073f3d42\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ArraysUpgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\\n * total supply at the time are recorded for later access.\\n *\\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\\n * In naive implementations it's possible to perform a \\\"double spend\\\" attack by reusing the same balance from different\\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\\n * used to create an efficient ERC20 forking mechanism.\\n *\\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\\n * and the account address.\\n *\\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\\n *\\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\\n * alternative consider {ERC20Votes}.\\n *\\n * ==== Gas Costs\\n *\\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\\n *\\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\\n * transfers will have normal cost until the next snapshot, and so on.\\n */\\n\\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\\n function __ERC20Snapshot_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\\n }\\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\\n\\n using ArraysUpgradeable for uint256[];\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\\n // Snapshot struct, but that would impede usage of functions that work on an array.\\n struct Snapshots {\\n uint256[] ids;\\n uint256[] values;\\n }\\n\\n mapping(address => Snapshots) private _accountBalanceSnapshots;\\n Snapshots private _totalSupplySnapshots;\\n\\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\\n CountersUpgradeable.Counter private _currentSnapshotId;\\n\\n /**\\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\\n */\\n event Snapshot(uint256 id);\\n\\n /**\\n * @dev Creates a new snapshot and returns its snapshot id.\\n *\\n * Emits a {Snapshot} event that contains the same id.\\n *\\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\\n *\\n * [WARNING]\\n * ====\\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\\n * you must consider that it can potentially be used by attackers in two ways.\\n *\\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\\n * section above.\\n *\\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\\n * ====\\n */\\n function _snapshot() internal virtual returns (uint256) {\\n _currentSnapshotId.increment();\\n\\n uint256 currentId = _getCurrentSnapshotId();\\n emit Snapshot(currentId);\\n return currentId;\\n }\\n\\n /**\\n * @dev Get the current snapshotId\\n */\\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\\n return _currentSnapshotId.current();\\n }\\n\\n /**\\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\\n */\\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\\n\\n return snapshotted ? value : balanceOf(account);\\n }\\n\\n /**\\n * @dev Retrieves the total supply at the time `snapshotId` was created.\\n */\\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\\n\\n return snapshotted ? value : totalSupply();\\n }\\n\\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n if (from == address(0)) {\\n // mint\\n _updateAccountSnapshot(to);\\n _updateTotalSupplySnapshot();\\n } else if (to == address(0)) {\\n // burn\\n _updateAccountSnapshot(from);\\n _updateTotalSupplySnapshot();\\n } else {\\n // transfer\\n _updateAccountSnapshot(from);\\n _updateAccountSnapshot(to);\\n }\\n }\\n\\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\\n require(snapshotId > 0, \\\"ERC20Snapshot: id is 0\\\");\\n require(snapshotId <= _getCurrentSnapshotId(), \\\"ERC20Snapshot: nonexistent id\\\");\\n\\n // When a valid snapshot is queried, there are three possibilities:\\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\\n // to this id is the current one.\\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\\n // requested id, and its value is the one to return.\\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\\n // larger than the requested one.\\n //\\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\\n // exactly this.\\n\\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\\n\\n if (index == snapshots.ids.length) {\\n return (false, 0);\\n } else {\\n return (true, snapshots.values[index]);\\n }\\n }\\n\\n function _updateAccountSnapshot(address account) private {\\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\\n }\\n\\n function _updateTotalSupplySnapshot() private {\\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\\n }\\n\\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\\n uint256 currentId = _getCurrentSnapshotId();\\n if (_lastSnapshotId(snapshots.ids) < currentId) {\\n snapshots.ids.push(currentId);\\n snapshots.values.push(currentValue);\\n }\\n }\\n\\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\\n if (ids.length == 0) {\\n return 0;\\n } else {\\n return ids[ids.length - 1];\\n }\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[46] private __gap;\\n}\\n\",\"keccak256\":\"0x42da8099f59958af496f6c8f0d9c1ce0a929151e02f877e4be23aca4cc440cbe\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./draft-IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../../../utils/cryptography/EIP712Upgradeable.sol\\\";\\nimport \\\"../../../utils/CountersUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 51\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n mapping(address => CountersUpgradeable.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\\n __EIP712_init_unchained(name, \\\"1\\\");\\n }\\n\\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(address owner) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(address owner) internal virtual returns (uint256 current) {\\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xfe1053f3a6ee4527cde96c8152b8b1dbb98774639a64e819087bc80e618d7f7f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xcc70d8e2281fb3ff69e8ab242500f10142cd0a7fa8dd9e45882be270d4d09024\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./StorageSlotUpgradeable.sol\\\";\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary ArraysUpgradeable {\\n using StorageSlotUpgradeable for bytes32;\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * `array` is expected to be sorted in ascending order, and to contain no\\n * repeated elements.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n if (array.length == 0) {\\n return 0;\\n }\\n\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n while (low < high) {\\n uint256 mid = MathUpgradeable.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds down (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\\n bytes32 slot;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0, arr.slot)\\n slot := add(keccak256(0, 0x20), pos)\\n }\\n return slot.getUint256Slot();\\n }\\n}\\n\",\"keccak256\":\"0xc3821e9d41b2b19b612238b308dcc8f4ab46afcd0f6b3bd174e89789bbf59e26\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary CountersUpgradeable {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0x798741e231b22b81e2dd2eddaaf8832dee4baf5cd8e2dbaa5c1dd12a1c053c4d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/SharesERC20.sol\":{\"content\":\"pragma solidity 0.8.7;\\n//SPDX-License-Identifier: MIT\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\\\";\\n\\nimport \\\"./utils/BaalVotes.sol\\\";\\nimport \\\"./interfaces/IBaal.sol\\\";\\n\\n// import \\\"hardhat/console.sol\\\";\\n\\n/// @title Shares\\n/// @notice Accounting for Baal non voting shares\\ncontract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Configure shares - called by Baal on summon\\n /// @dev initializer should prevent this from being called again\\n /// @param name_ Name for ERC20 token trackers\\n /// @param symbol_ Symbol for ERC20 token trackers\\n function setUp(string memory name_, string memory symbol_)\\n external\\n initializer\\n {\\n require(bytes(name_).length != 0, \\\"shares: name empty\\\");\\n require(bytes(symbol_).length != 0, \\\"shares: symbol empty\\\");\\n\\n __ERC20_init(name_, symbol_);\\n __ERC20Permit_init(name_);\\n __Pausable_init();\\n __ERC20Snapshot_init();\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n __EIP712_init_delegation(\\\"delegation\\\", \\\"4\\\");\\n\\n\\n }\\n\\n /// @notice Baal-only function to pause shares.\\n function pause() public onlyOwner {\\n _pause();\\n }\\n\\n /// @notice Baal-only function to unpause shares.\\n function unpause() public onlyOwner {\\n _unpause();\\n }\\n\\n /// @notice Allows baal to create a snapshot\\n function snapshot() external onlyOwner returns(uint256) {\\n return _snapshot();\\n }\\n\\n /// @notice get current SnapshotId\\n function getCurrentSnapshotId() external view returns (uint256) {\\n return _getCurrentSnapshotId();\\n }\\n\\n /// @notice Baal-only function to mint shares.\\n /// @param recipient Address to receive shares\\n /// @param amount Amount to mint\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n // can not be more than half the max because of totalsupply of loot and shares\\n require(totalSupply() + amount <= type(uint256).max / 2, \\\"shares: cap exceeded\\\");\\n _mint(recipient, amount);\\n }\\n\\n /// @notice Baal-only function to burn shares.\\n /// @param account Address to lose shares\\n /// @param amount Amount to burn\\n function burn(address account, uint256 amount) external onlyOwner {\\n _burn(account, amount);\\n }\\n\\n /// @notice Internal hook to restrict token transfers unless allowed by baal\\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\\n /// @param from The address of the source account.\\n /// @param to The address of the destination account.\\n /// @param amount The number of `shares` tokens to transfer.\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal override(BaalVotes, ERC20SnapshotUpgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(\\n from == address(0) || /*Minting allowed*/\\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\\n !paused(),\\n \\\"shares: !transferable\\\"\\n );\\n }\\n\\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x01a30f13f538ee4d7e448aa984e10f24a18d7a35e9e45ab3b501364516f0725d\",\"license\":\"MIT\"},\"contracts/interfaces/IBaal.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaal {\\n function lootToken() external view returns (address);\\n function sharesToken() external view returns (address);\\n function votingPeriod() external view returns (uint32);\\n function gracePeriod() external view returns (uint32);\\n function proposalCount() external view returns (uint32);\\n function proposalOffering() external view returns (uint256);\\n function quorumPercent() external view returns (uint256);\\n function sponsorThreshold() external view returns (uint256);\\n function minRetentionPercent() external view returns (uint256);\\n function latestSponsoredProposalId() external view returns (uint32);\\n\\n function setUp(bytes memory initializationParams) external;\\n function multisendLibrary() external view returns (address);\\n // Module\\n function avatar() external view returns (address);\\n function target() external view returns (address);\\n function setAvatar(address avatar) external;\\n function setTarget(address avatar) external;\\n // BaseRelayRecipient\\n function trustedForwarder() external view returns (address);\\n function setTrustedForwarder(address trustedForwarderAddress) external;\\n\\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\\n function totalLoot() external view returns (uint256);\\n function totalShares() external view returns (uint256);\\n function totalSupply() external view returns (uint256);\\n function lootPaused() external view returns (bool);\\n function sharesPaused() external view returns (bool);\\n \\n function shamans(address shaman) external view returns (uint256);\\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\\n function isAdmin(address shaman) external view returns (bool);\\n function isManager(address shaman) external view returns (bool);\\n function isGovernor(address shaman) external view returns (bool);\\n function lockAdmin() external;\\n function lockManager() external;\\n function lockGovernor() external;\\n function adminLock() external view returns (bool);\\n function managerLock() external view returns (bool);\\n function governorLock() external view returns (bool);\\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\\n function setGovernanceConfig(bytes memory governanceConfig) external;\\n\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable returns (uint256);\\n function sponsorProposal(uint32 id) external;\\n function processProposal(uint32 id, bytes calldata proposalData) external;\\n function cancelProposal(uint32 id) external;\\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\\n function submitVote(uint32 id, bool approved) external;\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\\n\\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\\n}\\n\",\"keccak256\":\"0xa8e49237a041f30caf45f9999fe28fdaac6a847530f411761a9b493022622948\",\"license\":\"MIT\"},\"contracts/utils/BaalVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\\\";\\nimport \\\"./DelegationEIP712Upgradeable.sol\\\";\\n\\n/**\\n * @dev similar to Openzeplin ERC20Votes\\n *\\n * uses timestamp instead of block.number and auto self delegates.\\n *\\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\\n * power can be queried through the public accessors {getPriorVotes}.\\n *\\n */\\nabstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {\\n using ECDSAUpgradeable for bytes32;\\n\\n struct Checkpoint {\\n /*Baal checkpoint for marking number of delegated votes*/\\n uint32 fromTimePoint; /*unix time for referencing voting balance*/\\n uint256 votes; /*votes at given unix time*/\\n }\\n\\n // DELEGATE TRACKING\\n mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/\\n mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/\\n mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/\\n mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/\\n\\n // SIGNATURE HELPERS\\n bytes32 constant DELEGATION_TYPEHASH = keccak256(\\\"Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n event DelegateChanged(\\n address indexed delegator,\\n address indexed fromDelegate,\\n address indexed toDelegate\\n ); /*emits when an account changes its voting delegate*/\\n event DelegateVotesChanged(\\n address indexed delegate,\\n uint256 previousBalance,\\n uint256 newBalance\\n ); /*emits when a delegate account's voting balance changes*/\\n\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, amount);\\n\\n /*If recipient is receiving their first shares, auto-self delegate*/\\n if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {\\n delegates[to] = to;\\n }\\n\\n _moveDelegates(delegates[from], delegates[to], amount);\\n }\\n\\n /// @notice Delegate votes from user to `delegatee`.\\n /// @param delegatee The address to delegate votes to.\\n function delegate(address delegatee) external virtual {\\n _delegate(msg.sender, delegatee);\\n }\\n\\n /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.\\n /// @param delegatee The address to delegate 'votes' to.\\n /// @param nonce The contract state required to match the signature.\\n /// @param expiry The time at which to expire the signature.\\n /// @param v The v signature\\n /// @param r The r signature\\n /// @param s The s signature\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public {\\n require(now() <= expiry, \\\"ERC20Votes: signature expired\\\");\\n address signer = ECDSAUpgradeable.recover(\\n _hashTypedDataV4Delegation(\\n keccak256(\\n abi.encode(\\n DELEGATION_TYPEHASH,\\n keccak256(abi.encodePacked(name())),\\n delegatee,\\n nonce,\\n expiry\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n require(signer != address(0), \\\"ERC20Votes: invalid signer (0x0)\\\");\\n require(nonce == delegationNonces[signer], \\\"ERC20Votes: invalid nonce\\\");\\n\\n delegationNonces[signer]++;\\n _delegate(signer, delegatee);\\n }\\n\\n /// @notice Delegates Baal voting weight.\\n /// @param delegator The address to delegate 'votes' from.\\n /// @param delegatee The address to delegate 'votes' to.\\n function _delegate(address delegator, address delegatee) internal virtual {\\n require(balanceOf(delegator) > 0, \\\"!shares\\\");\\n address currentDelegate = delegates[delegator];\\n delegates[delegator] = delegatee;\\n\\n _moveDelegates(\\n currentDelegate,\\n delegatee,\\n uint256(balanceOf(delegator))\\n );\\n\\n emit DelegateChanged(delegator, currentDelegate, delegatee);\\n }\\n\\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\\n /// @param srcRep The address to delegate 'votes' from.\\n /// @param dstRep The address to delegate 'votes' to.\\n /// @param amount The amount of votes to delegate\\n function _moveDelegates(\\n address srcRep,\\n address dstRep,\\n uint256 amount\\n ) private {\\n unchecked {\\n if (srcRep != dstRep && amount != 0) {\\n if (srcRep != address(0)) {\\n uint256 srcRepNum = numCheckpoints[srcRep];\\n uint256 srcRepOld = srcRepNum != 0\\n ? getCheckpoint(srcRep, srcRepNum - 1).votes\\n : 0;\\n uint256 srcRepNew = srcRepOld - amount;\\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\\n }\\n\\n if (dstRep != address(0)) {\\n uint256 dstRepNum = numCheckpoints[dstRep];\\n uint256 dstRepOld = dstRepNum != 0\\n ? getCheckpoint(dstRep, dstRepNum - 1).votes\\n : 0;\\n uint256 dstRepNew = dstRepOld + amount;\\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\\n }\\n }\\n }\\n }\\n\\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\\n /// @param delegatee The address to snapshot\\n /// @param nCheckpoints The number of checkpoints delegatee has\\n /// @param oldVotes The number of votes the delegatee had\\n /// @param newVotes The number of votes the delegate has now\\n function _writeCheckpoint(\\n address delegatee,\\n uint256 nCheckpoints,\\n uint256 oldVotes,\\n uint256 newVotes\\n ) private {\\n uint32 timePoint = uint32(now());\\n\\n unchecked {\\n if (\\n nCheckpoints != 0 &&\\n checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint\\n ) {\\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\\n } else {\\n checkpoints[delegatee][nCheckpoints] = Checkpoint(\\n timePoint,\\n newVotes\\n );\\n numCheckpoints[delegatee] = nCheckpoints + 1;\\n }\\n }\\n\\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\\n }\\n\\n /// @notice Returns the current timepoint.\\n /// @return timePoint returns unix epoch timestamp\\n function now() public view returns (uint256 timePoint) {\\n return block.timestamp;\\n }\\n\\n /// @notice Returns the prior number of `votes` for `account` as of `timePoint`.\\n /// @param account The user to check `votes` for.\\n /// @param timePoint The unix time to check `votes` for.\\n /// @return votes Past `votes` delegated to `account`.\\n function getPastVotes(address account, uint256 timePoint)\\n external\\n view\\n virtual\\n returns (uint256 votes)\\n {\\n require(timePoint < now(), \\\"!determined\\\"); /* Prior votes must be in the past*/\\n\\n uint256 nCheckpoints = numCheckpoints[account];\\n if (nCheckpoints == 0) return 0;\\n\\n unchecked {\\n if (\\n getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=\\n timePoint\\n ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/\\n if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;\\n uint256 lower = 0;\\n uint256 upper = nCheckpoints - 1;\\n while (upper > lower) {\\n /* Binary search to look for highest timePoint before desired timePoint*/\\n uint256 center = upper - (upper - lower) / 2;\\n Checkpoint memory cp = getCheckpoint(account, center);\\n if (cp.fromTimePoint == timePoint) return cp.votes;\\n else if (cp.fromTimePoint < timePoint) lower = center;\\n else upper = center - 1;\\n }\\n votes = getCheckpoint(account, lower).votes;\\n }\\n }\\n\\n /// @notice Returns the current delegated `vote` balance for `account`.\\n /// @param account The user to check delegated `votes` for.\\n /// @return votes Current `votes` delegated to `account`.\\n function getVotes(address account)\\n external\\n view\\n virtual\\n returns (uint256 votes)\\n {\\n uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/\\n unchecked {\\n votes = nCheckpoints != 0\\n ? getCheckpoint(account, nCheckpoints - 1).votes\\n : 0;\\n }\\n }\\n\\n function getCheckpoint(address delegatee, uint256 nCheckpoints)\\n public\\n view\\n virtual\\n returns (Checkpoint memory)\\n {\\n return checkpoints[delegatee][nCheckpoints];\\n }\\n}\\n\",\"keccak256\":\"0x2003d3afd190a6c73b8e29970cdd84f0deb9bc543ed63d058451020293486348\",\"license\":\"MIT\"},\"contracts/utils/DelegationEIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4Delegation}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract DelegationEIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME_DELEGATION;\\n bytes32 private _HASHED_VERSION_DELEGATION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained_delegation(name, version);\\n }\\n\\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME_DELEGATION = hashedName;\\n _HASHED_VERSION_DELEGATION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\\n }\\n\\n function _buildDomainSeparatorDelegation(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\\n return _HASHED_NAME_DELEGATION;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION_DELEGATION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xaaca6373c8a75310ffcbbd63e8d0689ab6e404c96366e3fa4158bd3957924089\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000eb565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e9576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6133ef6200012660003960008181610891015281816108da01528181610c1801528181610c580152610ce701526133ef6000f3fe60806040526004361061023b5760003560e01c80635c19a95c1161012e5780639711715a116100ab578063a9059cbb1161006f578063a9059cbb14610705578063c3cda52014610725578063d505accf14610745578063dd62ed3e14610765578063f2fde38b1461078557600080fd5b80639711715a14610670578063981b24d0146106855780639ab24eb0146106a55780639dc29fac146106c5578063a457c2d7146106e557600080fd5b80637ecebe00116100f25780637ecebe00146105f45780638456cb59146106145780638abe09f2146106295780638da5cb5b1461063c57806395d89b411461065b57600080fd5b80635c19a95c146105425780635c975abb146105625780636fcfff451461057b57806370a08231146105a9578063715018a6146105df57600080fd5b80633a46b1a8116101bc5780634f1ef286116101805780634f1ef2861461049657806352d1902d146104a95780635439ad86146104be578063562d190d146104d3578063587cde1e146104f357600080fd5b80633a46b1a8146103e05780633f4ba83a1461040057806340c10f191461041557806347f761f5146104355780634ee2cd7e1461047657600080fd5b806323b872dd1161020357806323b872dd1461034d578063313ce5671461036d5780633644e515146103895780633659cfe61461039e57806339509351146103c057600080fd5b806303c8a3c61461024057806306fdde0314610281578063095ea7b3146102a35780630cdfebfa146102d357806318160ddd14610338575b600080fd5b34801561024c57600080fd5b5061026e61025b366004612eb7565b6101036020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561028d57600080fd5b506102966107a5565b6040516102789190613137565b3480156102af57600080fd5b506102c36102be36600461300d565b610837565b6040519015158152602001610278565b3480156102df57600080fd5b5061031c6102ee36600461300d565b6101006020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610278565b34801561034457600080fd5b5060355461026e565b34801561035957600080fd5b506102c3610368366004612f05565b610851565b34801561037957600080fd5b5060405160128152602001610278565b34801561039557600080fd5b5061026e610877565b3480156103aa57600080fd5b506103be6103b9366004612eb7565b610886565b005b3480156103cc57600080fd5b506102c36103db36600461300d565b61096f565b3480156103ec57600080fd5b5061026e6103fb36600461300d565b610991565b34801561040c57600080fd5b506103be610ad2565b34801561042157600080fd5b506103be61043036600461300d565b610ae4565b34801561044157600080fd5b5061045561045036600461300d565b610b60565b60408051825163ffffffff1681526020928301519281019290925201610278565b34801561048257600080fd5b5061026e61049136600461300d565b610bb3565b6103be6104a4366004612fab565b610c0d565b3480156104b557600080fd5b5061026e610cda565b3480156104ca57600080fd5b5061026e610d8d565b3480156104df57600080fd5b506103be6104ee3660046130a8565b610d97565b3480156104ff57600080fd5b5061052a61050e366004612eb7565b610102602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610278565b34801561054e57600080fd5b506103be61055d366004612eb7565b610fa2565b34801561056e57600080fd5b506101685460ff166102c3565b34801561058757600080fd5b5061026e610596366004612eb7565b6101016020526000908152604090205481565b3480156105b557600080fd5b5061026e6105c4366004612eb7565b6001600160a01b031660009081526033602052604090205490565b3480156105eb57600080fd5b506103be610fac565b34801561060057600080fd5b5061026e61060f366004612eb7565b610fbe565b34801561062057600080fd5b506103be610fdc565b34801561063557600080fd5b504261026e565b34801561064857600080fd5b50610136546001600160a01b031661052a565b34801561066757600080fd5b50610296610fec565b34801561067c57600080fd5b5061026e610ffb565b34801561069157600080fd5b5061026e6106a0366004613102565b61100d565b3480156106b157600080fd5b5061026e6106c0366004612eb7565b611039565b3480156106d157600080fd5b506103be6106e036600461300d565b611077565b3480156106f157600080fd5b506102c361070036600461300d565b611089565b34801561071157600080fd5b506102c361072036600461300d565b61110f565b34801561073157600080fd5b506103be610740366004613037565b61111d565b34801561075157600080fd5b506103be610760366004612f41565b611313565b34801561077157600080fd5b5061026e610780366004612ed2565b611477565b34801561079157600080fd5b506103be6107a0366004612eb7565b6114a2565b6060603680546107b4906132ca565b80601f01602080910402602001604051908101604052809291908181526020018280546107e0906132ca565b801561082d5780601f106108025761010080835404028352916020019161082d565b820191906000526020600020905b81548152906001019060200180831161081057829003601f168201915b5050505050905090565b600033610845818585611518565b60019150505b92915050565b60003361085f85828561163c565b61086a8585856116b6565b60019150505b9392505050565b600061088161186c565b905090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108d85760405162461bcd60e51b81526004016108cf9061316a565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610921600080516020613373833981519152546001600160a01b031690565b6001600160a01b0316146109475760405162461bcd60e51b81526004016108cf906131b6565b610950816118a3565b6040805160008082526020820190925261096c918391906118ab565b50565b6000336108458185856109828383611477565b61098c919061324d565b611518565b60004282106109d05760405162461bcd60e51b815260206004820152600b60248201526a0859195d195c9b5a5b995960aa1b60448201526064016108cf565b6001600160a01b03831660009081526101016020526040902054806109f957600091505061084b565b82610a078560018403610b60565b5163ffffffff1611610a2c57610a208460018303610b60565b6020015191505061084b565b82610a38856000610b60565b5163ffffffff161115610a4f57600091505061084b565b600060001982015b81811115610aba5760028282030481036000610a738883610b60565b805190915063ffffffff16871415610a955760200151945061084b9350505050565b805163ffffffff16871115610aac57819350610ab3565b6001820392505b5050610a57565b610ac48683610b60565b602001519695505050505050565b610ada611a25565b610ae2611a80565b565b610aec611a25565b610af96002600019613265565b81610b0360355490565b610b0d919061324d565b1115610b525760405162461bcd60e51b81526020600482015260146024820152731cda185c995cce8818d85c08195e18d95959195960621b60448201526064016108cf565b610b5c8282611ad3565b5050565b604080518082018252600080825260209182018190526001600160a01b039490941684526101008152818420928452918252918290208251808401909352805463ffffffff168352600101549082015290565b6001600160a01b03821660009081526101046020526040812081908190610bdb908590611ba0565b9150915081610c02576001600160a01b038516600090815260336020526040902054610c04565b805b95945050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610c565760405162461bcd60e51b81526004016108cf9061316a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c9f600080516020613373833981519152546001600160a01b031690565b6001600160a01b031614610cc55760405162461bcd60e51b81526004016108cf906131b6565b610cce826118a3565b610b5c828260016118ab565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108cf565b5060008051602061337383398151915290565b6000610881611c97565b600054610100900460ff1615808015610db75750600054600160ff909116105b80610dd15750303b158015610dd1575060005460ff166001145b610e345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108cf565b6000805460ff191660011790558015610e57576000805461ff0019166101001790555b8251610e9a5760405162461bcd60e51b81526020600482015260126024820152717368617265733a206e616d6520656d70747960701b60448201526064016108cf565b8151610edf5760405162461bcd60e51b81526020600482015260146024820152737368617265733a2073796d626f6c20656d70747960601b60448201526064016108cf565b610ee98383611ca3565b610ef283611cd4565b610efa611d1e565b610f02611d4d565b610f0a611d74565b610f12611d4d565b610f576040518060400160405280600a8152602001693232b632b3b0ba34b7b760b11b815250604051806040016040528060018152602001600d60fa1b815250611da3565b8015610f9d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b61096c3382611dd4565b610fb4611a25565b610ae26000611ecb565b6001600160a01b03811660009081526099602052604081205461084b565b610fe4611a25565b610ae2611f1e565b6060603780546107b4906132ca565b6000611005611a25565b610881611f5c565b600080600061101e84610105611ba0565b915091508161102f57603554611031565b805b949350505050565b6001600160a01b038116600090815261010160205260408120548061105f576000610870565b61106c8360018303610b60565b602001519392505050565b61107f611a25565b610b5c8282611fb7565b600033816110978286611477565b9050838110156110f75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108cf565b6111048286868403611518565b506001949350505050565b6000336108458185856116b6565b8342111561116d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e6174757265206578706972656400000060448201526064016108cf565b600061121661120e7f0e3bc21ca2be03aeeee0e614bfe98f970c96a05a768f627c50ab81764cb5026861119e6107a5565b6040516020016111ae919061311b565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905260c001604051602081830303815290604052805190602001206120f7565b858585612145565b90506001600160a01b03811661126e5760405162461bcd60e51b815260206004820181905260248201527f4552433230566f7465733a20696e76616c6964207369676e657220283078302960448201526064016108cf565b6001600160a01b0381166000908152610103602052604090205486146112d65760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e63650000000000000060448201526064016108cf565b6001600160a01b0381166000908152610103602052604081208054916112fb836132ff565b919050555061130a8188611dd4565b50505050505050565b834211156113635760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016108cf565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113928c61216d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113ed82612195565b905060006113fd82878787612145565b9050896001600160a01b0316816001600160a01b0316146114605760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016108cf565b61146b8a8a8a611518565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6114aa611a25565b6001600160a01b03811661150f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108cf565b61096c81611ecb565b6001600160a01b03831661157a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108cf565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108cf565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006116488484611477565b905060001981146116b057818110156116a35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016108cf565b6116b08484848403611518565b50505050565b6001600160a01b03831661171a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108cf565b6001600160a01b03821661177c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108cf565b6117878383836121a2565b6001600160a01b038316600090815260336020526040902054818110156117ff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108cf565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061185f9086815260200190565b60405180910390a36116b0565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61189b60655490565b606654612233565b61096c611a25565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156118de57610f9d8361227c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561191757600080fd5b505afa925050508015611947575060408051601f3d908101601f191682019092526119449181019061308f565b60015b6119aa5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108cf565b6000805160206133738339815191528114611a195760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108cf565b50610f9d838383612318565b610136546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108cf565b611a8861233d565b610168805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216611b295760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108cf565b611b35600083836121a2565b8060356000828254611b47919061324d565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60008060008411611bec5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016108cf565b611bf4611c97565b841115611c435760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016108cf565b6000611c4f8486612387565b8454909150811415611c68576000809250925050611c90565b6001846001018281548110611c7f57611c7f613346565b906000526020600020015492509250505b9250929050565b60006108816101075490565b600054610100900460ff16611cca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612432565b600054610100900460ff16611cfb5760405162461bcd60e51b81526004016108cf90613202565b61096c81604051806040016040528060018152602001603160f81b815250612480565b600054610100900460ff16611d455760405162461bcd60e51b81526004016108cf90613202565b610ae26124c1565b600054610100900460ff16610ae25760405162461bcd60e51b81526004016108cf90613202565b600054610100900460ff16611d9b5760405162461bcd60e51b81526004016108cf90613202565b610ae26124f5565b600054610100900460ff16611dca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612525565b6001600160a01b03821660009081526033602052604081205411611e245760405162461bcd60e51b81526020600482015260076024820152662173686172657360c81b60448201526064016108cf565b6001600160a01b0380831660009081526101026020526040902080548383166001600160a01b031982161790915516611e7c8183611e77866001600160a01b031660009081526033602052604090205490565b612566565b816001600160a01b0316816001600160a01b0316846001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4505050565b61013680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f2661264a565b610168805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ab63390565b6000611f6d61010780546001019055565b6000611f77611c97565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb6781604051611faa91815260200190565b60405180910390a1919050565b6001600160a01b0382166120175760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016108cf565b612023826000836121a2565b6001600160a01b038216600090815260336020526040902054818110156120975760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016108cf565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600061084b612104612691565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612156878787876126c8565b915091506121638161278c565b5095945050505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061084b61210461186c565b6121ad8383836128da565b6001600160a01b03831615806121e05750610136546001600160a01b0316331480156121e057506001600160a01b038216155b806121ef57506101685460ff16155b610f9d5760405162461bcd60e51b81526020600482015260156024820152747368617265733a20217472616e7366657261626c6560581b60448201526064016108cf565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6001600160a01b0381163b6122e95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108cf565b60008051602061337383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6123218361292d565b60008251118061232e5750805b15610f9d576116b0838361296d565b6101685460ff16610ae25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108cf565b81546000906123985750600061084b565b82546000905b808210156123e55760006123b28383612a58565b600087815260209020909150859082015411156123d1578091506123df565b6123dc81600161324d565b92505b5061239e565b60008211801561241157508361240e86612400600186613287565b600091825260209091200190565b54145b1561242a57612421600183613287565b9250505061084b565b50905061084b565b600054610100900460ff166124595760405162461bcd60e51b81526004016108cf90613202565b815161246c906036906020850190612d60565b508051610f9d906037906020840190612d60565b600054610100900460ff166124a75760405162461bcd60e51b81526004016108cf90613202565b815160209283012081519190920120606591909155606655565b600054610100900460ff166124e85760405162461bcd60e51b81526004016108cf90613202565b610168805460ff19169055565b600054610100900460ff1661251c5760405162461bcd60e51b81526004016108cf90613202565b610ae233611ecb565b600054610100900460ff1661254c5760405162461bcd60e51b81526004016108cf90613202565b81516020928301208151919092012060cc9190915560cd55565b816001600160a01b0316836001600160a01b03161415801561258757508015155b15610f9d576001600160a01b038316156125e9576001600160a01b0383166000908152610101602052604081205490816125c25760006125d4565b6125cf8560018403610b60565b602001515b90508281036125e586848484612a73565b5050505b6001600160a01b03821615610f9d576001600160a01b03821660009081526101016020526040812054908161261f576000612631565b61262c8460018403610b60565b602001515b905082810161264285848484612a73565b505050505050565b6101685460ff1615610ae25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108cf565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6126c060cc5490565b60cd54612233565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126ff5750600090506003612783565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612753573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661277c57600060019250925050612783565b9150600090505b94509492505050565b60008160048111156127a0576127a0613330565b14156127a95750565b60018160048111156127bd576127bd613330565b141561280b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108cf565b600281600481111561281f5761281f613330565b141561286d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108cf565b600381600481111561288157612881613330565b141561096c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108cf565b6128e5838383612b9c565b6001600160a01b038316612904576128fc82612c48565b610f9d612c7c565b6001600160a01b03821661291b576128fc83612c48565b61292483612c48565b610f9d82612c48565b6129368161227c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108cf565b600080846001600160a01b0316846040516129f0919061311b565b600060405180830381855af49150503d8060008114612a2b576040519150601f19603f3d011682016040523d82523d6000602084013e612a30565b606091505b5091509150610c04828260405180606001604052806027815260200161339360279139612c8b565b6000612a676002848418613265565b6108709084841661324d565b428315801590612ab357506001600160a01b0385166000908152610100602090815260408083206000198801845290915290205463ffffffff8281169116145b15612aeb576001600160a01b038516600090815261010060209081526040808320600019880184529091529020600101829055612b51565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038a16600081815261010084528681208b825284528681209551865463ffffffff191695169490941785559051600194850155825261010190529190912090850190555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b6001600160a01b038216600090815260336020526040902054158015612bd957506001600160a01b03821660009081526101016020526040902054155b8015612be55750600081115b15612c15576001600160a01b03821660008181526101026020526040902080546001600160a01b03191690911790555b6001600160a01b0380841660009081526101026020526040808220548584168352912054610f9d92918216911683612566565b6001600160a01b03811660009081526101046020908152604080832060339092529091205461096c9190612ca4565b612ca4565b610ae2610105612c7760355490565b60608315612c9a575081610870565b6108708383612cee565b6000612cae611c97565b905080612cba84612d18565b1015610f9d578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b815115612cfe5781518083602001fd5b8060405162461bcd60e51b81526004016108cf9190613137565b8054600090612d2957506000919050565b81548290612d3990600190613287565b81548110612d4957612d49613346565b90600052602060002001549050919050565b919050565b828054612d6c906132ca565b90600052602060002090601f016020900481019282612d8e5760008555612dd4565b82601f10612da757805160ff1916838001178555612dd4565b82800160010185558215612dd4579182015b82811115612dd4578251825591602001919060010190612db9565b50612de0929150612de4565b5090565b5b80821115612de05760008155600101612de5565b600067ffffffffffffffff80841115612e1457612e1461335c565b604051601f8501601f19908116603f01168101908282118183101715612e3c57612e3c61335c565b81604052809350858152868686011115612e5557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612d5b57600080fd5b600082601f830112612e9757600080fd5b61087083833560208501612df9565b803560ff81168114612d5b57600080fd5b600060208284031215612ec957600080fd5b61087082612e6f565b60008060408385031215612ee557600080fd5b612eee83612e6f565b9150612efc60208401612e6f565b90509250929050565b600080600060608486031215612f1a57600080fd5b612f2384612e6f565b9250612f3160208501612e6f565b9150604084013590509250925092565b600080600080600080600060e0888a031215612f5c57600080fd5b612f6588612e6f565b9650612f7360208901612e6f565b95506040880135945060608801359350612f8f60808901612ea6565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612fbe57600080fd5b612fc783612e6f565b9150602083013567ffffffffffffffff811115612fe357600080fd5b8301601f81018513612ff457600080fd5b61300385823560208401612df9565b9150509250929050565b6000806040838503121561302057600080fd5b61302983612e6f565b946020939093013593505050565b60008060008060008060c0878903121561305057600080fd5b61305987612e6f565b9550602087013594506040870135935061307560608801612ea6565b92506080870135915060a087013590509295509295509295565b6000602082840312156130a157600080fd5b5051919050565b600080604083850312156130bb57600080fd5b823567ffffffffffffffff808211156130d357600080fd5b6130df86838701612e86565b935060208501359150808211156130f557600080fd5b5061300385828601612e86565b60006020828403121561311457600080fd5b5035919050565b6000825161312d81846020870161329e565b9190910192915050565b602081526000825180602084015261315681604085016020870161329e565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156132605761326061331a565b500190565b60008261328257634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156132995761329961331a565b500390565b60005b838110156132b95781810151838201526020016132a1565b838111156116b05750506000910152565b600181811c908216806132de57607f821691505b6020821081141561218f57634e487b7160e01b600052602260045260246000fd5b60006000198214156133135761331361331a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200d1020c104d072d10e2125586128096b7567b61064dc9301fdd4980fc317d26464736f6c63430008070033", + "deployedBytecode": "0x60806040526004361061023b5760003560e01c80635c19a95c1161012e5780639711715a116100ab578063a9059cbb1161006f578063a9059cbb14610705578063c3cda52014610725578063d505accf14610745578063dd62ed3e14610765578063f2fde38b1461078557600080fd5b80639711715a14610670578063981b24d0146106855780639ab24eb0146106a55780639dc29fac146106c5578063a457c2d7146106e557600080fd5b80637ecebe00116100f25780637ecebe00146105f45780638456cb59146106145780638abe09f2146106295780638da5cb5b1461063c57806395d89b411461065b57600080fd5b80635c19a95c146105425780635c975abb146105625780636fcfff451461057b57806370a08231146105a9578063715018a6146105df57600080fd5b80633a46b1a8116101bc5780634f1ef286116101805780634f1ef2861461049657806352d1902d146104a95780635439ad86146104be578063562d190d146104d3578063587cde1e146104f357600080fd5b80633a46b1a8146103e05780633f4ba83a1461040057806340c10f191461041557806347f761f5146104355780634ee2cd7e1461047657600080fd5b806323b872dd1161020357806323b872dd1461034d578063313ce5671461036d5780633644e515146103895780633659cfe61461039e57806339509351146103c057600080fd5b806303c8a3c61461024057806306fdde0314610281578063095ea7b3146102a35780630cdfebfa146102d357806318160ddd14610338575b600080fd5b34801561024c57600080fd5b5061026e61025b366004612eb7565b6101036020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561028d57600080fd5b506102966107a5565b6040516102789190613137565b3480156102af57600080fd5b506102c36102be36600461300d565b610837565b6040519015158152602001610278565b3480156102df57600080fd5b5061031c6102ee36600461300d565b6101006020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610278565b34801561034457600080fd5b5060355461026e565b34801561035957600080fd5b506102c3610368366004612f05565b610851565b34801561037957600080fd5b5060405160128152602001610278565b34801561039557600080fd5b5061026e610877565b3480156103aa57600080fd5b506103be6103b9366004612eb7565b610886565b005b3480156103cc57600080fd5b506102c36103db36600461300d565b61096f565b3480156103ec57600080fd5b5061026e6103fb36600461300d565b610991565b34801561040c57600080fd5b506103be610ad2565b34801561042157600080fd5b506103be61043036600461300d565b610ae4565b34801561044157600080fd5b5061045561045036600461300d565b610b60565b60408051825163ffffffff1681526020928301519281019290925201610278565b34801561048257600080fd5b5061026e61049136600461300d565b610bb3565b6103be6104a4366004612fab565b610c0d565b3480156104b557600080fd5b5061026e610cda565b3480156104ca57600080fd5b5061026e610d8d565b3480156104df57600080fd5b506103be6104ee3660046130a8565b610d97565b3480156104ff57600080fd5b5061052a61050e366004612eb7565b610102602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610278565b34801561054e57600080fd5b506103be61055d366004612eb7565b610fa2565b34801561056e57600080fd5b506101685460ff166102c3565b34801561058757600080fd5b5061026e610596366004612eb7565b6101016020526000908152604090205481565b3480156105b557600080fd5b5061026e6105c4366004612eb7565b6001600160a01b031660009081526033602052604090205490565b3480156105eb57600080fd5b506103be610fac565b34801561060057600080fd5b5061026e61060f366004612eb7565b610fbe565b34801561062057600080fd5b506103be610fdc565b34801561063557600080fd5b504261026e565b34801561064857600080fd5b50610136546001600160a01b031661052a565b34801561066757600080fd5b50610296610fec565b34801561067c57600080fd5b5061026e610ffb565b34801561069157600080fd5b5061026e6106a0366004613102565b61100d565b3480156106b157600080fd5b5061026e6106c0366004612eb7565b611039565b3480156106d157600080fd5b506103be6106e036600461300d565b611077565b3480156106f157600080fd5b506102c361070036600461300d565b611089565b34801561071157600080fd5b506102c361072036600461300d565b61110f565b34801561073157600080fd5b506103be610740366004613037565b61111d565b34801561075157600080fd5b506103be610760366004612f41565b611313565b34801561077157600080fd5b5061026e610780366004612ed2565b611477565b34801561079157600080fd5b506103be6107a0366004612eb7565b6114a2565b6060603680546107b4906132ca565b80601f01602080910402602001604051908101604052809291908181526020018280546107e0906132ca565b801561082d5780601f106108025761010080835404028352916020019161082d565b820191906000526020600020905b81548152906001019060200180831161081057829003601f168201915b5050505050905090565b600033610845818585611518565b60019150505b92915050565b60003361085f85828561163c565b61086a8585856116b6565b60019150505b9392505050565b600061088161186c565b905090565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156108d85760405162461bcd60e51b81526004016108cf9061316a565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610921600080516020613373833981519152546001600160a01b031690565b6001600160a01b0316146109475760405162461bcd60e51b81526004016108cf906131b6565b610950816118a3565b6040805160008082526020820190925261096c918391906118ab565b50565b6000336108458185856109828383611477565b61098c919061324d565b611518565b60004282106109d05760405162461bcd60e51b815260206004820152600b60248201526a0859195d195c9b5a5b995960aa1b60448201526064016108cf565b6001600160a01b03831660009081526101016020526040902054806109f957600091505061084b565b82610a078560018403610b60565b5163ffffffff1611610a2c57610a208460018303610b60565b6020015191505061084b565b82610a38856000610b60565b5163ffffffff161115610a4f57600091505061084b565b600060001982015b81811115610aba5760028282030481036000610a738883610b60565b805190915063ffffffff16871415610a955760200151945061084b9350505050565b805163ffffffff16871115610aac57819350610ab3565b6001820392505b5050610a57565b610ac48683610b60565b602001519695505050505050565b610ada611a25565b610ae2611a80565b565b610aec611a25565b610af96002600019613265565b81610b0360355490565b610b0d919061324d565b1115610b525760405162461bcd60e51b81526020600482015260146024820152731cda185c995cce8818d85c08195e18d95959195960621b60448201526064016108cf565b610b5c8282611ad3565b5050565b604080518082018252600080825260209182018190526001600160a01b039490941684526101008152818420928452918252918290208251808401909352805463ffffffff168352600101549082015290565b6001600160a01b03821660009081526101046020526040812081908190610bdb908590611ba0565b9150915081610c02576001600160a01b038516600090815260336020526040902054610c04565b805b95945050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610c565760405162461bcd60e51b81526004016108cf9061316a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c9f600080516020613373833981519152546001600160a01b031690565b6001600160a01b031614610cc55760405162461bcd60e51b81526004016108cf906131b6565b610cce826118a3565b610b5c828260016118ab565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016108cf565b5060008051602061337383398151915290565b6000610881611c97565b600054610100900460ff1615808015610db75750600054600160ff909116105b80610dd15750303b158015610dd1575060005460ff166001145b610e345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016108cf565b6000805460ff191660011790558015610e57576000805461ff0019166101001790555b8251610e9a5760405162461bcd60e51b81526020600482015260126024820152717368617265733a206e616d6520656d70747960701b60448201526064016108cf565b8151610edf5760405162461bcd60e51b81526020600482015260146024820152737368617265733a2073796d626f6c20656d70747960601b60448201526064016108cf565b610ee98383611ca3565b610ef283611cd4565b610efa611d1e565b610f02611d4d565b610f0a611d74565b610f12611d4d565b610f576040518060400160405280600a8152602001693232b632b3b0ba34b7b760b11b815250604051806040016040528060018152602001600d60fa1b815250611da3565b8015610f9d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b61096c3382611dd4565b610fb4611a25565b610ae26000611ecb565b6001600160a01b03811660009081526099602052604081205461084b565b610fe4611a25565b610ae2611f1e565b6060603780546107b4906132ca565b6000611005611a25565b610881611f5c565b600080600061101e84610105611ba0565b915091508161102f57603554611031565b805b949350505050565b6001600160a01b038116600090815261010160205260408120548061105f576000610870565b61106c8360018303610b60565b602001519392505050565b61107f611a25565b610b5c8282611fb7565b600033816110978286611477565b9050838110156110f75760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016108cf565b6111048286868403611518565b506001949350505050565b6000336108458185856116b6565b8342111561116d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e6174757265206578706972656400000060448201526064016108cf565b600061121661120e7f0e3bc21ca2be03aeeee0e614bfe98f970c96a05a768f627c50ab81764cb5026861119e6107a5565b6040516020016111ae919061311b565b60408051601f198184030181528282528051602091820120908301939093528101919091526001600160a01b038a1660608201526080810189905260a0810188905260c001604051602081830303815290604052805190602001206120f7565b858585612145565b90506001600160a01b03811661126e5760405162461bcd60e51b815260206004820181905260248201527f4552433230566f7465733a20696e76616c6964207369676e657220283078302960448201526064016108cf565b6001600160a01b0381166000908152610103602052604090205486146112d65760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e63650000000000000060448201526064016108cf565b6001600160a01b0381166000908152610103602052604081208054916112fb836132ff565b919050555061130a8188611dd4565b50505050505050565b834211156113635760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016108cf565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113928c61216d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113ed82612195565b905060006113fd82878787612145565b9050896001600160a01b0316816001600160a01b0316146114605760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016108cf565b61146b8a8a8a611518565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6114aa611a25565b6001600160a01b03811661150f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108cf565b61096c81611ecb565b6001600160a01b03831661157a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108cf565b6001600160a01b0382166115db5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108cf565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006116488484611477565b905060001981146116b057818110156116a35760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016108cf565b6116b08484848403611518565b50505050565b6001600160a01b03831661171a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108cf565b6001600160a01b03821661177c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108cf565b6117878383836121a2565b6001600160a01b038316600090815260336020526040902054818110156117ff5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108cf565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061185f9086815260200190565b60405180910390a36116b0565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61189b60655490565b606654612233565b61096c611a25565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156118de57610f9d8361227c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561191757600080fd5b505afa925050508015611947575060408051601f3d908101601f191682019092526119449181019061308f565b60015b6119aa5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016108cf565b6000805160206133738339815191528114611a195760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016108cf565b50610f9d838383612318565b610136546001600160a01b03163314610ae25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108cf565b611a8861233d565b610168805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216611b295760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016108cf565b611b35600083836121a2565b8060356000828254611b47919061324d565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60008060008411611bec5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016108cf565b611bf4611c97565b841115611c435760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016108cf565b6000611c4f8486612387565b8454909150811415611c68576000809250925050611c90565b6001846001018281548110611c7f57611c7f613346565b906000526020600020015492509250505b9250929050565b60006108816101075490565b600054610100900460ff16611cca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612432565b600054610100900460ff16611cfb5760405162461bcd60e51b81526004016108cf90613202565b61096c81604051806040016040528060018152602001603160f81b815250612480565b600054610100900460ff16611d455760405162461bcd60e51b81526004016108cf90613202565b610ae26124c1565b600054610100900460ff16610ae25760405162461bcd60e51b81526004016108cf90613202565b600054610100900460ff16611d9b5760405162461bcd60e51b81526004016108cf90613202565b610ae26124f5565b600054610100900460ff16611dca5760405162461bcd60e51b81526004016108cf90613202565b610b5c8282612525565b6001600160a01b03821660009081526033602052604081205411611e245760405162461bcd60e51b81526020600482015260076024820152662173686172657360c81b60448201526064016108cf565b6001600160a01b0380831660009081526101026020526040902080548383166001600160a01b031982161790915516611e7c8183611e77866001600160a01b031660009081526033602052604090205490565b612566565b816001600160a01b0316816001600160a01b0316846001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4505050565b61013680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611f2661264a565b610168805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ab63390565b6000611f6d61010780546001019055565b6000611f77611c97565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb6781604051611faa91815260200190565b60405180910390a1919050565b6001600160a01b0382166120175760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016108cf565b612023826000836121a2565b6001600160a01b038216600090815260336020526040902054818110156120975760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016108cf565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600061084b612104612691565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612156878787876126c8565b915091506121638161278c565b5095945050505050565b6001600160a01b03811660009081526099602052604090208054600181018255905b50919050565b600061084b61210461186c565b6121ad8383836128da565b6001600160a01b03831615806121e05750610136546001600160a01b0316331480156121e057506001600160a01b038216155b806121ef57506101685460ff16155b610f9d5760405162461bcd60e51b81526020600482015260156024820152747368617265733a20217472616e7366657261626c6560581b60448201526064016108cf565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6001600160a01b0381163b6122e95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016108cf565b60008051602061337383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6123218361292d565b60008251118061232e5750805b15610f9d576116b0838361296d565b6101685460ff16610ae25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108cf565b81546000906123985750600061084b565b82546000905b808210156123e55760006123b28383612a58565b600087815260209020909150859082015411156123d1578091506123df565b6123dc81600161324d565b92505b5061239e565b60008211801561241157508361240e86612400600186613287565b600091825260209091200190565b54145b1561242a57612421600183613287565b9250505061084b565b50905061084b565b600054610100900460ff166124595760405162461bcd60e51b81526004016108cf90613202565b815161246c906036906020850190612d60565b508051610f9d906037906020840190612d60565b600054610100900460ff166124a75760405162461bcd60e51b81526004016108cf90613202565b815160209283012081519190920120606591909155606655565b600054610100900460ff166124e85760405162461bcd60e51b81526004016108cf90613202565b610168805460ff19169055565b600054610100900460ff1661251c5760405162461bcd60e51b81526004016108cf90613202565b610ae233611ecb565b600054610100900460ff1661254c5760405162461bcd60e51b81526004016108cf90613202565b81516020928301208151919092012060cc9190915560cd55565b816001600160a01b0316836001600160a01b03161415801561258757508015155b15610f9d576001600160a01b038316156125e9576001600160a01b0383166000908152610101602052604081205490816125c25760006125d4565b6125cf8560018403610b60565b602001515b90508281036125e586848484612a73565b5050505b6001600160a01b03821615610f9d576001600160a01b03821660009081526101016020526040812054908161261f576000612631565b61262c8460018403610b60565b602001515b905082810161264285848484612a73565b505050505050565b6101685460ff1615610ae25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108cf565b60006108817f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6126c060cc5490565b60cd54612233565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126ff5750600090506003612783565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612753573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661277c57600060019250925050612783565b9150600090505b94509492505050565b60008160048111156127a0576127a0613330565b14156127a95750565b60018160048111156127bd576127bd613330565b141561280b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108cf565b600281600481111561281f5761281f613330565b141561286d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016108cf565b600381600481111561288157612881613330565b141561096c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016108cf565b6128e5838383612b9c565b6001600160a01b038316612904576128fc82612c48565b610f9d612c7c565b6001600160a01b03821661291b576128fc83612c48565b61292483612c48565b610f9d82612c48565b6129368161227c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129d55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016108cf565b600080846001600160a01b0316846040516129f0919061311b565b600060405180830381855af49150503d8060008114612a2b576040519150601f19603f3d011682016040523d82523d6000602084013e612a30565b606091505b5091509150610c04828260405180606001604052806027815260200161339360279139612c8b565b6000612a676002848418613265565b6108709084841661324d565b428315801590612ab357506001600160a01b0385166000908152610100602090815260408083206000198801845290915290205463ffffffff8281169116145b15612aeb576001600160a01b038516600090815261010060209081526040808320600019880184529091529020600101829055612b51565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038a16600081815261010084528681208b825284528681209551865463ffffffff191695169490941785559051600194850155825261010190529190912090850190555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b6001600160a01b038216600090815260336020526040902054158015612bd957506001600160a01b03821660009081526101016020526040902054155b8015612be55750600081115b15612c15576001600160a01b03821660008181526101026020526040902080546001600160a01b03191690911790555b6001600160a01b0380841660009081526101026020526040808220548584168352912054610f9d92918216911683612566565b6001600160a01b03811660009081526101046020908152604080832060339092529091205461096c9190612ca4565b612ca4565b610ae2610105612c7760355490565b60608315612c9a575081610870565b6108708383612cee565b6000612cae611c97565b905080612cba84612d18565b1015610f9d578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b815115612cfe5781518083602001fd5b8060405162461bcd60e51b81526004016108cf9190613137565b8054600090612d2957506000919050565b81548290612d3990600190613287565b81548110612d4957612d49613346565b90600052602060002001549050919050565b919050565b828054612d6c906132ca565b90600052602060002090601f016020900481019282612d8e5760008555612dd4565b82601f10612da757805160ff1916838001178555612dd4565b82800160010185558215612dd4579182015b82811115612dd4578251825591602001919060010190612db9565b50612de0929150612de4565b5090565b5b80821115612de05760008155600101612de5565b600067ffffffffffffffff80841115612e1457612e1461335c565b604051601f8501601f19908116603f01168101908282118183101715612e3c57612e3c61335c565b81604052809350858152868686011115612e5557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612d5b57600080fd5b600082601f830112612e9757600080fd5b61087083833560208501612df9565b803560ff81168114612d5b57600080fd5b600060208284031215612ec957600080fd5b61087082612e6f565b60008060408385031215612ee557600080fd5b612eee83612e6f565b9150612efc60208401612e6f565b90509250929050565b600080600060608486031215612f1a57600080fd5b612f2384612e6f565b9250612f3160208501612e6f565b9150604084013590509250925092565b600080600080600080600060e0888a031215612f5c57600080fd5b612f6588612e6f565b9650612f7360208901612e6f565b95506040880135945060608801359350612f8f60808901612ea6565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612fbe57600080fd5b612fc783612e6f565b9150602083013567ffffffffffffffff811115612fe357600080fd5b8301601f81018513612ff457600080fd5b61300385823560208401612df9565b9150509250929050565b6000806040838503121561302057600080fd5b61302983612e6f565b946020939093013593505050565b60008060008060008060c0878903121561305057600080fd5b61305987612e6f565b9550602087013594506040870135935061307560608801612ea6565b92506080870135915060a087013590509295509295509295565b6000602082840312156130a157600080fd5b5051919050565b600080604083850312156130bb57600080fd5b823567ffffffffffffffff808211156130d357600080fd5b6130df86838701612e86565b935060208501359150808211156130f557600080fd5b5061300385828601612e86565b60006020828403121561311457600080fd5b5035919050565b6000825161312d81846020870161329e565b9190910192915050565b602081526000825180602084015261315681604085016020870161329e565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082198211156132605761326061331a565b500190565b60008261328257634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156132995761329961331a565b500390565b60005b838110156132b95781810151838201526020016132a1565b838111156116b05750506000910152565b600181811c908216806132de57607f821691505b6020821081141561218f57634e487b7160e01b600052602260045260246000fd5b60006000198214156133135761331361331a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200d1020c104d072d10e2125586128096b7567b61064dc9301fdd4980fc317d26464736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "DOMAIN_SEPARATOR()": { + "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." + }, + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "balanceOfAt(address,uint256)": { + "details": "Retrieves the balance of `account` at the time `snapshotId` was created." + }, + "burn(address,uint256)": { + "params": { + "account": "Address to lose shares", + "amount": "Amount to burn" + } + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "delegate(address)": { + "params": { + "delegatee": "The address to delegate votes to." + } + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "params": { + "delegatee": "The address to delegate 'votes' to.", + "expiry": "The time at which to expire the signature.", + "nonce": "The contract state required to match the signature.", + "r": "The r signature", + "s": "The s signature", + "v": "The v signature" + } + }, + "getPastVotes(address,uint256)": { + "params": { + "account": "The user to check `votes` for.", + "timePoint": "The unix time to check `votes` for." + }, + "returns": { + "votes": "Past `votes` delegated to `account`." + } + }, + "getVotes(address)": { + "params": { + "account": "The user to check delegated `votes` for." + }, + "returns": { + "votes": "Current `votes` delegated to `account`." + } + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "mint(address,uint256)": { + "params": { + "amount": "Amount to mint", + "recipient": "Address to receive shares" + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "nonces(address)": { + "details": "See {IERC20Permit-nonces}." + }, + "now()": { + "returns": { + "timePoint": "returns unix epoch timestamp" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "See {IERC20Permit-permit}." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setUp(string,string)": { + "details": "initializer should prevent this from being called again", + "params": { + "name_": "Name for ERC20 token trackers", + "symbol_": "Symbol for ERC20 token trackers" + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "totalSupplyAt(uint256)": { + "details": "Retrieves the total supply at the time `snapshotId` was created." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "title": "Shares", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "burn(address,uint256)": { + "notice": "Baal-only function to burn shares." + }, + "delegate(address)": { + "notice": "Delegate votes from user to `delegatee`." + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "notice": "Delegates votes from `signer` to `delegatee` with EIP-712 signature." + }, + "getCurrentSnapshotId()": { + "notice": "get current SnapshotId" + }, + "getPastVotes(address,uint256)": { + "notice": "Returns the prior number of `votes` for `account` as of `timePoint`." + }, + "getVotes(address)": { + "notice": "Returns the current delegated `vote` balance for `account`." + }, + "mint(address,uint256)": { + "notice": "Baal-only function to mint shares." + }, + "now()": { + "notice": "Returns the current timepoint." + }, + "pause()": { + "notice": "Baal-only function to pause shares." + }, + "setUp(string,string)": { + "notice": "Configure shares - called by Baal on summon" + }, + "snapshot()": { + "notice": "Allows baal to create a snapshot" + }, + "unpause()": { + "notice": "Baal-only function to unpause shares." + } + }, + "notice": "Accounting for Baal non voting shares", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4454, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 4457, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 6723, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4971, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4977, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4979, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 4981, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage" + }, + { + "astId": 4983, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage" + }, + { + "astId": 5563, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 7403, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_NAME", + "offset": 0, + "slot": "101", + "type": "t_bytes32" + }, + { + "astId": 7405, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "102", + "type": "t_bytes32" + }, + { + "astId": 7543, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "103", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 6041, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_nonces", + "offset": 0, + "slot": "153", + "type": "t_mapping(t_address,t_struct(Counter)6730_storage)" + }, + { + "astId": 6049, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "154", + "type": "t_bytes32" + }, + { + "astId": 6205, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "155", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 16164, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_NAME_DELEGATION", + "offset": 0, + "slot": "204", + "type": "t_bytes32" + }, + { + "astId": 16166, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_HASHED_VERSION_DELEGATION", + "offset": 0, + "slot": "205", + "type": "t_bytes32" + }, + { + "astId": 16304, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "206", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 15565, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "checkpoints", + "offset": 0, + "slot": "256", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_struct(Checkpoint)15558_storage))" + }, + { + "astId": 15569, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "numCheckpoints", + "offset": 0, + "slot": "257", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 15573, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "delegates", + "offset": 0, + "slot": "258", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 15577, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "delegationNonces", + "offset": 0, + "slot": "259", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 5685, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_accountBalanceSnapshots", + "offset": 0, + "slot": "260", + "type": "t_mapping(t_address,t_struct(Snapshots)5680_storage)" + }, + { + "astId": 5688, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_totalSupplySnapshots", + "offset": 0, + "slot": "261", + "type": "t_struct(Snapshots)5680_storage" + }, + { + "astId": 5691, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_currentSnapshotId", + "offset": 0, + "slot": "263", + "type": "t_struct(Counter)6730_storage" + }, + { + "astId": 5989, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "264", + "type": "t_array(t_uint256)46_storage" + }, + { + "astId": 3937, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_owner", + "offset": 0, + "slot": "310", + "type": "t_address" + }, + { + "astId": 4057, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "311", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4773, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_paused", + "offset": 0, + "slot": "360", + "type": "t_bool" + }, + { + "astId": 4878, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "361", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 4436, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "410", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4751, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "__gap", + "offset": 0, + "slot": "460", + "type": "t_array(t_uint256)50_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)46_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[46]", + "numberOfBytes": "1472" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_struct(Checkpoint)15558_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => struct BaalVotes.Checkpoint))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(Checkpoint)15558_storage)" + }, + "t_mapping(t_address,t_struct(Counter)6730_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32", + "value": "t_struct(Counter)6730_storage" + }, + "t_mapping(t_address,t_struct(Snapshots)5680_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", + "numberOfBytes": "32", + "value": "t_struct(Snapshots)5680_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint256,t_struct(Checkpoint)15558_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct BaalVotes.Checkpoint)", + "numberOfBytes": "32", + "value": "t_struct(Checkpoint)15558_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint)15558_storage": { + "encoding": "inplace", + "label": "struct BaalVotes.Checkpoint", + "members": [ + { + "astId": 15555, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "fromTimePoint", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 15557, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "votes", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Counter)6730_storage": { + "encoding": "inplace", + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "astId": 6729, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "_value", + "offset": 0, + "slot": "0", + "type": "t_uint256" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Snapshots)5680_storage": { + "encoding": "inplace", + "label": "struct ERC20SnapshotUpgradeable.Snapshots", + "members": [ + { + "astId": 5676, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "ids", + "offset": 0, + "slot": "0", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 5679, + "contract": "contracts/SharesERC20.sol:Shares", + "label": "values", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)dyn_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/TributeMinion.json b/lib/Baal/deployments/sepolia/TributeMinion.json new file mode 100644 index 0000000..b9eee4e --- /dev/null +++ b/lib/Baal/deployments/sepolia/TributeMinion.json @@ -0,0 +1,355 @@ +{ + "address": "0xdb4D89F2199b9Cf451B7Ff4bdC94b1c96De4bdD0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "safe", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EscrowReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "TributeProposal", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baal", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint32", + "name": "proposalId", + "type": "uint32" + }, + { + "internalType": "address", + "name": "escrow", + "type": "address" + } + ], + "name": "encodeTributeProposal", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "escrows", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "applicant", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "released", + "type": "bool" + }, + { + "internalType": "address", + "name": "safe", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_baal", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_proposalId", + "type": "uint32" + } + ], + "name": "releaseEscrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Baal", + "name": "baal", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "loot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "expiration", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "baalgas", + "type": "uint256" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + } + ], + "name": "submitTributeProposal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x83d951a217b23d9b9f28a677ebd73c90e5a97bca6c17ac937a1dd9e8ab36ee08", + "receipt": { + "to": null, + "from": "0x7C510aBf45c10a9aB949ef69ccBba5d77312d814", + "contractAddress": "0xdb4D89F2199b9Cf451B7Ff4bdC94b1c96De4bdD0", + "transactionIndex": 44, + "gasUsed": "886041", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0ad02119f59906449be97c9075834315f686e025f0e859c3e0daf88243447f68", + "transactionHash": "0x83d951a217b23d9b9f28a677ebd73c90e5a97bca6c17ac937a1dd9e8ab36ee08", + "logs": [], + "blockNumber": 4816755, + "cumulativeGasUsed": "5370076", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "d833871936d16a85338aeeebf4887b62", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"proposalId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"applicant\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EscrowReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"TributeProposal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baal\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loot\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"proposalId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"escrow\",\"type\":\"address\"}],\"name\":\"encodeTributeProposal\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"escrows\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"applicant\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"released\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"safe\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_baal\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_proposalId\",\"type\":\"uint32\"}],\"name\":\"releaseEscrow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Baal\",\"name\":\"baal\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"loot\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"expiration\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"baalgas\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"}],\"name\":\"submitTributeProposal\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/tools/TributeMinion.sol\":\"TributeMinion\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures\\n ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\n\\n /// @dev Set a guard that checks transactions before execution\\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\\n function setGuard(address guard) external authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n (success, ) = _exec(to, value, data, operation);\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"},\"contracts/tools/TributeMinion.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\nimport \\\"../Baal.sol\\\";\\n\\ninterface IERC20 {\\n function transferFrom(\\n address from,\\n address to,\\n uint256 value\\n ) external returns (bool);\\n}\\n\\ncontract TributeMinion {\\n event TributeProposal(\\n address indexed baal,\\n address token,\\n uint256 amount,\\n address recipient,\\n uint256 proposalId\\n );\\n struct Escrow {\\n address token;\\n address applicant;\\n uint256 amount;\\n bool released;\\n address safe;\\n }\\n mapping(address => mapping(uint256 => Escrow)) public escrows;\\n\\n event EscrowReleased(\\n address indexed baal,\\n uint32 proposalId,\\n address applicant,\\n address safe,\\n uint256 amount\\n );\\n\\n function encodeTributeProposal(\\n address baal,\\n uint256 shares,\\n uint256 loot,\\n address recipient,\\n uint32 proposalId,\\n address escrow\\n ) public pure returns (bytes memory) {\\n // Workaround for solidity dynamic memory array\\n address[] memory _recipients = new address[](1);\\n _recipients[0] = recipient;\\n\\n bytes memory _releaseEscrow = abi.encodeWithSignature(\\n \\\"releaseEscrow(address,uint32)\\\",\\n baal,\\n proposalId\\n );\\n\\n bytes memory tributeMultisend = abi.encodePacked(\\n uint8(0),\\n escrow,\\n uint256(0),\\n uint256(_releaseEscrow.length),\\n bytes(_releaseEscrow)\\n );\\n\\n if (shares > 0) {\\n // Workaround for solidity dynamic memory array\\n uint256[] memory _shares = new uint256[](1);\\n _shares[0] = shares;\\n\\n bytes memory _issueShares = abi.encodeWithSignature(\\n \\\"mintShares(address[],uint256[])\\\",\\n _recipients,\\n _shares\\n );\\n\\n tributeMultisend = abi.encodePacked(\\n tributeMultisend,\\n uint8(0),\\n baal,\\n uint256(0),\\n uint256(_issueShares.length),\\n bytes(_issueShares)\\n );\\n }\\n if (loot > 0) {\\n // Workaround for solidity dynamic memory array\\n uint256[] memory _loot = new uint256[](1);\\n _loot[0] = loot;\\n\\n bytes memory _issueLoot = abi.encodeWithSignature(\\n \\\"mintLoot(address[],uint256[])\\\",\\n _recipients,\\n _loot\\n );\\n\\n tributeMultisend = abi.encodePacked(\\n tributeMultisend,\\n uint8(0),\\n address(baal),\\n uint256(0),\\n uint256(_issueLoot.length),\\n bytes(_issueLoot)\\n );\\n }\\n\\n bytes memory _multisendAction = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n tributeMultisend\\n );\\n return _multisendAction;\\n }\\n\\n function submitTributeProposal(\\n Baal baal,\\n address token,\\n uint256 amount,\\n uint256 shares,\\n uint256 loot,\\n uint32 expiration,\\n uint256 baalgas,\\n string memory details\\n ) external payable {\\n uint32 proposalId = baal.proposalCount() + 1;\\n\\n bytes memory encodedProposal = encodeTributeProposal(\\n address(baal),\\n shares,\\n loot,\\n msg.sender,\\n proposalId,\\n address(this)\\n );\\n\\n escrows[address(baal)][proposalId] = Escrow(\\n token,\\n msg.sender,\\n amount,\\n false,\\n baal.target()\\n );\\n\\n baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);\\n\\n emit TributeProposal(\\n address(baal),\\n token,\\n amount,\\n msg.sender,\\n proposalId\\n );\\n }\\n\\n function releaseEscrow(address _baal, uint32 _proposalId) external {\\n Baal baal = Baal(_baal);\\n Escrow storage escrow = escrows[address(baal)][_proposalId];\\n require(!escrow.released, \\\"Already released\\\");\\n\\n bool[4] memory status = baal.getProposalStatus(_proposalId);\\n require(status[2], \\\"Not passed\\\");\\n escrow.released = true;\\n\\n IERC20 token = IERC20(escrow.token);\\n\\n emit EscrowReleased(\\n _baal,\\n _proposalId,\\n escrow.applicant,\\n escrow.safe,\\n escrow.amount\\n );\\n\\n require(\\n token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),\\n \\\"Transfer failed\\\"\\n );\\n }\\n}\\n\",\"keccak256\":\"0x878896b7c3bdd2b2132d356d9d6f6cff263c88027970ea8c2c917d6fdef52209\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610f10806100206000396000f3fe60806040526004361061003f5760003560e01c806304a54aa7146100445780633336c279146100e0578063610ac73d146101025780636bd4afe714610115575b600080fd5b34801561005057600080fd5b506100a561005f366004610980565b600060208181529281526040808220909352908152208054600182015460028301546003909301546001600160a01b03928316939183169260ff82169161010090041685565b604080516001600160a01b039687168152948616602086015284019290925215156060830152909116608082015260a0015b60405180910390f35b3480156100ec57600080fd5b506101006100fb366004610a1c565b610142565b005b610100610110366004610afe565b6103de565b34801561012157600080fd5b506101356101303660046109ac565b61069d565b6040516100d79190610d98565b6001600160a01b03821660009081526020818152604080832063ffffffff851684529091529020600381015483919060ff16156101b95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995b19585cd95960821b60448201526064015b60405180910390fd5b60405163118c2bff60e21b815263ffffffff841660048201526000906001600160a01b03841690634630affc9060240160806040518083038186803b15801561020157600080fd5b505afa158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610a55565b604081015190915061027a5760405162461bcd60e51b815260206004820152600a602482015269139bdd081c185cdcd95960b21b60448201526064016101b0565b60038201805460ff191660019081179182905583549084015460028501546040805163ffffffff8a1681526001600160a01b039384166020820152610100909504831690850152606084015290811691908716907f637fb12bbeb9000df3de89d3f54dba04a8940ff0b762f16937aa1bc12dfc26779060800160405180910390a26001830154600384015460028501546040516323b872dd60e01b81526001600160a01b039384166004820152610100909204831660248301526044820152908216906323b872dd90606401602060405180830381600087803b15801561036057600080fd5b505af1158015610374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103989190610ae3565b6103d65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016101b0565b505050505050565b6000886001600160a01b031663da35c6646040518163ffffffff1660e01b815260040160206040518083038186803b15801561041957600080fd5b505afa15801561042d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104519190610c0b565b61045c906001610e1e565b9050600061046e8a888833863061069d565b90506040518060a001604052808a6001600160a01b03168152602001336001600160a01b031681526020018981526020016000151581526020018b6001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e157600080fd5b505afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610519919061095c565b6001600160a01b039081169091528b811660008181526020818152604080832063ffffffff89168452825291829020855181549086166001600160a01b031991821617825591860151600182018054918716919093161790915584820151600282015560608501516003909101805460809096015190941661010002610100600160a81b0319911515919091166001600160a81b0319909516949094179390931790915590516307505ff960e31b8152633a82ffc89034906105e59085908a908a908a90600401610dab565b6020604051808303818588803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106379190610bf2565b50604080516001600160a01b038b81168252602082018b9052338284015263ffffffff851660608301529151918c16917f1deb8b1e22941ec32a7ed14b2d25bdb44593ab343156feb1c735ec06696221399181900360800190a250505050505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905084816000815181106106d7576106d7610e84565b6001600160a01b039283166020918202929092010152604051908916602482015263ffffffff8516604482015260009060640160408051601f19818403018152918152602080830180516001600160e01b0316633336c27960e01b179052825191519293506000926107529284928992849291889101610cbe565b60408051601f198184030181529190529050881561082f576040805160018082528183019092526000916020808301908036833701905050905089816000815181106107a0576107a0610e84565b602002602001018181525050600084826040516024016107c1929190610d14565b604051602081830303815290604052632c78fd0360e21b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d600084518560405160200161081b96959493929190610c54565b604051602081830303815290604052925050505b87156108fa5760408051600180825281830190925260009160208083019080368337019050509050888160008151811061086b5761086b610e84565b6020026020010181815250506000848260405160240161088c929190610d14565b6040516020818303038152906040526322936c2360e11b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d60008451856040516020016108e696959493929190610c54565b604051602081830303815290604052925050505b60008160405160240161090d9190610d98565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b1790529450505050509695505050505050565b8051801515811461095757600080fd5b919050565b60006020828403121561096e57600080fd5b815161097981610eb0565b9392505050565b6000806040838503121561099357600080fd5b823561099e81610eb0565b946020939093013593505050565b60008060008060008060c087890312156109c557600080fd5b86356109d081610eb0565b9550602087013594506040870135935060608701356109ee81610eb0565b925060808701356109fe81610ec8565b915060a0870135610a0e81610eb0565b809150509295509295509295565b60008060408385031215610a2f57600080fd5b8235610a3a81610eb0565b91506020830135610a4a81610ec8565b809150509250929050565b600060808284031215610a6757600080fd5b82601f830112610a7657600080fd5b6040516080810181811067ffffffffffffffff82111715610a9957610a99610e9a565b604052808360808101861015610aae57600080fd5b60005b6004811015610ad857610ac382610947565b83526020928301929190910190600101610ab1565b509195945050505050565b600060208284031215610af557600080fd5b61097982610947565b600080600080600080600080610100898b031215610b1b57600080fd5b8835610b2681610eb0565b9750602089810135610b3781610eb0565b975060408a0135965060608a0135955060808a0135945060a08a0135610b5c81610ec8565b935060c08a0135925060e08a013567ffffffffffffffff80821115610b8057600080fd5b818c0191508c601f830112610b9457600080fd5b813581811115610ba657610ba6610e9a565b610bb8601f8201601f19168501610ded565b91508082528d84828501011115610bce57600080fd5b80848401858401376000848284010152508093505050509295985092959890939650565b600060208284031215610c0457600080fd5b5051919050565b600060208284031215610c1d57600080fd5b815161097981610ec8565b60008151808452610c40816020860160208601610e54565b601f01601f19169290920160200192915050565b60008751610c66818460208c01610e54565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351610cae816055840160208801610e54565b0160550198975050505050505050565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251610d03816055850160208701610e54565b919091016055019695505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610d565781516001600160a01b031684529284019290840190600101610d31565b5050508381038285015284518082528583019183019060005b81811015610d8b57835183529284019291840191600101610d6f565b5090979650505050505050565b6020815260006109796020830184610c28565b608081526000610dbe6080830187610c28565b63ffffffff861660208401528460408401528281036060840152610de28185610c28565b979650505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e1657610e16610e9a565b604052919050565b600063ffffffff808316818516808303821115610e4b57634e487b7160e01b600052601160045260246000fd5b01949350505050565b60005b83811015610e6f578181015183820152602001610e57565b83811115610e7e576000848401525b50505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ec557600080fd5b50565b63ffffffff81168114610ec557600080fdfea2646970667358221220a3323eb1a602115aba0d9a9bf27a1b961890e40a7d0dbd148bb6b967aef950c264736f6c63430008070033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806304a54aa7146100445780633336c279146100e0578063610ac73d146101025780636bd4afe714610115575b600080fd5b34801561005057600080fd5b506100a561005f366004610980565b600060208181529281526040808220909352908152208054600182015460028301546003909301546001600160a01b03928316939183169260ff82169161010090041685565b604080516001600160a01b039687168152948616602086015284019290925215156060830152909116608082015260a0015b60405180910390f35b3480156100ec57600080fd5b506101006100fb366004610a1c565b610142565b005b610100610110366004610afe565b6103de565b34801561012157600080fd5b506101356101303660046109ac565b61069d565b6040516100d79190610d98565b6001600160a01b03821660009081526020818152604080832063ffffffff851684529091529020600381015483919060ff16156101b95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995b19585cd95960821b60448201526064015b60405180910390fd5b60405163118c2bff60e21b815263ffffffff841660048201526000906001600160a01b03841690634630affc9060240160806040518083038186803b15801561020157600080fd5b505afa158015610215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102399190610a55565b604081015190915061027a5760405162461bcd60e51b815260206004820152600a602482015269139bdd081c185cdcd95960b21b60448201526064016101b0565b60038201805460ff191660019081179182905583549084015460028501546040805163ffffffff8a1681526001600160a01b039384166020820152610100909504831690850152606084015290811691908716907f637fb12bbeb9000df3de89d3f54dba04a8940ff0b762f16937aa1bc12dfc26779060800160405180910390a26001830154600384015460028501546040516323b872dd60e01b81526001600160a01b039384166004820152610100909204831660248301526044820152908216906323b872dd90606401602060405180830381600087803b15801561036057600080fd5b505af1158015610374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103989190610ae3565b6103d65760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016101b0565b505050505050565b6000886001600160a01b031663da35c6646040518163ffffffff1660e01b815260040160206040518083038186803b15801561041957600080fd5b505afa15801561042d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104519190610c0b565b61045c906001610e1e565b9050600061046e8a888833863061069d565b90506040518060a001604052808a6001600160a01b03168152602001336001600160a01b031681526020018981526020016000151581526020018b6001600160a01b031663d4b839926040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e157600080fd5b505afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610519919061095c565b6001600160a01b039081169091528b811660008181526020818152604080832063ffffffff89168452825291829020855181549086166001600160a01b031991821617825591860151600182018054918716919093161790915584820151600282015560608501516003909101805460809096015190941661010002610100600160a81b0319911515919091166001600160a81b0319909516949094179390931790915590516307505ff960e31b8152633a82ffc89034906105e59085908a908a908a90600401610dab565b6020604051808303818588803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106379190610bf2565b50604080516001600160a01b038b81168252602082018b9052338284015263ffffffff851660608301529151918c16917f1deb8b1e22941ec32a7ed14b2d25bdb44593ab343156feb1c735ec06696221399181900360800190a250505050505050505050565b604080516001808252818301909252606091600091906020808301908036833701905050905084816000815181106106d7576106d7610e84565b6001600160a01b039283166020918202929092010152604051908916602482015263ffffffff8516604482015260009060640160408051601f19818403018152918152602080830180516001600160e01b0316633336c27960e01b179052825191519293506000926107529284928992849291889101610cbe565b60408051601f198184030181529190529050881561082f576040805160018082528183019092526000916020808301908036833701905050905089816000815181106107a0576107a0610e84565b602002602001018181525050600084826040516024016107c1929190610d14565b604051602081830303815290604052632c78fd0360e21b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d600084518560405160200161081b96959493929190610c54565b604051602081830303815290604052925050505b87156108fa5760408051600180825281830190925260009160208083019080368337019050509050888160008151811061086b5761086b610e84565b6020026020010181815250506000848260405160240161088c929190610d14565b6040516020818303038152906040526322936c2360e11b6001600160e01b0319166020820180516001600160e01b03838183161783525050505090508260008d60008451856040516020016108e696959493929190610c54565b604051602081830303815290604052925050505b60008160405160240161090d9190610d98565b60408051601f198184030181529190526020810180516001600160e01b03166346c07f8560e11b1790529450505050509695505050505050565b8051801515811461095757600080fd5b919050565b60006020828403121561096e57600080fd5b815161097981610eb0565b9392505050565b6000806040838503121561099357600080fd5b823561099e81610eb0565b946020939093013593505050565b60008060008060008060c087890312156109c557600080fd5b86356109d081610eb0565b9550602087013594506040870135935060608701356109ee81610eb0565b925060808701356109fe81610ec8565b915060a0870135610a0e81610eb0565b809150509295509295509295565b60008060408385031215610a2f57600080fd5b8235610a3a81610eb0565b91506020830135610a4a81610ec8565b809150509250929050565b600060808284031215610a6757600080fd5b82601f830112610a7657600080fd5b6040516080810181811067ffffffffffffffff82111715610a9957610a99610e9a565b604052808360808101861015610aae57600080fd5b60005b6004811015610ad857610ac382610947565b83526020928301929190910190600101610ab1565b509195945050505050565b600060208284031215610af557600080fd5b61097982610947565b600080600080600080600080610100898b031215610b1b57600080fd5b8835610b2681610eb0565b9750602089810135610b3781610eb0565b975060408a0135965060608a0135955060808a0135945060a08a0135610b5c81610ec8565b935060c08a0135925060e08a013567ffffffffffffffff80821115610b8057600080fd5b818c0191508c601f830112610b9457600080fd5b813581811115610ba657610ba6610e9a565b610bb8601f8201601f19168501610ded565b91508082528d84828501011115610bce57600080fd5b80848401858401376000848284010152508093505050509295985092959890939650565b600060208284031215610c0457600080fd5b5051919050565b600060208284031215610c1d57600080fd5b815161097981610ec8565b60008151808452610c40816020860160208601610e54565b601f01601f19169290920160200192915050565b60008751610c66818460208c01610e54565b808301905060ff60f81b8860f81b1681526bffffffffffffffffffffffff198760601b1660018201528560158201528460358201528351610cae816055840160208801610e54565b0160550198975050505050505050565b60ff60f81b8660f81b1681526bffffffffffffffffffffffff198560601b16600182015283601582015282603582015260008251610d03816055850160208701610e54565b919091016055019695505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610d565781516001600160a01b031684529284019290840190600101610d31565b5050508381038285015284518082528583019183019060005b81811015610d8b57835183529284019291840191600101610d6f565b5090979650505050505050565b6020815260006109796020830184610c28565b608081526000610dbe6080830187610c28565b63ffffffff861660208401528460408401528281036060840152610de28185610c28565b979650505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e1657610e16610e9a565b604052919050565b600063ffffffff808316818516808303821115610e4b57634e487b7160e01b600052601160045260246000fd5b01949350505050565b60005b83811015610e6f578181015183820152602001610e57565b83811115610e7e576000848401525b50505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ec557600080fd5b50565b63ffffffff81168114610ec557600080fdfea2646970667358221220a3323eb1a602115aba0d9a9bf27a1b961890e40a7d0dbd148bb6b967aef950c264736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 15153, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "escrows", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_struct(Escrow)15146_storage))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_struct(Escrow)15146_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => struct TributeMinion.Escrow))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_struct(Escrow)15146_storage)" + }, + "t_mapping(t_uint256,t_struct(Escrow)15146_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct TributeMinion.Escrow)", + "numberOfBytes": "32", + "value": "t_struct(Escrow)15146_storage" + }, + "t_struct(Escrow)15146_storage": { + "encoding": "inplace", + "label": "struct TributeMinion.Escrow", + "members": [ + { + "astId": 15137, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "token", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 15139, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "applicant", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 15141, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "amount", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 15143, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "released", + "offset": 0, + "slot": "3", + "type": "t_bool" + }, + { + "astId": 15145, + "contract": "contracts/tools/TributeMinion.sol:TributeMinion", + "label": "safe", + "offset": 1, + "slot": "3", + "type": "t_address" + } + ], + "numberOfBytes": "128" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/lib/Baal/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 0000000..6eb5ed9 --- /dev/null +++ b/lib/Baal/deployments/sepolia/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/solcInputs/928daf6847beb441da40e990eb20d125.json b/lib/Baal/deployments/sepolia/solcInputs/928daf6847beb441da40e990eb20d125.json new file mode 100644 index 0000000..fb39b99 --- /dev/null +++ b/lib/Baal/deployments/sepolia/solcInputs/928daf6847beb441da40e990eb20d125.json @@ -0,0 +1,284 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/GnosisSafeStorage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title GnosisSafeStorage - Storage layout of the Safe contracts to be used in libraries\n/// @author Richard Meissner - \ncontract GnosisSafeStorage {\n // From /common/Singleton.sol\n address internal singleton;\n // From /common/ModuleManager.sol\n mapping(address => address) internal modules;\n // From /common/OwnerManager.sol\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n // From /GnosisSafe.sol\n bytes32 internal nonce;\n bytes32 internal domainSeparator;\n mapping(bytes32 => uint256) internal signedMessages;\n mapping(address => mapping(bytes32 => uint256)) internal approvedHashes;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeStorage.sol\";\nimport \"../../GnosisSafe.sol\";\n\n/// @title SignMessageLib - Allows to set an entry in the signedMessages\n/// @author Richard Meissner - \ncontract SignMessageLib is GnosisSafeStorage {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n event SignMsg(bytes32 indexed msgHash);\n\n /// @dev Marks a message as signed, so that it can be used with EIP-1271\n /// @notice Marks a message (`_data`) as signed.\n /// @param _data Arbitrary length data that should be marked as signed on the behalf of address(this)\n function signMessage(bytes calldata _data) external {\n bytes32 msgHash = getMessageHash(_data);\n signedMessages[msgHash] = 1;\n emit SignMsg(msgHash);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return\n keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), GnosisSafe(payable(address(this))).domainSeparator(), safeMessageHash));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./DefaultCallbackHandler.sol\";\nimport \"../interfaces/ISignatureValidator.sol\";\nimport \"../GnosisSafe.sol\";\n\n/// @title Compatibility Fallback Handler - fallback handler to provider compatibility between pre 1.3.0 and 1.3.0+ Safe contracts\n/// @author Richard Meissner - \ncontract CompatibilityFallbackHandler is DefaultCallbackHandler, ISignatureValidator {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256(\"simulate(address,bytes)\"));\n\n address internal constant SENTINEL_MODULES = address(0x1);\n bytes4 internal constant UPDATED_MAGIC_VALUE = 0x1626ba7e;\n\n /**\n * Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`)\n * @dev Should return whether the signature provided is valid for the provided data.\n * @param _data Arbitrary length data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _data\n * @return a bool upon valid or invalid signature with corresponding _data\n */\n function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n bytes32 messageHash = getMessageHashForSafe(safe, _data);\n if (_signature.length == 0) {\n require(safe.signedMessages(messageHash) != 0, \"Hash not approved\");\n } else {\n safe.checkSignatures(messageHash, _data, _signature);\n }\n return EIP1271_MAGIC_VALUE;\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n return getMessageHashForSafe(GnosisSafe(payable(msg.sender)), message);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param safe Safe to which the message is targeted\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHashForSafe(GnosisSafe safe, bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), safe.domainSeparator(), safeMessageHash));\n }\n\n /**\n * Implementation of updated EIP-1271\n * @dev Should return whether the signature provided is valid for the provided data.\n * The save does not implement the interface since `checkSignatures` is not a view method.\n * The method will not perform any state changes (see parameters of `checkSignatures`)\n * @param _dataHash Hash of the data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _dataHash\n * @return a bool upon valid or invalid signature with corresponding _dataHash\n * @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\n */\n function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) {\n ISignatureValidator validator = ISignatureValidator(msg.sender);\n bytes4 value = validator.isValidSignature(abi.encode(_dataHash), _signature);\n return (value == EIP1271_MAGIC_VALUE) ? UPDATED_MAGIC_VALUE : bytes4(0);\n }\n\n /// @dev Returns array of first 10 modules.\n /// @return Array of modules.\n function getModules() external view returns (address[] memory) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n (address[] memory array, ) = safe.getModulesPaginated(SENTINEL_MODULES, 10);\n return array;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulate(address targetContract, bytes calldata calldataPayload) external returns (bytes memory response) {\n // Suppress compiler warnings about not using parameters, while allowing\n // parameters to keep names for documentation purposes. This does not\n // generate code.\n targetContract;\n calldataPayload;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let internalCalldata := mload(0x40)\n // Store `simulateAndRevert.selector`.\n // String representation is used to force right padding\n mstore(internalCalldata, \"\\xb4\\xfa\\xba\\x09\")\n // Abuse the fact that both this and the internal methods have the\n // same signature, and differ only in symbol name (and therefore,\n // selector) and copy calldata directly. This saves us approximately\n // 250 bytes of code and 300 gas at runtime over the\n // `abi.encodeWithSelector` builtin.\n calldatacopy(add(internalCalldata, 0x04), 0x04, sub(calldatasize(), 0x04))\n\n // `pop` is required here by the compiler, as top level expressions\n // can't have return values in inline assembly. `call` typically\n // returns a 0 or 1 value indicated whether or not it reverted, but\n // since we know it will always revert, we can safely ignore it.\n pop(\n call(\n gas(),\n // address() has been changed to caller() to use the implementation of the Safe\n caller(),\n 0,\n internalCalldata,\n calldatasize(),\n // The `simulateAndRevert` call always reverts, and\n // instead encodes whether or not it was successful in the return\n // data. The first 32-byte word of the return data contains the\n // `success` value, so write it to memory address 0x00 (which is\n // reserved Solidity scratch space and OK to use).\n 0x00,\n 0x20\n )\n )\n\n // Allocate and copy the response bytes, making sure to increment\n // the free memory pointer accordingly (in case this method is\n // called as an internal function). The remaining `returndata[0x20:]`\n // contains the ABI encoded response bytes, so we can just write it\n // as is to memory.\n let responseSize := sub(returndatasize(), 0x20)\n response := mload(0x40)\n mstore(0x40, add(response, responseSize))\n returndatacopy(response, 0x20, responseSize)\n\n if iszero(mload(0x00)) {\n revert(add(response, 0x20), mload(response))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n\n/// @title Default Callback Handler - returns true for known token callbacks\n/// @author Richard Meissner - \ncontract DefaultCallbackHandler is ERC1155TokenReceiver, ERC777TokensRecipient, ERC721TokenReceiver, IERC165 {\n string public constant NAME = \"Default Callback Handler\";\n string public constant VERSION = \"1.0.0\";\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xf23a6e61;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xbc197c81;\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0x150b7a02;\n }\n\n function tokensReceived(\n address,\n address,\n address,\n uint256,\n bytes calldata,\n bytes calldata\n ) external pure override {\n // We implement this for completeness, doesn't really have any value\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC1155TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n Note: The ERC-165 identifier for this interface is 0x4e2312e0.\n*/\ninterface ERC1155TokenReceiver {\n /**\n @notice Handle the receipt of a single ERC1155 token type.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` (i.e. 0xf23a6e61) if it accepts the transfer.\n This function MUST revert if it rejects the transfer.\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _id The ID of the token being transferred\n @param _value The amount of tokens being transferred\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 _id,\n uint256 _value,\n bytes calldata _data\n ) external returns (bytes4);\n\n /**\n @notice Handle the receipt of multiple ERC1155 token types.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` (i.e. 0xbc197c81) if it accepts the transfer(s).\n This function MUST revert if it rejects the transfer(s).\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the batch transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _ids An array containing ids of each token being transferred (order and length must match _values array)\n @param _values An array containing amounts of each token being transferred (order and length must match _ids array)\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata _ids,\n uint256[] calldata _values,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC721TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.\ninterface ERC721TokenReceiver {\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC777TokensRecipient.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ninterface ERC777TokensRecipient {\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Multi Send - Allows to batch multiple transactions into one.\n/// @author Nick Dodson - \n/// @author Gonçalo Sá - \n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract MultiSend {\n address private immutable multisendSingleton;\n\n constructor() {\n multisendSingleton = address(this);\n }\n\n /// @dev Sends multiple transactions and reverts all if one fails.\n /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of\n /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),\n /// to as a address (=> 20 bytes),\n /// value as a uint256 (=> 32 bytes),\n /// data length as a uint256 (=> 32 bytes),\n /// data as bytes.\n /// see abi.encodePacked for more information on packed encoding\n /// @notice This method is payable as delegatecalls keep the msg.value from the previous call\n /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise\n function multiSend(bytes memory transactions) public payable {\n require(address(this) != multisendSingleton, \"MultiSend should only be called via delegatecall\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let length := mload(transactions)\n let i := 0x20\n for {\n // Pre block is not used in \"while mode\"\n } lt(i, length) {\n // Post block is not used in \"while mode\"\n } {\n // First byte of the data is the operation.\n // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).\n // This will also zero out unused data.\n let operation := shr(0xf8, mload(add(transactions, i)))\n // We offset the load address by 1 byte (operation byte)\n // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.\n let to := shr(0x60, mload(add(transactions, add(i, 0x01))))\n // We offset the load address by 21 byte (operation byte + 20 address bytes)\n let value := mload(add(transactions, add(i, 0x15)))\n // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)\n let dataLength := mload(add(transactions, add(i, 0x35)))\n // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)\n let data := add(transactions, add(i, 0x55))\n let success := 0\n switch operation\n case 0 {\n success := call(gas(), to, value, data, dataLength, 0, 0)\n }\n case 1 {\n success := delegatecall(gas(), to, data, dataLength, 0, 0)\n }\n if eq(success, 0) {\n revert(0, 0)\n }\n // Next entry starts at 85 byte + data length\n i := add(i, add(0x55, dataLength))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ArraysUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it's possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\n *\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\n * alternative consider {ERC20Votes}.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\n\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\n function __ERC20Snapshot_init() internal onlyInitializing {\n }\n\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\n }\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n using ArraysUpgradeable for uint256[];\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n // Snapshot struct, but that would impede usage of functions that work on an array.\n struct Snapshots {\n uint256[] ids;\n uint256[] values;\n }\n\n mapping(address => Snapshots) private _accountBalanceSnapshots;\n Snapshots private _totalSupplySnapshots;\n\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n CountersUpgradeable.Counter private _currentSnapshotId;\n\n /**\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n */\n event Snapshot(uint256 id);\n\n /**\n * @dev Creates a new snapshot and returns its snapshot id.\n *\n * Emits a {Snapshot} event that contains the same id.\n *\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\n *\n * [WARNING]\n * ====\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n * you must consider that it can potentially be used by attackers in two ways.\n *\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n * section above.\n *\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\n * ====\n */\n function _snapshot() internal virtual returns (uint256) {\n _currentSnapshotId.increment();\n\n uint256 currentId = _getCurrentSnapshotId();\n emit Snapshot(currentId);\n return currentId;\n }\n\n /**\n * @dev Get the current snapshotId\n */\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\n return _currentSnapshotId.current();\n }\n\n /**\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n */\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n return snapshotted ? value : balanceOf(account);\n }\n\n /**\n * @dev Retrieves the total supply at the time `snapshotId` was created.\n */\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n return snapshotted ? value : totalSupply();\n }\n\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (from == address(0)) {\n // mint\n _updateAccountSnapshot(to);\n _updateTotalSupplySnapshot();\n } else if (to == address(0)) {\n // burn\n _updateAccountSnapshot(from);\n _updateTotalSupplySnapshot();\n } else {\n // transfer\n _updateAccountSnapshot(from);\n _updateAccountSnapshot(to);\n }\n }\n\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\n require(snapshotId > 0, \"ERC20Snapshot: id is 0\");\n require(snapshotId <= _getCurrentSnapshotId(), \"ERC20Snapshot: nonexistent id\");\n\n // When a valid snapshot is queried, there are three possibilities:\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n // to this id is the current one.\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n // requested id, and its value is the one to return.\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n // larger than the requested one.\n //\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\n // exactly this.\n\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n if (index == snapshots.ids.length) {\n return (false, 0);\n } else {\n return (true, snapshots.values[index]);\n }\n }\n\n function _updateAccountSnapshot(address account) private {\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n }\n\n function _updateTotalSupplySnapshot() private {\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\n }\n\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n uint256 currentId = _getCurrentSnapshotId();\n if (_lastSnapshotId(snapshots.ids) < currentId) {\n snapshots.ids.push(currentId);\n snapshots.values.push(currentValue);\n }\n }\n\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n if (ids.length == 0) {\n return 0;\n } else {\n return ids[ids.length - 1];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[46] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./StorageSlotUpgradeable.sol\";\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary ArraysUpgradeable {\n using StorageSlotUpgradeable for bytes32;\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * `array` is expected to be sorted in ascending order, and to contain no\n * repeated elements.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n if (array.length == 0) {\n return 0;\n }\n\n uint256 low = 0;\n uint256 high = array.length;\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getUint256Slot();\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/BaalSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"./Baal.sol\";\n\ncontract BaalSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n // when some of the init addresses are updated\n uint256 public addrsVersion;\n\n address payable public template; // fixed template for baal using eip-1167 proxy pattern\n\n // Template contract to use for new Gnosis safe proxies\n address public gnosisSingleton;\n\n // Library to use for EIP1271 compatability\n address public gnosisFallbackLibrary;\n\n // Library to use for all safe transaction executions\n address public gnosisMultisendLibrary;\n\n // template contract to clone for loot ERC20 token\n address public lootSingleton;\n\n // template contract to clone for shares ERC20 token\n address public sharesSingleton;\n\n // Proxy summoners\n //\n GnosisSafeProxyFactory gnosisSafeProxyFactory;\n ModuleProxyFactory moduleProxyFactory;\n\n event SetAddrsVersion(\n uint256 version\n );\n\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n\n event DaoReferral(\n bytes32 referrer,\n address daoAddress\n );\n\n event DeployBaalTokens(\n address lootToken, \n address sharesToken\n );\n\n event DeployBaalSafe(\n address baalSafe,\n address moduleAddr\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n // must be called after deploy to set libraries\n function setAddrs(\n address payable _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) public onlyOwner {\n require(_lootSingleton != address(0), \"!lootSingleton\");\n require(_sharesSingleton != address(0), \"!sharesSingleton\");\n require(_gnosisSingleton != address(0), \"!gnosisSingleton\");\n require(_gnosisFallbackLibrary != address(0), '!gnosisFallbackLibrary');\n require(_gnosisMultisendLibrary != address(0), '!gnosisMultisendLibrary');\n require(_gnosisSafeProxyFactory != address(0), '!gnosisSafeProxyFactory');\n require(_moduleProxyFactory != address(0), '!moduleProxyFactory');\n\n template = _template;\n gnosisSingleton = _gnosisSingleton;\n gnosisFallbackLibrary = _gnosisFallbackLibrary;\n gnosisMultisendLibrary = _gnosisMultisendLibrary;\n gnosisSafeProxyFactory = GnosisSafeProxyFactory(_gnosisSafeProxyFactory);\n moduleProxyFactory = ModuleProxyFactory(_moduleProxyFactory);\n lootSingleton = _lootSingleton;\n sharesSingleton = _sharesSingleton;\n\n emit SetAddrsVersion(\n addrsVersion++\n );\n \n }\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n public\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n function summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) external returns (address) {\n \n return\n _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n }\n\n // Add a referrer to help keep track of where deploies are coming from\n function summonBaalFromReferrer(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address) {\n address daoAddress;\n\n daoAddress = _summonBaal(\n initializationParams,\n initializationActions,\n _saltNonce\n );\n\n emit DaoReferral(referrer, daoAddress);\n return daoAddress;\n }\n\n // deploy new share and loot contracts\n function deployTokens(string memory _name, string memory _symbol) \n public \n returns (address lootToken, address sharesToken) \n {\n lootToken = address(new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector, \n string(abi.encodePacked(_name, \" LOOT\")), \n string(abi.encodePacked(_symbol, \"-LOOT\")))\n ));\n\n sharesToken = address(new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector, \n _name, \n _symbol)\n ));\n\n emit DeployBaalTokens(lootToken, sharesToken);\n\n }\n\n // deploy a safe with module and single module signer setup\n function deployAndSetupSafe(address _moduleAddr)\n public\n returns (address)\n {\n // Deploy new safe but do not set it up yet\n GnosisSafe _safe = GnosisSafe(\n payable(\n gnosisSafeProxyFactory.createProxy(\n gnosisSingleton,\n bytes(\"\")\n )\n )\n );\n // Generate delegate calls so the safe calls enableModule on itself during setup\n bytes memory _enableBaal = abi.encodeWithSignature(\n \"enableModule(address)\",\n address(_moduleAddr)\n );\n bytes memory _enableBaalMultisend = abi.encodePacked(\n uint8(0),\n address(_safe),\n uint256(0),\n uint256(_enableBaal.length),\n bytes(_enableBaal)\n );\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n _enableBaalMultisend\n );\n\n // Workaround for solidity dynamic memory array\n address[] memory _owners = new address[](1);\n _owners[0] = address(_moduleAddr);\n\n // Call setup on safe to enable our new module and set the module as the only signer\n _safe.setup(\n _owners,\n 1,\n gnosisMultisendLibrary,\n _multisendAction,\n gnosisFallbackLibrary,\n address(0),\n 0,\n payable(address(0))\n );\n\n emit DeployBaalSafe(address(_safe), address(_moduleAddr));\n\n return address(_safe);\n }\n\n // advanced summon baal with different configurations\n // name and symbol can be blank if bringing own baal tokens\n // zero address for either loot or shares token will summon new ones\n // if bringing own tokens the ownership must be transfered to the new DAO\n // zero address for Safe with summon and setup a new Safe\n // if bringing existing safe the new dao must be enabled as a module\n // todo: add a simple summon that just creates a dao with a single summoner\n function _summonBaal(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 _saltNonce\n ) internal returns (address) {\n uint256 existingAddrs; // 1 tokens, 2 safe, 3 both\n (\n string memory _name, /*_name Name for erc20 `shares` accounting, empty if token */\n string memory _symbol, /*_symbol Symbol for erc20 `shares` accounting, empty if token*/\n address _safeAddr, /*address of safe, 0 addr if new*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771), 0 addr if initially disabled*/\n address _lootToken, /*predeployed loot token, 0 addr if new*/\n address _sharesToken /*predeployed shares token, 0 addr if new*/\n ) = abi.decode(initializationParams, (string, string, address, address, address, address));\n\n Baal _baal = Baal(\n moduleProxyFactory.deployModule(\n template, \n abi.encodeWithSignature(\"avatar()\"), \n _saltNonce\n )\n );\n\n // if loot or shares are zero address new tokens are deployed\n // tokens need to be baalTokens\n if(_lootToken == address(0) || _sharesToken == address(0)){\n (_lootToken, _sharesToken) = deployTokens(_name, _symbol);\n // pause tokens by default and transfer to the DAO\n IBaalToken(_lootToken).pause();\n IBaalToken(_sharesToken).pause();\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n } else {\n existingAddrs += 1;\n }\n\n // if zero address deploy a new safe\n // Needs to be a valid zodiac treasury\n if(_safeAddr == address(0)){\n _safeAddr = deployAndSetupSafe(address(_baal));\n } else {\n existingAddrs += 2;\n }\n\n bytes memory _initializationMultisendData = encodeMultisend(\n initializationActions,\n address(_baal)\n );\n bytes memory _initializer = abi.encode(\n _lootToken,\n _sharesToken,\n gnosisMultisendLibrary,\n _safeAddr,\n _forwarder,\n _initializationMultisendData\n );\n // can run the actions now because we have a baal\n _baal.setUp(_initializer);\n\n emit SummonBaal(\n address(_baal),\n address(_baal.lootToken()),\n address(_baal.sharesToken()),\n _safeAddr,\n _forwarder,\n existingAddrs\n );\n\n return (address(_baal));\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IAdminShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IAdminShaman {\n function isAdmin(address shaman) external view returns (bool);\n\n // Admin Only\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n}\n" + }, + "contracts/interfaces/IBaal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaal {\n function lootToken() external view returns (address);\n function sharesToken() external view returns (address);\n function votingPeriod() external view returns (uint32);\n function gracePeriod() external view returns (uint32);\n function proposalCount() external view returns (uint32);\n function proposalOffering() external view returns (uint256);\n function quorumPercent() external view returns (uint256);\n function sponsorThreshold() external view returns (uint256);\n function minRetentionPercent() external view returns (uint256);\n function latestSponsoredProposalId() external view returns (uint32);\n\n function setUp(bytes memory initializationParams) external;\n function multisendLibrary() external view returns (address);\n // Module\n function avatar() external view returns (address);\n function target() external view returns (address);\n function setAvatar(address avatar) external;\n function setTarget(address avatar) external;\n // BaseRelayRecipient\n function trustedForwarder() external view returns (address);\n function setTrustedForwarder(address trustedForwarderAddress) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n function totalLoot() external view returns (uint256);\n function totalShares() external view returns (uint256);\n function totalSupply() external view returns (uint256);\n function lootPaused() external view returns (bool);\n function sharesPaused() external view returns (bool);\n \n function shamans(address shaman) external view returns (uint256);\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\n function isAdmin(address shaman) external view returns (bool);\n function isManager(address shaman) external view returns (bool);\n function isGovernor(address shaman) external view returns (bool);\n function lockAdmin() external;\n function lockManager() external;\n function lockGovernor() external;\n function adminLock() external view returns (bool);\n function managerLock() external view returns (bool);\n function governorLock() external view returns (bool);\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n function setGovernanceConfig(bytes memory governanceConfig) external;\n\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable returns (uint256);\n function sponsorProposal(uint32 id) external;\n function processProposal(uint32 id, bytes calldata proposalData) external;\n function cancelProposal(uint32 id) external;\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\n function submitVote(uint32 id, bool approved) external;\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\n\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\n}\n" + }, + "contracts/interfaces/IBaalAndVaultSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalAndVaultSummoner {\n\n function _baalSummoner() external view returns (address);\n function summonBaalAndVault(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 saltNonce,\n bytes32 referrer,\n string memory name\n ) external returns (address _daoAddress, address _vaultAddress);\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + }, + "contracts/interfaces/IGovernorShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IGovernorShaman {\n function isGovernor(address shaman) external view returns (bool);\n // Governor Only\n function setGovernanceConfig(bytes memory _governanceConfig) external;\n}\n" + }, + "contracts/interfaces/IManagerShaman.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IManagerShaman {\n\n function isManager(address shaman) external view returns (bool);\n\n // Manager Only\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n\n}\n" + }, + "contracts/interfaces/IPoster.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IPoster {\n function post(string calldata content, string calldata tag) external;\n}\n" + }, + "contracts/utils/DelegationEIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4Delegation}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract DelegationEIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME_DELEGATION;\n bytes32 private _HASHED_VERSION_DELEGATION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained_delegation(name, version);\n }\n\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME_DELEGATION = hashedName;\n _HASHED_VERSION_DELEGATION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\n }\n\n function _buildDomainSeparatorDelegation(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_NAME_DELEGATION;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_VERSION_DELEGATION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/deployments/sepolia/solcInputs/d833871936d16a85338aeeebf4887b62.json b/lib/Baal/deployments/sepolia/solcInputs/d833871936d16a85338aeeebf4887b62.json new file mode 100644 index 0000000..285fb33 --- /dev/null +++ b/lib/Baal/deployments/sepolia/solcInputs/d833871936d16a85338aeeebf4887b62.json @@ -0,0 +1,302 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\n\n /// @dev Set a guard that checks transactions before execution\n /// @param guard The address of the guard to be used or the 0 address to disable the guard\n function setGuard(address guard) external authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/GnosisSafeStorage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title GnosisSafeStorage - Storage layout of the Safe contracts to be used in libraries\n/// @author Richard Meissner - \ncontract GnosisSafeStorage {\n // From /common/Singleton.sol\n address internal singleton;\n // From /common/ModuleManager.sol\n mapping(address => address) internal modules;\n // From /common/OwnerManager.sol\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n // From /GnosisSafe.sol\n bytes32 internal nonce;\n bytes32 internal domainSeparator;\n mapping(bytes32 => uint256) internal signedMessages;\n mapping(address => mapping(bytes32 => uint256)) internal approvedHashes;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeStorage.sol\";\nimport \"../../GnosisSafe.sol\";\n\n/// @title SignMessageLib - Allows to set an entry in the signedMessages\n/// @author Richard Meissner - \ncontract SignMessageLib is GnosisSafeStorage {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n event SignMsg(bytes32 indexed msgHash);\n\n /// @dev Marks a message as signed, so that it can be used with EIP-1271\n /// @notice Marks a message (`_data`) as signed.\n /// @param _data Arbitrary length data that should be marked as signed on the behalf of address(this)\n function signMessage(bytes calldata _data) external {\n bytes32 msgHash = getMessageHash(_data);\n signedMessages[msgHash] = 1;\n emit SignMsg(msgHash);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return\n keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), GnosisSafe(payable(address(this))).domainSeparator(), safeMessageHash));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures\n ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./DefaultCallbackHandler.sol\";\nimport \"../interfaces/ISignatureValidator.sol\";\nimport \"../GnosisSafe.sol\";\n\n/// @title Compatibility Fallback Handler - fallback handler to provider compatibility between pre 1.3.0 and 1.3.0+ Safe contracts\n/// @author Richard Meissner - \ncontract CompatibilityFallbackHandler is DefaultCallbackHandler, ISignatureValidator {\n //keccak256(\n // \"SafeMessage(bytes message)\"\n //);\n bytes32 private constant SAFE_MSG_TYPEHASH = 0x60b3cbf8b4a223d68d641b3b6ddf9a298e7f33710cf3d3a9d1146b5a6150fbca;\n\n bytes4 internal constant SIMULATE_SELECTOR = bytes4(keccak256(\"simulate(address,bytes)\"));\n\n address internal constant SENTINEL_MODULES = address(0x1);\n bytes4 internal constant UPDATED_MAGIC_VALUE = 0x1626ba7e;\n\n /**\n * Implementation of ISignatureValidator (see `interfaces/ISignatureValidator.sol`)\n * @dev Should return whether the signature provided is valid for the provided data.\n * @param _data Arbitrary length data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _data\n * @return a bool upon valid or invalid signature with corresponding _data\n */\n function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n bytes32 messageHash = getMessageHashForSafe(safe, _data);\n if (_signature.length == 0) {\n require(safe.signedMessages(messageHash) != 0, \"Hash not approved\");\n } else {\n safe.checkSignatures(messageHash, _data, _signature);\n }\n return EIP1271_MAGIC_VALUE;\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHash(bytes memory message) public view returns (bytes32) {\n return getMessageHashForSafe(GnosisSafe(payable(msg.sender)), message);\n }\n\n /// @dev Returns hash of a message that can be signed by owners.\n /// @param safe Safe to which the message is targeted\n /// @param message Message that should be hashed\n /// @return Message hash.\n function getMessageHashForSafe(GnosisSafe safe, bytes memory message) public view returns (bytes32) {\n bytes32 safeMessageHash = keccak256(abi.encode(SAFE_MSG_TYPEHASH, keccak256(message)));\n return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), safe.domainSeparator(), safeMessageHash));\n }\n\n /**\n * Implementation of updated EIP-1271\n * @dev Should return whether the signature provided is valid for the provided data.\n * The save does not implement the interface since `checkSignatures` is not a view method.\n * The method will not perform any state changes (see parameters of `checkSignatures`)\n * @param _dataHash Hash of the data signed on the behalf of address(msg.sender)\n * @param _signature Signature byte array associated with _dataHash\n * @return a bool upon valid or invalid signature with corresponding _dataHash\n * @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\n */\n function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view returns (bytes4) {\n ISignatureValidator validator = ISignatureValidator(msg.sender);\n bytes4 value = validator.isValidSignature(abi.encode(_dataHash), _signature);\n return (value == EIP1271_MAGIC_VALUE) ? UPDATED_MAGIC_VALUE : bytes4(0);\n }\n\n /// @dev Returns array of first 10 modules.\n /// @return Array of modules.\n function getModules() external view returns (address[] memory) {\n // Caller should be a Safe\n GnosisSafe safe = GnosisSafe(payable(msg.sender));\n (address[] memory array, ) = safe.getModulesPaginated(SENTINEL_MODULES, 10);\n return array;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static). Catches revert and returns encoded result as bytes.\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulate(address targetContract, bytes calldata calldataPayload) external returns (bytes memory response) {\n // Suppress compiler warnings about not using parameters, while allowing\n // parameters to keep names for documentation purposes. This does not\n // generate code.\n targetContract;\n calldataPayload;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let internalCalldata := mload(0x40)\n // Store `simulateAndRevert.selector`.\n // String representation is used to force right padding\n mstore(internalCalldata, \"\\xb4\\xfa\\xba\\x09\")\n // Abuse the fact that both this and the internal methods have the\n // same signature, and differ only in symbol name (and therefore,\n // selector) and copy calldata directly. This saves us approximately\n // 250 bytes of code and 300 gas at runtime over the\n // `abi.encodeWithSelector` builtin.\n calldatacopy(add(internalCalldata, 0x04), 0x04, sub(calldatasize(), 0x04))\n\n // `pop` is required here by the compiler, as top level expressions\n // can't have return values in inline assembly. `call` typically\n // returns a 0 or 1 value indicated whether or not it reverted, but\n // since we know it will always revert, we can safely ignore it.\n pop(\n call(\n gas(),\n // address() has been changed to caller() to use the implementation of the Safe\n caller(),\n 0,\n internalCalldata,\n calldatasize(),\n // The `simulateAndRevert` call always reverts, and\n // instead encodes whether or not it was successful in the return\n // data. The first 32-byte word of the return data contains the\n // `success` value, so write it to memory address 0x00 (which is\n // reserved Solidity scratch space and OK to use).\n 0x00,\n 0x20\n )\n )\n\n // Allocate and copy the response bytes, making sure to increment\n // the free memory pointer accordingly (in case this method is\n // called as an internal function). The remaining `returndata[0x20:]`\n // contains the ABI encoded response bytes, so we can just write it\n // as is to memory.\n let responseSize := sub(returndatasize(), 0x20)\n response := mload(0x40)\n mstore(0x40, add(response, responseSize))\n returndatacopy(response, 0x20, responseSize)\n\n if iszero(mload(0x00)) {\n revert(add(response, 0x20), mload(response))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/handler/DefaultCallbackHandler.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n\n/// @title Default Callback Handler - returns true for known token callbacks\n/// @author Richard Meissner - \ncontract DefaultCallbackHandler is ERC1155TokenReceiver, ERC777TokensRecipient, ERC721TokenReceiver, IERC165 {\n string public constant NAME = \"Default Callback Handler\";\n string public constant VERSION = \"1.0.0\";\n\n function onERC1155Received(\n address,\n address,\n uint256,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xf23a6e61;\n }\n\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] calldata,\n uint256[] calldata,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0xbc197c81;\n }\n\n function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (bytes4) {\n return 0x150b7a02;\n }\n\n function tokensReceived(\n address,\n address,\n address,\n uint256,\n bytes calldata,\n bytes calldata\n ) external pure override {\n // We implement this for completeness, doesn't really have any value\n }\n\n function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC1155TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n Note: The ERC-165 identifier for this interface is 0x4e2312e0.\n*/\ninterface ERC1155TokenReceiver {\n /**\n @notice Handle the receipt of a single ERC1155 token type.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` (i.e. 0xf23a6e61) if it accepts the transfer.\n This function MUST revert if it rejects the transfer.\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _id The ID of the token being transferred\n @param _value The amount of tokens being transferred\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 _id,\n uint256 _value,\n bytes calldata _data\n ) external returns (bytes4);\n\n /**\n @notice Handle the receipt of multiple ERC1155 token types.\n @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated. \n This function MUST return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` (i.e. 0xbc197c81) if it accepts the transfer(s).\n This function MUST revert if it rejects the transfer(s).\n Return of any other value than the prescribed keccak256 generated value MUST result in the transaction being reverted by the caller.\n @param _operator The address which initiated the batch transfer (i.e. msg.sender)\n @param _from The address which previously owned the token\n @param _ids An array containing ids of each token being transferred (order and length must match _values array)\n @param _values An array containing amounts of each token being transferred (order and length must match _ids array)\n @param _data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata _ids,\n uint256[] calldata _values,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC721TokenReceiver.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @dev Note: the ERC-165 identifier for this interface is 0x150b7a02.\ninterface ERC721TokenReceiver {\n /// @notice Handle the receipt of an NFT\n /// @dev The ERC721 smart contract calls this function on the recipient\n /// after a `transfer`. This function MAY throw to revert and reject the\n /// transfer. Return of other than the magic value MUST result in the\n /// transaction being reverted.\n /// Note: the contract address is always the message sender.\n /// @param _operator The address which called `safeTransferFrom` function\n /// @param _from The address which previously owned the token\n /// @param _tokenId The NFT identifier which is being transferred\n /// @param _data Additional data with no specified format\n /// @return `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n /// unless throwing\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ERC777TokensRecipient.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ninterface ERC777TokensRecipient {\n function tokensReceived(\n address operator,\n address from,\n address to,\n uint256 amount,\n bytes calldata data,\n bytes calldata operatorData\n ) external;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @notice More details at https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Multi Send - Allows to batch multiple transactions into one.\n/// @author Nick Dodson - \n/// @author Gonçalo Sá - \n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract MultiSend {\n address private immutable multisendSingleton;\n\n constructor() {\n multisendSingleton = address(this);\n }\n\n /// @dev Sends multiple transactions and reverts all if one fails.\n /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of\n /// operation as a uint8 with 0 for a call or 1 for a delegatecall (=> 1 byte),\n /// to as a address (=> 20 bytes),\n /// value as a uint256 (=> 32 bytes),\n /// data length as a uint256 (=> 32 bytes),\n /// data as bytes.\n /// see abi.encodePacked for more information on packed encoding\n /// @notice This method is payable as delegatecalls keep the msg.value from the previous call\n /// If the calling method (e.g. execTransaction) received ETH this would revert otherwise\n function multiSend(bytes memory transactions) public payable {\n require(address(this) != multisendSingleton, \"MultiSend should only be called via delegatecall\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let length := mload(transactions)\n let i := 0x20\n for {\n // Pre block is not used in \"while mode\"\n } lt(i, length) {\n // Post block is not used in \"while mode\"\n } {\n // First byte of the data is the operation.\n // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).\n // This will also zero out unused data.\n let operation := shr(0xf8, mload(add(transactions, i)))\n // We offset the load address by 1 byte (operation byte)\n // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.\n let to := shr(0x60, mload(add(transactions, add(i, 0x01))))\n // We offset the load address by 21 byte (operation byte + 20 address bytes)\n let value := mload(add(transactions, add(i, 0x15)))\n // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)\n let dataLength := mload(add(transactions, add(i, 0x35)))\n // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)\n let data := add(transactions, add(i, 0x55))\n let success := 0\n switch operation\n case 0 {\n success := call(gas(), to, value, data, dataLength, 0, 0)\n }\n case 1 {\n success := delegatecall(gas(), to, data, dataLength, 0, 0)\n }\n if eq(success, 0) {\n revert(0, 0)\n }\n // Next entry starts at 85 byte + data length\n i := add(i, add(0x55, dataLength))\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n (success, ) = _exec(to, value, data, operation);\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./draft-IERC20PermitUpgradeable.sol\";\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 51\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n mapping(address => CountersUpgradeable.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n function __ERC20Permit_init(string memory name) internal onlyInitializing {\n __EIP712_init_unchained(name, \"1\");\n }\n\n function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(address owner) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(address owner) internal virtual returns (uint256 current) {\n CountersUpgradeable.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/extensions/ERC20Snapshot.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ArraysUpgradeable.sol\";\nimport \"../../../utils/CountersUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and\n * total supply at the time are recorded for later access.\n *\n * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting.\n * In naive implementations it's possible to perform a \"double spend\" attack by reusing the same balance from different\n * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be\n * used to create an efficient ERC20 forking mechanism.\n *\n * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a\n * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot\n * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id\n * and the account address.\n *\n * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it\n * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this\n * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract.\n *\n * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient\n * alternative consider {ERC20Votes}.\n *\n * ==== Gas Costs\n *\n * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log\n * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much\n * smaller since identical balances in subsequent snapshots are stored as a single entry.\n *\n * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is\n * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent\n * transfers will have normal cost until the next snapshot, and so on.\n */\n\nabstract contract ERC20SnapshotUpgradeable is Initializable, ERC20Upgradeable {\n function __ERC20Snapshot_init() internal onlyInitializing {\n }\n\n function __ERC20Snapshot_init_unchained() internal onlyInitializing {\n }\n // Inspired by Jordi Baylina's MiniMeToken to record historical balances:\n // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol\n\n using ArraysUpgradeable for uint256[];\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a\n // Snapshot struct, but that would impede usage of functions that work on an array.\n struct Snapshots {\n uint256[] ids;\n uint256[] values;\n }\n\n mapping(address => Snapshots) private _accountBalanceSnapshots;\n Snapshots private _totalSupplySnapshots;\n\n // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid.\n CountersUpgradeable.Counter private _currentSnapshotId;\n\n /**\n * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created.\n */\n event Snapshot(uint256 id);\n\n /**\n * @dev Creates a new snapshot and returns its snapshot id.\n *\n * Emits a {Snapshot} event that contains the same id.\n *\n * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a\n * set of accounts, for example using {AccessControl}, or it may be open to the public.\n *\n * [WARNING]\n * ====\n * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking,\n * you must consider that it can potentially be used by attackers in two ways.\n *\n * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow\n * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target\n * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs\n * section above.\n *\n * We haven't measured the actual numbers; if this is something you're interested in please reach out to us.\n * ====\n */\n function _snapshot() internal virtual returns (uint256) {\n _currentSnapshotId.increment();\n\n uint256 currentId = _getCurrentSnapshotId();\n emit Snapshot(currentId);\n return currentId;\n }\n\n /**\n * @dev Get the current snapshotId\n */\n function _getCurrentSnapshotId() internal view virtual returns (uint256) {\n return _currentSnapshotId.current();\n }\n\n /**\n * @dev Retrieves the balance of `account` at the time `snapshotId` was created.\n */\n function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]);\n\n return snapshotted ? value : balanceOf(account);\n }\n\n /**\n * @dev Retrieves the total supply at the time `snapshotId` was created.\n */\n function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) {\n (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots);\n\n return snapshotted ? value : totalSupply();\n }\n\n // Update balance and/or total supply snapshots before the values are modified. This is implemented\n // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n if (from == address(0)) {\n // mint\n _updateAccountSnapshot(to);\n _updateTotalSupplySnapshot();\n } else if (to == address(0)) {\n // burn\n _updateAccountSnapshot(from);\n _updateTotalSupplySnapshot();\n } else {\n // transfer\n _updateAccountSnapshot(from);\n _updateAccountSnapshot(to);\n }\n }\n\n function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) {\n require(snapshotId > 0, \"ERC20Snapshot: id is 0\");\n require(snapshotId <= _getCurrentSnapshotId(), \"ERC20Snapshot: nonexistent id\");\n\n // When a valid snapshot is queried, there are three possibilities:\n // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never\n // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds\n // to this id is the current one.\n // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the\n // requested id, and its value is the one to return.\n // c) More snapshots were created after the requested one, and the queried value was later modified. There will be\n // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is\n // larger than the requested one.\n //\n // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if\n // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does\n // exactly this.\n\n uint256 index = snapshots.ids.findUpperBound(snapshotId);\n\n if (index == snapshots.ids.length) {\n return (false, 0);\n } else {\n return (true, snapshots.values[index]);\n }\n }\n\n function _updateAccountSnapshot(address account) private {\n _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account));\n }\n\n function _updateTotalSupplySnapshot() private {\n _updateSnapshot(_totalSupplySnapshots, totalSupply());\n }\n\n function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private {\n uint256 currentId = _getCurrentSnapshotId();\n if (_lastSnapshotId(snapshots.ids) < currentId) {\n snapshots.ids.push(currentId);\n snapshots.values.push(currentValue);\n }\n }\n\n function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) {\n if (ids.length == 0) {\n return 0;\n } else {\n return ids[ids.length - 1];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[46] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ArraysUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./StorageSlotUpgradeable.sol\";\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary ArraysUpgradeable {\n using StorageSlotUpgradeable for bytes32;\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * `array` is expected to be sorted in ascending order, and to contain no\n * repeated elements.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n if (array.length == 0) {\n return 0;\n }\n\n uint256 low = 0;\n uint256 high = array.length;\n\n while (low < high) {\n uint256 mid = MathUpgradeable.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds down (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.AddressSlot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Bytes32Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlotUpgradeable.Uint256Slot storage) {\n bytes32 slot;\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0, arr.slot)\n slot := add(keccak256(0, 0x20), pos)\n }\n return slot.getUint256Slot();\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/Clones.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(address implementation, bytes32 salt)\n internal\n view\n returns (address predicted)\n {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/fixtures/GnosisImports.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/examples/libraries/SignMessage.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\nimport \"@gnosis.pm/safe-contracts/contracts/handler/CompatibilityFallbackHandler.sol\"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol\n" + }, + "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../Baal.sol\";\nimport \"../interfaces/IBaalSummoner.sol\";\n\ncontract BaalAdvTokenSummoner is\n Initializable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n IBaalSummoner public _baalSummoner;\n\n event setSummoner(address summoner);\n\n event DeployBaalTokens(address lootToken, address sharesToken);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize() public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /**\n * @dev Sets the address of the BaalSummoner contract\n * @param baalSummoner The address of the BaalSummoner contract\n */\n function setSummonerAddr(address baalSummoner) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /**\n * @dev Summon a new Baal contract with a new set of tokens\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\n * @param _saltNonce The salt nonce to be used for the Safe contract\n * @param initializationMintParams The parameters for minting the tokens\n * @param initializationTokenParams The parameters for deploying the tokens\n * @param postInitializationActions The actions to be performed after the initialization\n */\n function summonBaalFromReferrer(\n address _safeAddr,\n address _forwarderAddr,\n uint256 _saltNonce,\n bytes calldata initializationMintParams,\n bytes calldata initializationTokenParams,\n bytes[] calldata postInitializationActions\n ) external {\n // summon tokens\n (address _lootToken, address _sharesToken) = deployTokens(\n initializationTokenParams\n );\n\n // mint shares loot tokens\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\n\n // summon baal with new tokens\n address _baal = _baalSummoner.summonBaalFromReferrer(\n abi.encode(\n IBaalToken(_sharesToken).name(), \n IBaalToken(_sharesToken).symbol(),\n _safeAddr,\n _forwarderAddr,\n _lootToken,\n _sharesToken\n ),\n postInitializationActions,\n _saltNonce,\n bytes32(bytes(\"DHAdvTokenSummoner\")) // referrer\n );\n\n // change token ownership to baal\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n }\n\n /**\n * @dev mintTokens\n * @param initializationTokens The parameters for minting the tokens\n * @param _lootToken The loot token address\n * @param _sharesToken The shares token address\n */\n function mintTokens(\n bytes calldata initializationTokens,\n address _lootToken,\n address _sharesToken\n ) internal {\n (\n address[] memory summoners, // The address to mint initial tokens to\n uint256[] memory summonerShares, // The amount of shares to mint\n uint256[] memory summonerLoot // The amount of loot to mint\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\n\n require(\n summoners.length == summonerShares.length &&\n summoners.length == summonerLoot.length,\n \"!array parity\"\n ); /*check array lengths match*/\n\n for (uint256 i = 0; i < summoners.length; i++) {\n if (summonerLoot[i] > 0) {\n IBaalToken(_lootToken).mint(\n summoners[i],\n summonerLoot[i]\n ); /*grant `to` `amount` `loot`*/\n }\n if (summonerShares[i] > 0) {\n IBaalToken(_sharesToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `shares`*/\n }\n }\n }\n\n /**\n * @dev deployTokens\n * @param initializationParams The parameters for deploying the tokens\n */\n function deployTokens(\n bytes calldata initializationParams\n ) internal returns (address lootToken, address sharesToken) {\n (\n string\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\n string\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\n string\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\n string\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\n bool _transferableShares /* if shares is transferable */,\n bool _transferableLoot /* if loot is transferable */\n ) = abi.decode(\n initializationParams,\n (string, string, string, string, bool, bool)\n );\n\n address lootSingleton = _baalSummoner.lootSingleton();\n address sharesSingleton = _baalSummoner.sharesSingleton();\n\n lootToken = address(\n new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector,\n _lootName,\n _lootSymbol\n )\n )\n );\n\n sharesToken = address(\n new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector,\n _name,\n _symbol\n )\n )\n );\n if (!_transferableShares) {\n IBaalToken(sharesToken).pause();\n }\n if (!_transferableLoot) {\n IBaalToken(lootToken).pause();\n }\n\n emit DeployBaalTokens(lootToken, sharesToken);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n}\n" + }, + "contracts/higherOrderFactories/BaalAndVaultSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../interfaces/IBaalSummoner.sol\";\n\n/*\nSummon new 'non-ragequitable' treasury Safe (Vaults). (sidecar?)\nCan summon a dao with a new Vault.\nCan summon a new vault for a dao after initial dao setup.\nActs as a register and the owner of the contract or DAO can deactivate\nregister is primarily a helper for UIs\nOwner of the contract can add new vaults, and set current vaults\nContract is upgradable and should be owned by a DAO\n*/\ncontract BaalAndVaultSummoner is Initializable, OwnableUpgradeable, UUPSUpgradeable {\n\n IBaalSummoner public _baalSummoner;\n uint256 public vaultIdx;\n\n struct Vault{\n uint256 id;\n bool active;\n address daoAddress;\n address vaultAddress;\n string name;\n }\n mapping(uint256 => Vault) public vaults;\n mapping(address => address) public delegates;\n\n event SetVault(\n Vault vault\n );\n\n event SetDelegate(\n address daoAddress,\n address delegate\n );\n\n event setSummoner(\n address summoner\n );\n\n function initialize() initializer public {\n __Ownable_init();\n __UUPSUpgradeable_init();\n vaultIdx = 0;\n }\n\n function setSummonerAddr(\n address baalSummoner\n ) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /** Summon a new baal and add a Vault */\n function summonBaalAndVault(\n bytes calldata initializationParams,\n bytes[] calldata initializationActions,\n uint256 saltNonce,\n bytes32 referrer,\n string memory name\n ) external returns (address _daoAddress, address _vaultAddress) {\n _daoAddress = _baalSummoner.summonBaalFromReferrer(\n initializationParams,\n initializationActions,\n saltNonce,\n referrer\n );\n _vaultAddress = summonVault(_daoAddress, name);\n }\n\n /** create and add a Vault(Safe) to an existing DAO */\n function summonVault(\n address daoAddress,\n string memory name\n ) public returns (address _vaultAddress) {\n _vaultAddress = _baalSummoner.deployAndSetupSafe(\n daoAddress\n );\n _setNewVault(name, daoAddress, _vaultAddress);\n }\n\n /** set a Vault as active or not on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setVault(\n uint256 id,\n bool active\n ) public onlyOwner\n {\n _setVault(id, active);\n }\n\n /** set a new Vault as active on existing dao (owner only) */\n // Admin functions to help maintain the registry.\n function setNewVault(\n address daoAddress, \n address vaultAddress,\n string memory name\n ) public onlyOwner\n {\n _setNewVault(name, daoAddress, vaultAddress);\n }\n\n /** \n A DAO can set a Vault as inactive \n */\n function deactivateVaultAsDao(\n uint256 id,\n address daoAddress\n ) external\n {\n require(msg.sender == daoAddress || msg.sender == delegates[daoAddress], \"not DAO or delegate\");\n require(vaults[id].daoAddress == daoAddress && vaults[id].active,\"!not active DAO vault\");\n _setVault(id, false);\n }\n\n /** Allow a Dao to set a delegate that can manage vault enteries */\n function setDelegate(\n address daoAddress,\n address delegate\n ) external\n {\n require(msg.sender == daoAddress, \"!DAO\");\n delegates[daoAddress] = delegate;\n emit SetDelegate(daoAddress, delegate);\n }\n\n\n function _setVault(\n uint256 id, \n bool active\n ) internal \n {\n vaults[id].active = active;\n emit SetVault(vaults[id]);\n }\n\n function _setNewVault(\n string memory name,\n address daoAddress, \n address vaultAddress\n ) internal \n {\n vaultIdx += 1;\n vaults[vaultIdx] = Vault(vaultIdx, true, daoAddress, vaultAddress, name);\n emit SetVault(vaults[vaultIdx]);\n }\n\n function _authorizeUpgrade(address newImplementation)\n internal\n onlyOwner\n override\n {}\n}\n" + }, + "contracts/interfaces/IBaal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaal {\n function lootToken() external view returns (address);\n function sharesToken() external view returns (address);\n function votingPeriod() external view returns (uint32);\n function gracePeriod() external view returns (uint32);\n function proposalCount() external view returns (uint32);\n function proposalOffering() external view returns (uint256);\n function quorumPercent() external view returns (uint256);\n function sponsorThreshold() external view returns (uint256);\n function minRetentionPercent() external view returns (uint256);\n function latestSponsoredProposalId() external view returns (uint32);\n\n function setUp(bytes memory initializationParams) external;\n function multisendLibrary() external view returns (address);\n // Module\n function avatar() external view returns (address);\n function target() external view returns (address);\n function setAvatar(address avatar) external;\n function setTarget(address avatar) external;\n // BaseRelayRecipient\n function trustedForwarder() external view returns (address);\n function setTrustedForwarder(address trustedForwarderAddress) external;\n\n function mintLoot(address[] calldata to, uint256[] calldata amount) external;\n function burnLoot(address[] calldata from, uint256[] calldata amount) external;\n function mintShares(address[] calldata to, uint256[] calldata amount) external;\n function burnShares(address[] calldata from, uint256[] calldata amount) external;\n function totalLoot() external view returns (uint256);\n function totalShares() external view returns (uint256);\n function totalSupply() external view returns (uint256);\n function lootPaused() external view returns (bool);\n function sharesPaused() external view returns (bool);\n \n function shamans(address shaman) external view returns (uint256);\n function setShamans(address[] calldata shamans, uint256[] calldata permissions) external;\n function isAdmin(address shaman) external view returns (bool);\n function isManager(address shaman) external view returns (bool);\n function isGovernor(address shaman) external view returns (bool);\n function lockAdmin() external;\n function lockManager() external;\n function lockGovernor() external;\n function adminLock() external view returns (bool);\n function managerLock() external view returns (bool);\n function governorLock() external view returns (bool);\n function setAdminConfig(bool pauseShares, bool pauseLoot) external;\n function setGovernanceConfig(bytes memory governanceConfig) external;\n\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable returns (uint256);\n function sponsorProposal(uint32 id) external;\n function processProposal(uint32 id, bytes calldata proposalData) external;\n function cancelProposal(uint32 id) external;\n function getProposalStatus(uint32 id) external returns (bool[4] memory);\n function submitVote(uint32 id, bool approved) external;\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function executeAsBaal(address to, uint256 value, bytes calldata data) external;\n function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] calldata tokens) external;\n\n function hashOperation(bytes memory transactions) external pure returns (bytes32);\n function encodeMultisend(bytes[] memory calls, address target) external pure returns (bytes memory);\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n}\n" + }, + "contracts/LootERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract Loot is\n ERC20SnapshotUpgradeable,\n ERC20PermitUpgradeable,\n PausableUpgradeable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure loot - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"loot: name empty\");\n require(bytes(symbol_).length != 0, \"loot: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to pause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Baal-only function to mint loot.\n /// @param recipient Address to receive loot\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"loot: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn loot.\n /// @param account Address to lose loot\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `loot` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(ERC20Upgradeable, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"loot: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/BaalLessToken.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../utils/BaalVotes.sol\";\nimport \"../interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract BaalLessShares is BaalVotes, OwnableUpgradeable, UUPSUpgradeable {\n // Baal Config\n IBaal public baal;\n uint8 public version;\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @param _version new version\n function setUp(uint8 _version)\n external\n reinitializer(_version)\n {\n baal = IBaal(address(0)); /*Configure Baal to setup sender*/\n version = _version;\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n\n /// @notice owner-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n unchecked {\n if (totalSupply() + amount <= type(uint256).max / 2) {\n _mint(recipient, amount);\n }\n }\n }\n\n /// @notice owner-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice new before transfer\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes) {\n super._beforeTokenTransfer(from, to, amount);\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/mock/MockBaal.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\n\nimport \"../Baal.sol\";\n\ncontract MockBaal {\n bool public lootPaused;\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n\n constructor(\n address payable _lootSingleton,\n string memory _name,\n string memory _symbol\n ) {\n /*Clone loot singleton using EIP1167 minimal proxy pattern*/\n lootToken = IBaalToken(Clones.clone(_lootSingleton));\n lootToken.setUp(\n string(abi.encodePacked(_name, \" LOOT\")),\n string(abi.encodePacked(_symbol, \"-LOOT\"))\n );\n }\n\n function setLootPaused(bool paused) external {\n if(!lootToken.paused() && paused){\n lootToken.pause();\n } else if(lootToken.paused() && !paused){\n lootToken.unpause();\n }\n lootPaused = paused;\n }\n\n function mintLoot(address _to, uint256 _amount) external {\n lootToken.mint(_to, _amount);\n }\n\n function burnLoot(address _from, uint256 _amount) external {\n lootToken.burn(_from, _amount);\n }\n}\n" + }, + "contracts/mock/TestAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity 0.8.7;\n\ncontract Enum {\n enum Operation {\n Call,\n DelegateCall\n }\n}\n\ncontract TestAvatar {\n address public module;\n\n receive() external payable {}\n\n function enableModule(address _module) external {\n module = _module;\n }\n\n function disableModule(address, address) external {\n module = address(0);\n }\n\n function isModuleEnabled(address _module) external view returns (bool) {\n if (module == _module) {\n return true;\n } else {\n return false;\n }\n }\n\n function execTransactionFromModule(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, ) = to.call{value: value}(data);\n }\n\n function execTransactionFromModuleReturnData(\n address payable to,\n uint256 value,\n bytes calldata data,\n uint8 operation\n ) external returns (bool success, bytes memory returnData) {\n require(msg.sender == module, \"Not authorized\");\n if (operation == 1) (success, ) = to.delegatecall(data);\n else (success, returnData) = to.call{value: value}(data);\n }\n\n function getModulesPaginated(address, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next)\n {\n // Init array with max page size\n array = new address[](pageSize);\n\n array[0] = module;\n next = module;\n }\n}\n" + }, + "contracts/mock/TestERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\n/// @notice Basic ERC20 implementation.\ncontract TestERC20 {\n string public name;\n string public symbol;\n uint8 public constant decimals = 18;\n uint256 public totalSupply;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 amount);\n event Approval(address indexed owner, address indexed spender, uint256 amount);\n\n constructor(string memory _name, string memory _symbol, uint256 _totalSupply) {\n name = _name;\n symbol = _symbol;\n totalSupply = _totalSupply;\n balanceOf[msg.sender] = _totalSupply;\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function approve(address to, uint256 amount) external returns (bool) {\n allowance[msg.sender][to] = amount;\n emit Approval(msg.sender, to, amount);\n return true;\n }\n\n function transfer(address to, uint256 amount) external returns (bool) {\n balanceOf[msg.sender] -= amount;\n balanceOf[to] += amount;\n emit Transfer(msg.sender, to, amount);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max)\n allowance[from][msg.sender] -= amount;\n\n balanceOf[from] -= amount;\n balanceOf[to] += amount;\n emit Transfer(from, to, amount);\n return true;\n }\n}\n" + }, + "contracts/SharesERC20.sol": { + "content": "pragma solidity 0.8.7;\n//SPDX-License-Identifier: MIT\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20SnapshotUpgradeable.sol\";\n\nimport \"./utils/BaalVotes.sol\";\nimport \"./interfaces/IBaal.sol\";\n\n// import \"hardhat/console.sol\";\n\n/// @title Shares\n/// @notice Accounting for Baal non voting shares\ncontract Shares is BaalVotes, ERC20SnapshotUpgradeable, OwnableUpgradeable, PausableUpgradeable, UUPSUpgradeable {\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Configure shares - called by Baal on summon\n /// @dev initializer should prevent this from being called again\n /// @param name_ Name for ERC20 token trackers\n /// @param symbol_ Symbol for ERC20 token trackers\n function setUp(string memory name_, string memory symbol_)\n external\n initializer\n {\n require(bytes(name_).length != 0, \"shares: name empty\");\n require(bytes(symbol_).length != 0, \"shares: symbol empty\");\n\n __ERC20_init(name_, symbol_);\n __ERC20Permit_init(name_);\n __Pausable_init();\n __ERC20Snapshot_init();\n __Ownable_init();\n __UUPSUpgradeable_init();\n __EIP712_init_delegation(\"delegation\", \"4\");\n\n\n }\n\n /// @notice Baal-only function to pause shares.\n function pause() public onlyOwner {\n _pause();\n }\n\n /// @notice Baal-only function to unpause shares.\n function unpause() public onlyOwner {\n _unpause();\n }\n\n /// @notice Allows baal to create a snapshot\n function snapshot() external onlyOwner returns(uint256) {\n return _snapshot();\n }\n\n /// @notice get current SnapshotId\n function getCurrentSnapshotId() external view returns (uint256) {\n return _getCurrentSnapshotId();\n }\n\n /// @notice Baal-only function to mint shares.\n /// @param recipient Address to receive shares\n /// @param amount Amount to mint\n function mint(address recipient, uint256 amount) external onlyOwner {\n // can not be more than half the max because of totalsupply of loot and shares\n require(totalSupply() + amount <= type(uint256).max / 2, \"shares: cap exceeded\");\n _mint(recipient, amount);\n }\n\n /// @notice Baal-only function to burn shares.\n /// @param account Address to lose shares\n /// @param amount Amount to burn\n function burn(address account, uint256 amount) external onlyOwner {\n _burn(account, amount);\n }\n\n /// @notice Internal hook to restrict token transfers unless allowed by baal\n /// @dev Allows transfers if msg.sender is Baal which enables minting and burning\n /// @param from The address of the source account.\n /// @param to The address of the destination account.\n /// @param amount The number of `shares` tokens to transfer.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(BaalVotes, ERC20SnapshotUpgradeable) {\n super._beforeTokenTransfer(from, to, amount);\n require(\n from == address(0) || /*Minting allowed*/\n (msg.sender == owner() && to == address(0)) || /*Burning by Baal allowed*/\n !paused(),\n \"shares: !transferable\"\n );\n }\n\n function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}\n}\n" + }, + "contracts/tools/TributeMinion.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"../Baal.sol\";\n\ninterface IERC20 {\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool);\n}\n\ncontract TributeMinion {\n event TributeProposal(\n address indexed baal,\n address token,\n uint256 amount,\n address recipient,\n uint256 proposalId\n );\n struct Escrow {\n address token;\n address applicant;\n uint256 amount;\n bool released;\n address safe;\n }\n mapping(address => mapping(uint256 => Escrow)) public escrows;\n\n event EscrowReleased(\n address indexed baal,\n uint32 proposalId,\n address applicant,\n address safe,\n uint256 amount\n );\n\n function encodeTributeProposal(\n address baal,\n uint256 shares,\n uint256 loot,\n address recipient,\n uint32 proposalId,\n address escrow\n ) public pure returns (bytes memory) {\n // Workaround for solidity dynamic memory array\n address[] memory _recipients = new address[](1);\n _recipients[0] = recipient;\n\n bytes memory _releaseEscrow = abi.encodeWithSignature(\n \"releaseEscrow(address,uint32)\",\n baal,\n proposalId\n );\n\n bytes memory tributeMultisend = abi.encodePacked(\n uint8(0),\n escrow,\n uint256(0),\n uint256(_releaseEscrow.length),\n bytes(_releaseEscrow)\n );\n\n if (shares > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _shares = new uint256[](1);\n _shares[0] = shares;\n\n bytes memory _issueShares = abi.encodeWithSignature(\n \"mintShares(address[],uint256[])\",\n _recipients,\n _shares\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n baal,\n uint256(0),\n uint256(_issueShares.length),\n bytes(_issueShares)\n );\n }\n if (loot > 0) {\n // Workaround for solidity dynamic memory array\n uint256[] memory _loot = new uint256[](1);\n _loot[0] = loot;\n\n bytes memory _issueLoot = abi.encodeWithSignature(\n \"mintLoot(address[],uint256[])\",\n _recipients,\n _loot\n );\n\n tributeMultisend = abi.encodePacked(\n tributeMultisend,\n uint8(0),\n address(baal),\n uint256(0),\n uint256(_issueLoot.length),\n bytes(_issueLoot)\n );\n }\n\n bytes memory _multisendAction = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n tributeMultisend\n );\n return _multisendAction;\n }\n\n function submitTributeProposal(\n Baal baal,\n address token,\n uint256 amount,\n uint256 shares,\n uint256 loot,\n uint32 expiration,\n uint256 baalgas,\n string memory details\n ) external payable {\n uint32 proposalId = baal.proposalCount() + 1;\n\n bytes memory encodedProposal = encodeTributeProposal(\n address(baal),\n shares,\n loot,\n msg.sender,\n proposalId,\n address(this)\n );\n\n escrows[address(baal)][proposalId] = Escrow(\n token,\n msg.sender,\n amount,\n false,\n baal.target()\n );\n\n baal.submitProposal{value:msg.value}(encodedProposal, expiration, baalgas, details);\n\n emit TributeProposal(\n address(baal),\n token,\n amount,\n msg.sender,\n proposalId\n );\n }\n\n function releaseEscrow(address _baal, uint32 _proposalId) external {\n Baal baal = Baal(_baal);\n Escrow storage escrow = escrows[address(baal)][_proposalId];\n require(!escrow.released, \"Already released\");\n\n bool[4] memory status = baal.getProposalStatus(_proposalId);\n require(status[2], \"Not passed\");\n escrow.released = true;\n\n IERC20 token = IERC20(escrow.token);\n\n emit EscrowReleased(\n _baal,\n _proposalId,\n escrow.applicant,\n escrow.safe,\n escrow.amount\n );\n\n require(\n token.transferFrom(escrow.applicant, escrow.safe, escrow.amount),\n \"Transfer failed\"\n );\n }\n}\n" + }, + "contracts/utils/BaalVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol\";\nimport \"./DelegationEIP712Upgradeable.sol\";\n\n/**\n * @dev similar to Openzeplin ERC20Votes\n *\n * uses timestamp instead of block.number and auto self delegates.\n *\n * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either\n * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting\n * power can be queried through the public accessors {getPriorVotes}.\n *\n */\nabstract contract BaalVotes is ERC20PermitUpgradeable, DelegationEIP712Upgradeable {\n using ECDSAUpgradeable for bytes32;\n\n struct Checkpoint {\n /*Baal checkpoint for marking number of delegated votes*/\n uint32 fromTimePoint; /*unix time for referencing voting balance*/\n uint256 votes; /*votes at given unix time*/\n }\n\n // DELEGATE TRACKING\n mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /*maps record of vote `checkpoints` for each account by index*/\n mapping(address => uint256) public numCheckpoints; /*maps number of `checkpoints` for each account*/\n mapping(address => address) public delegates; /*maps record of each account's `shares` delegate*/\n mapping(address => uint256) public delegationNonces; /*nonces for delegating by signature*/\n\n // SIGNATURE HELPERS\n bytes32 constant DELEGATION_TYPEHASH = keccak256(\"Delegation(string name,address delegatee,uint256 nonce,uint256 expiry)\");\n\n event DelegateChanged(\n address indexed delegator,\n address indexed fromDelegate,\n address indexed toDelegate\n ); /*emits when an account changes its voting delegate*/\n event DelegateVotesChanged(\n address indexed delegate,\n uint256 previousBalance,\n uint256 newBalance\n ); /*emits when a delegate account's voting balance changes*/\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n super._beforeTokenTransfer(from, to, amount);\n\n /*If recipient is receiving their first shares, auto-self delegate*/\n if (balanceOf(to) == 0 && numCheckpoints[to] == 0 && amount > 0) {\n delegates[to] = to;\n }\n\n _moveDelegates(delegates[from], delegates[to], amount);\n }\n\n /// @notice Delegate votes from user to `delegatee`.\n /// @param delegatee The address to delegate votes to.\n function delegate(address delegatee) external virtual {\n _delegate(msg.sender, delegatee);\n }\n\n /// @notice Delegates votes from `signer` to `delegatee` with EIP-712 signature.\n /// @param delegatee The address to delegate 'votes' to.\n /// @param nonce The contract state required to match the signature.\n /// @param expiry The time at which to expire the signature.\n /// @param v The v signature\n /// @param r The r signature\n /// @param s The s signature\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public {\n require(now() <= expiry, \"ERC20Votes: signature expired\");\n address signer = ECDSAUpgradeable.recover(\n _hashTypedDataV4Delegation(\n keccak256(\n abi.encode(\n DELEGATION_TYPEHASH,\n keccak256(abi.encodePacked(name())),\n delegatee,\n nonce,\n expiry\n )\n )\n ),\n v,\n r,\n s\n );\n require(signer != address(0), \"ERC20Votes: invalid signer (0x0)\");\n require(nonce == delegationNonces[signer], \"ERC20Votes: invalid nonce\");\n\n delegationNonces[signer]++;\n _delegate(signer, delegatee);\n }\n\n /// @notice Delegates Baal voting weight.\n /// @param delegator The address to delegate 'votes' from.\n /// @param delegatee The address to delegate 'votes' to.\n function _delegate(address delegator, address delegatee) internal virtual {\n require(balanceOf(delegator) > 0, \"!shares\");\n address currentDelegate = delegates[delegator];\n delegates[delegator] = delegatee;\n\n _moveDelegates(\n currentDelegate,\n delegatee,\n uint256(balanceOf(delegator))\n );\n\n emit DelegateChanged(delegator, currentDelegate, delegatee);\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param srcRep The address to delegate 'votes' from.\n /// @param dstRep The address to delegate 'votes' to.\n /// @param amount The amount of votes to delegate\n function _moveDelegates(\n address srcRep,\n address dstRep,\n uint256 amount\n ) private {\n unchecked {\n if (srcRep != dstRep && amount != 0) {\n if (srcRep != address(0)) {\n uint256 srcRepNum = numCheckpoints[srcRep];\n uint256 srcRepOld = srcRepNum != 0\n ? getCheckpoint(srcRep, srcRepNum - 1).votes\n : 0;\n uint256 srcRepNew = srcRepOld - amount;\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\n }\n\n if (dstRep != address(0)) {\n uint256 dstRepNum = numCheckpoints[dstRep];\n uint256 dstRepOld = dstRepNum != 0\n ? getCheckpoint(dstRep, dstRepNum - 1).votes\n : 0;\n uint256 dstRepNew = dstRepOld + amount;\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\n }\n }\n }\n }\n\n /// @notice Elaborates delegate update - cf., 'Compound Governance'.\n /// @param delegatee The address to snapshot\n /// @param nCheckpoints The number of checkpoints delegatee has\n /// @param oldVotes The number of votes the delegatee had\n /// @param newVotes The number of votes the delegate has now\n function _writeCheckpoint(\n address delegatee,\n uint256 nCheckpoints,\n uint256 oldVotes,\n uint256 newVotes\n ) private {\n uint32 timePoint = uint32(now());\n\n unchecked {\n if (\n nCheckpoints != 0 &&\n checkpoints[delegatee][nCheckpoints - 1].fromTimePoint == timePoint\n ) {\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\n } else {\n checkpoints[delegatee][nCheckpoints] = Checkpoint(\n timePoint,\n newVotes\n );\n numCheckpoints[delegatee] = nCheckpoints + 1;\n }\n }\n\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\n }\n\n /// @notice Returns the current timepoint.\n /// @return timePoint returns unix epoch timestamp\n function now() public view returns (uint256 timePoint) {\n return block.timestamp;\n }\n\n /// @notice Returns the prior number of `votes` for `account` as of `timePoint`.\n /// @param account The user to check `votes` for.\n /// @param timePoint The unix time to check `votes` for.\n /// @return votes Past `votes` delegated to `account`.\n function getPastVotes(address account, uint256 timePoint)\n external\n view\n virtual\n returns (uint256 votes)\n {\n require(timePoint < now(), \"!determined\"); /* Prior votes must be in the past*/\n\n uint256 nCheckpoints = numCheckpoints[account];\n if (nCheckpoints == 0) return 0;\n\n unchecked {\n if (\n getCheckpoint(account, nCheckpoints - 1).fromTimePoint <=\n timePoint\n ) return getCheckpoint(account, nCheckpoints - 1).votes; /* If most recent checkpoint is at or after desired timepoint, return*/\n if (getCheckpoint(account, 0).fromTimePoint > timePoint) return 0;\n uint256 lower = 0;\n uint256 upper = nCheckpoints - 1;\n while (upper > lower) {\n /* Binary search to look for highest timePoint before desired timePoint*/\n uint256 center = upper - (upper - lower) / 2;\n Checkpoint memory cp = getCheckpoint(account, center);\n if (cp.fromTimePoint == timePoint) return cp.votes;\n else if (cp.fromTimePoint < timePoint) lower = center;\n else upper = center - 1;\n }\n votes = getCheckpoint(account, lower).votes;\n }\n }\n\n /// @notice Returns the current delegated `vote` balance for `account`.\n /// @param account The user to check delegated `votes` for.\n /// @return votes Current `votes` delegated to `account`.\n function getVotes(address account)\n external\n view\n virtual\n returns (uint256 votes)\n {\n uint256 nCheckpoints = numCheckpoints[account]; /*Get most recent checkpoint, or 0 if no checkpoints*/\n unchecked {\n votes = nCheckpoints != 0\n ? getCheckpoint(account, nCheckpoints - 1).votes\n : 0;\n }\n }\n\n function getCheckpoint(address delegatee, uint256 nCheckpoints)\n public\n view\n virtual\n returns (Checkpoint memory)\n {\n return checkpoints[delegatee][nCheckpoints];\n }\n}\n" + }, + "contracts/utils/DelegationEIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4Delegation}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4Delegation}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract DelegationEIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME_DELEGATION;\n bytes32 private _HASHED_VERSION_DELEGATION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init_delegation(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained_delegation(name, version);\n }\n\n function __EIP712_init_unchained_delegation(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME_DELEGATION = hashedName;\n _HASHED_VERSION_DELEGATION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4Delegation() internal view returns (bytes32) {\n return _buildDomainSeparatorDelegation(_TYPE_HASH, _EIP712NameHashDelegation(), _EIP712VersionHashDelegation());\n }\n\n function _buildDomainSeparatorDelegation(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4Delegation(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4Delegation(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4Delegation(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_NAME_DELEGATION;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHashDelegation() internal virtual view returns (bytes32) {\n return _HASHED_VERSION_DELEGATION;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "contracts/utils/Poster.sol": { + "content": "/*\n██████╗ ██████╗ ███████╗████████╗███████╗██████╗\n██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗\n██████╔╝██║ ██║███████╗ ██║ █████╗ ██████╔╝\n██╔═══╝ ██║ ██║╚════██║ ██║ ██╔══╝ ██╔══██╗\n██║ ╚██████╔╝███████║ ██║ ███████╗██║ ██║\n╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝\nA ridiculously simple general purpose social media smart contract.\nIt takes two strings (content and tag) as parameters and emits those strings, along with msg.sender, as an event. That's it.\nMade with ❤️ by Auryn.eth\n*/\n// SPDX-License-Identifier: LGPL-3.0-only\n\npragma solidity 0.8.7;\n\ncontract Poster {\n event NewPost(address indexed user, string content, string indexed tag);\n\n function post(string calldata content, string calldata tag) external {\n emit NewPost(msg.sender, content, tag);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/lib/Baal/hardhat.config.ts b/lib/Baal/hardhat.config.ts new file mode 100644 index 0000000..6c4427d --- /dev/null +++ b/lib/Baal/hardhat.config.ts @@ -0,0 +1,292 @@ +import dotenv from "dotenv"; +import * as fs from "fs"; +import { HardhatUserConfig } from "hardhat/config"; +import "@nomicfoundation/hardhat-toolbox"; +// import "@openzeppelin/hardhat-upgrades"; +import "solidity-coverage"; +import "hardhat-contract-sizer"; +import "hardhat-abi-exporter"; +import "hardhat-deploy"; + +import "./tasks/setup"; + +dotenv.config(); + +/* + when compiled contracts do not exist, + importing "tasks/setup" will fail the compile task itself. + + this is a circular dependency that exists on the tasks themselves. + + conditionally loading tasks if the artifacts folder exists + allows the config to skip the first compile. +*/ +// if (fs.existsSync("./artifacts")) { +// import("./tasks/setup"); +// } + +// You need to export an object to set up your config +// Go to https://hardhat.org/config/ to learn more + +const defaultNetwork = "localhost"; + +const infuraKey = () => { + return process.env.INFURA_API_KEY || '' // <---- YOUR INFURA ID! (or it won't work) +}; + +const mnemonic = () => { + try { + return process.env.MNEMONIC || fs.readFileSync("./mnemonic.txt").toString().trim(); + } catch (e) { + if (defaultNetwork !== "localhost") { + console.log( + "☢️ WARNING: No mnemonic file created for a deploy account. Try `yarn run generate` and then `yarn run account`." + ); + } + } + return ""; +} + +const explorerApiKey = (networkName: string) => { + const fromEnv = () => { + switch (networkName) { + case "ethereum": + return process.env.ETHERSCAN_API_KEY; + case "gnosis": + return process.env.GNOSISSCAN_API_KEY; + case "polygon": + return process.env.POLYGONSCAN_API_KEY; + case "optimism": + return process.env.OPTIMISTICSCAN_API_KEY; + case "arbitrumOne": + return process.env.ARBISCAN_API_KEY; + case "base": + return process.env.BASESCAN_API_KEY; + default: + break; + } + } + return fromEnv() || ''; +} + +const config: HardhatUserConfig = { + networks: { + localhost: { + url: "http://localhost:8545", + /* + notice no mnemonic here? it will just use account 0 of the hardhat node to deploy + (you can put in a mnemonic here to set the deployer locally) + */ + }, + mainnet: { + url: `https://mainnet.infura.io/v3/${infuraKey()}`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('ethereum'), + }, + }, + }, + goerli: { + url: `https://goerli.infura.io/v3/${infuraKey()}`, + // gas: 5000000, + // gasPrice: 100000000000, + // gasMultiplier: 2, + accounts: process.env.ACCOUNT_PK + ? [process.env.ACCOUNT_PK] + : { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('ethereum'), + }, + }, + }, + sepolia: { + url: `https://sepolia.infura.io/v3/${infuraKey()}`, + // gas: 5000000, + // gasPrice: 100000000000, + // gasMultiplier: 2, + accounts: process.env.ACCOUNT_PK + ? [process.env.ACCOUNT_PK] + : { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('ethereum'), + }, + }, + }, + xdai: { + url: "https://rpc.gnosischain.com/", + gas: 5000000, + gasPrice: 8000000000, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('gnosis'), + }, + } + }, + gnosis: { + url: "https://rpc.gnosischain.com/", + gas: 5000000, + gasPrice: 8000000000, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('gnosis'), + }, + }, + }, + polygon: { + url: `https://polygon-mainnet.infura.io/v3/${infuraKey()}`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('polygon'), + }, + }, + }, + polygonMumbai: { + url: `https://polygon-mumbai.infura.io/v3/${infuraKey()}`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('polygon'), + }, + }, + }, + arbitrumOne: { + url: `https://arbitrum-mainnet.infura.io/v3/${infuraKey()}`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('arbitrumOne'), + }, + }, + }, + optimisticEthereum: { + url: `https://optimism-mainnet.infura.io/v3/${infuraKey()}`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('optimism'), + }, + }, + }, + base: { + url: `https://mainnet.base.org`, + accounts: { + mnemonic: mnemonic(), + }, + verify: { + etherscan: { + apiKey: explorerApiKey('base'), + }, + }, + }, + }, + etherscan: { + // Your API key for Etherscan + // Obtain one at https://etherscan.io/ + // apiKey: "61ED96HQAY6PASTEWRXN6AMYQEKM8SYTRY" // etherscan + apiKey: { + gnosis: explorerApiKey('gnosis'), + xdai: explorerApiKey('gnosis'), + goerli: explorerApiKey('ethereum'), + mainnet: explorerApiKey('ethereum'), + polygon: explorerApiKey('polygon'), + polygonMumbai: explorerApiKey('polygon'), + arbitrumOne: explorerApiKey('arbitrumOne'), + optimisticEthereum: explorerApiKey('optimism'), + base: explorerApiKey('base'), + }, + customChains: [ + { + network: "gnosis", + chainId: 100, + urls: { + apiURL: "https://api.gnosisscan.io/api", + browserURL: "https://gnosisscan.io/", + }, + }, + { + network: "base", + chainId: 8453, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org", + } + }, + ] + }, + solidity: { + compilers: [ + { + version: "0.8.7", + settings: { + optimizer: { + enabled: true, + runs: 200, + // coverage only + // details: { + // yul: true + // }, + }, + }, + }, + { + version: "0.8.10", + settings: { + optimizer: { + enabled: true, + runs: 200, + // coverage only + // details: { + // yul: true + // }, + }, + }, + } + ], + }, + namedAccounts: { + deployer: 0, + }, + abiExporter: { + path: './abi', + clear: true, + flat: true, + except: ['@gnosis.pm', '@openzeppelin'], + }, + typechain: { + outDir: "src/types", + target: "ethers-v5", + }, + gasReporter: { + currency: "USD", + enabled: process.env.REPORT_GAS === 'true', + excludeContracts: [], + src: "./contracts", + coinmarketcap: process.env.COINMARKETCAP_API_KEY, + }, +}; + +export default config; diff --git a/lib/Baal/package.json b/lib/Baal/package.json new file mode 100644 index 0000000..35d7315 --- /dev/null +++ b/lib/Baal/package.json @@ -0,0 +1,90 @@ +{ + "name": "@daohaus/baal-contracts", + "version": "1.2.18", + "description": "Lo, also it is the time of His rain.", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "exports": { + ".": "./dist/src/index.js", + "./hardhat": "./dist/src/hardhat/index.js" + }, + "typesVersions": { + "*": { + "hardhat": [ + "./dist/src/hardhat/index.d.ts" + ] + } + }, + "lockfileVersion": 2, + "files": [ + "/contracts/**/*.sol", + "/abi/*.json", + "/dist/**/*.js", + "/dist/**/*.ts", + "/export/artifacts/**/*.json", + "/export/deploy/*.js", + "/export/src/**/*.js", + "README.md", + "LICENSE", + "package.json" + ], + "scripts": { + "test": "hardhat test --network hardhat", + "export-deploy": "tsc -p tsconfig.deploy.json && hardhat export-artifacts export/artifacts", + "build": "rm -Rf dist && yarn build:sol && yarn build:abi && yarn build:ts && yarn export-deploy", + "build:test": "yarn build:sol && yarn build:ts", + "build:ts": "tsc --build tsconfig.build.json", + "build:abi": "yarn hardhat export-abi", + "build:sol": "yarn hardhat compile --force", + "build:declarations": "shx cp src/types/*.d.ts dist/src/types" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/HausDAO/Baal.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/HausDAO/Baal/issues" + }, + "homepage": "https://github.com/HausDAO/Baal#readme", + "devDependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@gnosis.pm/safe-contracts": "^1.3.0", + "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", + "@nomicfoundation/hardhat-foundry": "^1.1.1", + "@nomicfoundation/hardhat-network-helpers": "^1.0.10", + "@nomicfoundation/hardhat-toolbox": "^2.0.2", + "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers", + "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@openzeppelin/hardhat-upgrades": "^3.0.2", + "@typechain/ethers-v5": "^10.2.0", + "@typechain/hardhat": "^6.1.5", + "@types/chai": "^4.2.18", + "@types/mocha": "^8.2.2", + "@types/node": "^15.12.2", + "chai": "^4.3.7", + "chai-as-promised": "^7.1.1", + "dotenv": "^16.0.3", + "ethers": "^5.7.1", + "hardhat": "2.22.3", + "hardhat-abi-exporter": "^2.10.0", + "hardhat-contract-sizer": "^2.10.0", + "hardhat-deploy": "^0.12.1", + "hardhat-gas-reporter": "^1.0.9", + "shx": "^0.3.4", + "solidity-coverage": "^0.8.6", + "ts-node": "^10.0.0", + "typechain": "^8.1.1", + "typescript": "^4.3.2" + }, + "dependencies": { + "@gnosis.pm/zodiac": "^3.3.7", + "@opengsn/contracts": "2.2.5", + "@openzeppelin/contracts": "4.8.3", + "@openzeppelin/contracts-upgradeable": "4.8.3", + "safe-deployments": "^1.26.0" + } +} diff --git a/lib/Baal/scripts/deploy.js b/lib/Baal/scripts/deploy.js new file mode 100644 index 0000000..dcc60e9 --- /dev/null +++ b/lib/Baal/scripts/deploy.js @@ -0,0 +1,65 @@ +const { ethers } = require('hardhat'); + +// Test Deploy Values + +// const _guildTokens = { +// 4: ['0x992e3005bb7a9efb9bff427f629bcb32fb61f706'], +// 1: ['0x6b175474e89094c44da98b954eedeac495271d0f'], +// 137: ['0xdd185af1bb417469461edbc95f22df9781a04624'] +// } + +const _shamans = { + 4: [''], + 1: [''], + 137: [''] +} + +const _shares = ['1']; +const _loot = ['1']; +const _minVoting = 60; +const _maxVoting = 600; +const _proposalOffering = 1; +const _name = "TestBaal"; +const _symbol = "BAALTO"; + +const networkName = { + 4: 'Rinkeby', + 1: 'mainnet', + 137: 'matic' +}; + +const networkCurrency = { + 4: 'ETH', + 1: 'ETH', + 137: 'matic' +}; + +async function main() { + const [deployer] = await ethers.getSigners(); + const address = await deployer.getAddress(); + const { chainId } = await deployer.provider.getNetwork(); + console.log('Summoning a Baal on network:', networkName[chainId]); + console.log('Account address:', address); + console.log( + 'Account balance:', + ethers.utils.formatEther(await deployer.provider.getBalance(address)), + networkCurrency[chainId] + ); + + // const BaalFactory = await ethers.getContractFactory('Baal') + // const baalSingleton = (await BaalFactory.deploy()) + // await baalSingleton.deployed(); + + // const txHash = baalSingleton.deployTransaction.hash; + // const receipt = await deployer.provider.getTransactionReceipt(txHash); + // console.log('Transaction Hash:', txHash); + // console.log('Contract Address:', baalSingleton.address); + // console.log('Block Number:', receipt.blockNumber); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/lib/Baal/scripts/deployFactories.js b/lib/Baal/scripts/deployFactories.js new file mode 100644 index 0000000..a34e817 --- /dev/null +++ b/lib/Baal/scripts/deployFactories.js @@ -0,0 +1,169 @@ +const { ethers, upgrades } = require('hardhat'); + +const _shamans = { + 4: [''], + 1: [''], + 137: [''], + 42: [''], + 100: [''], +} + +// same default for all networks, but different sometimes +// https://github.com/gnosis/zodiac/blob/master/src/factory/constants.ts#L20 +// https://github.com/safe-global/safe-deployments/tree/main/src/assets +// moduleProxyFactory https://github.com/gnosis/zodiac/blob/master/src/factory/constants.ts#L21 +const _addresses = { + gnosisSingleton: "0xd9db270c1b5e3bd161e8c8503c55ceabee709552", + gnosisFallbackLibrary: "0xf48f2b2d2a534e402487b3ee7c18c33aec0fe5e4", + gnosisMultisendLibrary: "0xa238cbeb142c10ef7ad8442c6d1f9e89e07e7761", + poster: "0x000000000000cd17345801aa8147b8D3950260FF", + gnosisSafeProxyFactory: "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", + moduleProxyFactory: "0x00000000000DC7F163742Eb4aBEf650037b1f588", + DAO: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315" // Change to Daohaus protocol zodiac baal avatar + } + + // optimism + // Safe singleton: 0x69f4D1788e39c87893C980c06EdF4b7f686e2938 + // fall back: 0x017062a1dE2FE6b99BE3d9d37841FeD19F573804 + // multisend: 0x998739BFdAAdde7C933B942a68053933098f9EDa + // GnosisSafeProxyFactory: 0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC + // DAO: "0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4" + + + +const _shares = ['1']; +const _loot = ['1']; +const _minVoting = 60; +const _maxVoting = 600; +const _proposalOffering = 1; +const _name = "TestBaal"; +const _symbol = "BAALTO"; + +const networkName = { + 4: 'Rinkeby', + 5: 'Goerli', + 1: 'mainnet', + 137: 'matic', + 42: 'kovan', + 100: 'gnosis', + 42161: 'arbitrum', + 10: 'optimism' +}; + +const networkCurrency = { + 4: 'ETH', + 5: 'ETH', + 1: 'ETH', + 137: 'matic', + 42: 'ETH', + 100: 'xDai', + 42161: 'ETH', + 10: 'ETH' +}; + +async function main() { + + const [deployer] = await ethers.getSigners(); + const address = await deployer.getAddress(); + const { chainId } = await deployer.provider.getNetwork(); + console.log('Summoning Baal factories on network:', networkName[chainId]); + console.log('Account address:', address); + console.log( + 'Account balance:', + ethers.utils.formatEther(await deployer.provider.getBalance(address)), + networkCurrency[chainId] + ); + + // const tx = await deployer.sendTransaction({ + // to:_addresses.DAO, + // value: ethers.utils.parseEther("0.3") + // } + // ) + + // console.log('return funds', tx); + + console.log('start deploy'); + + const LootFactory = await ethers.getContractFactory('Loot') + const lootSingleton = (await LootFactory.deploy()) + console.log('loot waiting'); + await lootSingleton.deployed(); + console.log('loot deploy'); + console.log('lootSingleton',lootSingleton.address) + const SharesFactory = await ethers.getContractFactory('Shares') + const sharesSingleton = (await SharesFactory.deploy()) + await sharesSingleton.deployed(); + console.log('shares deploy'); + console.log('sharesSingleton',sharesSingleton.address) + + const BaalFactory = await ethers.getContractFactory('Baal') + const baalSingleton = (await BaalFactory.deploy()) + await baalSingleton.deployed(); + + console.log('baalSingleton',baalSingleton.address) + console.log('baal deploy'); + + const BaalSummoner = await ethers.getContractFactory('BaalSummoner') + const BaalAndVaultSummoner = await ethers.getContractFactory('BaalAndVaultSummoner') + + + // deploy proxy upgrades + baalSummoner = await upgrades.deployProxy(BaalSummoner); + await baalSummoner.deployed(); + console.log('Factory Contract Address:', baalSummoner.address); + console.log('imp:', await upgrades.erc1967.getImplementationAddress(baalSummoner.address)); + // set addresses of templates and libraries + await baalSummoner.setAddrs( + baalSingleton.address, + _addresses.gnosisSingleton, + _addresses.gnosisFallbackLibrary, + _addresses.gnosisMultisendLibrary, + _addresses.gnosisSafeProxyFactory, + _addresses.moduleProxyFactory, + lootSingleton.address, + sharesSingleton.address + ); + + // transfer ownership to DAO + if(_addresses.DAO=="0x0000000000000000000000000000000000000000"){ + console.log("You need to transfer ownership of summoner"); + } else { + console.log("transffering ownership too: ", _addresses.DAO); + await baalSummoner.transferOwnership(_addresses.DAO); + } + + + const txHash = baalSummoner.deployTransaction.hash; + const receipt = await deployer.provider.getTransactionReceipt(txHash); + console.log('Transaction Hash:', txHash); + console.log('Block Number:', receipt.blockNumber); + + // deploy vault factory proxy upgrades + baalAndVaultSummoner = await upgrades.deployProxy(BaalAndVaultSummoner); + await baalAndVaultSummoner.deployed(); + console.log('Vault Factory Contract Address:', baalAndVaultSummoner.address); + console.log('Vault imp:', await upgrades.erc1967.getImplementationAddress(baalAndVaultSummoner.address)); + + await baalAndVaultSummoner.setSummonerAddr(baalSummoner.address); + if(_addresses.DAO=="0x0000000000000000000000000000000000000000"){ + console.log("You need to transfer ownership of vault registery"); + } else { + console.log("transffering ownership of vault summoner too: ", _addresses.DAO); + await baalAndVaultSummoner.transferOwnership(_addresses.DAO); + } + + const vaulTxHash = baalSummoner.deployTransaction.hash; + const vaultReceipt = await deployer.provider.getTransactionReceipt(txHash); + console.log('Transaction Hash:', vaulTxHash); + console.log('Block Number:', vaultReceipt.blockNumber); + + + } + + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/lib/Baal/scripts/deployHOFactory.js b/lib/Baal/scripts/deployHOFactory.js new file mode 100644 index 0000000..7d748e6 --- /dev/null +++ b/lib/Baal/scripts/deployHOFactory.js @@ -0,0 +1,129 @@ +const { ethers, upgrades } = require('hardhat'); +const { deployments } = require('../src/addresses/deployed'); + +const _shamans = { + 4: [''], + 1: [''], + 137: [''], + 42: [''], + 100: [''], +} + +// same default for all networks, but different sometimes +// https://github.com/gnosis/zodiac/blob/master/src/factory/constants.ts#L20 +// https://github.com/safe-global/safe-deployments/tree/main/src/assets +// moduleProxyFactory https://github.com/gnosis/zodiac/blob/master/src/factory/constants.ts#L21 +const _addresses = { + gnosisSingleton: "0xd9db270c1b5e3bd161e8c8503c55ceabee709552", + gnosisFallbackLibrary: "0xf48f2b2d2a534e402487b3ee7c18c33aec0fe5e4", + gnosisMultisendLibrary: "0xa238cbeb142c10ef7ad8442c6d1f9e89e07e7761", + poster: "0x000000000000cd17345801aa8147b8D3950260FF", + gnosisSafeProxyFactory: "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2", + moduleProxyFactory: "0x00000000000DC7F163742Eb4aBEf650037b1f588", + DAO: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315" // Change to Daohaus protocol zodiac baal avatar + } + + // optimism + // Safe singleton: 0x69f4D1788e39c87893C980c06EdF4b7f686e2938 + // fall back: 0x017062a1dE2FE6b99BE3d9d37841FeD19F573804 + // multisend: 0x998739BFdAAdde7C933B942a68053933098f9EDa + // GnosisSafeProxyFactory: 0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC + // DAO: "0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4" + + + +const _shares = ['1']; +const _loot = ['1']; +const _minVoting = 60; +const _maxVoting = 600; +const _proposalOffering = 1; +const _name = "TestBaal"; +const _symbol = "BAALTO"; + +const networkName = { + 4: 'Rinkeby', + 5: 'goerli', + 1: 'mainnet', + 137: 'polygon', + 80001: 'polygonMumbai', + 42: 'kovan', + 100: 'gnosisChain', + 42161: 'arbitrumOne', + 10: 'optimisticEthereum' +}; + +const networkCurrency = { + 4: 'ETH', + 5: 'ETH', + 1: 'ETH', + 137: 'matic', + 80001: 'matic', + 42: 'ETH', + 100: 'xDai', + 42161: 'ETH', + 10: 'ETH' +}; + +async function main() { + + const [deployer] = await ethers.getSigners(); + const address = await deployer.getAddress(); + const { chainId } = await deployer.provider.getNetwork(); + console.log('Summoning Baal factories on network:', networkName[chainId]); + console.log('Account address:', address); + console.log( + 'Account balance:', + ethers.utils.formatEther(await deployer.provider.getBalance(address)), + networkCurrency[chainId] + ); + + // const tx = await deployer.sendTransaction({ + // to:_addresses.DAO, + // value: ethers.utils.parseEther("0.3") + // } + // ) + + // console.log('return funds', tx); + + console.log('start deploy'); + + const baalSummonerAddress = deployments[0]["v103"][networkName[chainId]].addresses.factory; + console.log('Summoner Address:', baalSummonerAddress); + const BaalAdvTokenSummoner = await ethers.getContractFactory('BaalAdvTokenSummoner') + + + // deploy proxy upgrades + baalSummoner = await upgrades.deployProxy(BaalAdvTokenSummoner); + await baalSummoner.deployed(); + console.log('Factory Contract Address:', baalSummoner.address); + console.log('imp:', await upgrades.erc1967.getImplementationAddress(baalSummoner.address)); + + + // baalSummoner = BaalAdvTokenSummoner.attach("0x8a4A9E36106Ee290811B89e06e2faFE913507965"); + // set addresses of templates and libraries + await baalSummoner.setSummonerAddr(baalSummonerAddress); + + // transfer ownership to DAO + if(_addresses.DAO=="0x0000000000000000000000000000000000000000"){ + console.log("You need to transfer ownership of summoner"); + } else { + console.log("transffering ownership too: ", _addresses.DAO); + await baalSummoner.transferOwnership(_addresses.DAO); + } + + + const txHash = baalSummoner.deployTransaction.hash; + const receipt = await deployer.provider.getTransactionReceipt(txHash); + console.log('Transaction Hash:', txHash); + console.log('Block Number:', receipt.blockNumber); + + + } + + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/lib/Baal/scripts/deployPoster.js b/lib/Baal/scripts/deployPoster.js new file mode 100644 index 0000000..e1d1c00 --- /dev/null +++ b/lib/Baal/scripts/deployPoster.js @@ -0,0 +1,49 @@ +const { ethers } = require('hardhat'); + +// Test Deploy Values + +const networkName = { + 4: 'Rinkeby', + 1: 'mainnet', + 137: 'matic' +}; + +const networkCurrency = { + 4: 'ETH', + 1: 'ETH', + 137: 'matic' +}; + +async function main() { + + const [deployer] = await ethers.getSigners(); + const address = await deployer.getAddress(); + const { chainId } = await deployer.provider.getNetwork(); + console.log('Summoning tribute minion on network:', networkName[chainId]); + console.log('Account address:', address); + console.log( + 'Account balance:', + ethers.utils.formatEther(await deployer.provider.getBalance(address)), + networkCurrency[chainId] + ); + + // const network = await ethers.provider.getNetwork() + // chainId = network.chainId + + + const posterFactory = await ethers.getContractFactory('Poster') + const posterSingleton = (await posterFactory.deploy()) + + const txHash = posterSingleton.deployTransaction.hash; + const receipt = await deployer.provider.getTransactionReceipt(txHash); + console.log('Transaction Hash:', txHash); + console.log('Contract Address:', posterSingleton.address); + // console.log('Block Number:', receipt.blockNumber); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/lib/Baal/scripts/deployTribute.js b/lib/Baal/scripts/deployTribute.js new file mode 100644 index 0000000..64508bb --- /dev/null +++ b/lib/Baal/scripts/deployTribute.js @@ -0,0 +1,51 @@ +const { ethers } = require('hardhat'); + +// Test Deploy Values + +const networkName = { + 4: 'Rinkeby', + 1: 'mainnet', + 137: 'matic', + 100: 'Gnosis' +}; + +const networkCurrency = { + 4: 'ETH', + 1: 'ETH', + 137: 'matic', + 100: 'xDai' +}; + +async function main() { + + const [deployer] = await ethers.getSigners(); + const address = await deployer.getAddress(); + const { chainId } = await deployer.provider.getNetwork(); + console.log('Summoning tribute minion on network:', networkName[chainId]); + console.log('Account address:', address); + console.log( + 'Account balance:', + ethers.utils.formatEther(await deployer.provider.getBalance(address)), + networkCurrency[chainId] + ); + + // const network = await ethers.provider.getNetwork() + // chainId = network.chainId + + + const tributeFactory = await ethers.getContractFactory('TributeMinion') + const tributeSingleton = (await tributeFactory.deploy()) + + const txHash = tributeSingleton.deployTransaction.hash; + const receipt = await deployer.provider.getTransactionReceipt(txHash); + console.log('Transaction Hash:', txHash); + console.log('Contract Address:', tributeSingleton.address); + // console.log('Block Number:', receipt.blockNumber); +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/lib/Baal/src/addresses/deployed.ts b/lib/Baal/src/addresses/deployed.ts new file mode 100644 index 0000000..cffd042 --- /dev/null +++ b/lib/Baal/src/addresses/deployed.ts @@ -0,0 +1,114 @@ +export const deployments = [ + { + v103: { + mainnet: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x5DcE1044A7E2E35D6524001796cee47252f18411", + factory: "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", + advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + goerli: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x5DcE1044A7E2E35D6524001796cee47252f18411", + factory: "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", + advTokenFactory: "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + sepolia: { + addresses: { + lootSingleton: "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + sharesSingleton: "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + baalSingleton: "0xc650B598b095613cCddF0f49570FfA475175A5D5", + factory: "0xB2B3909661552942AE1115E9Fc99dF0BC93d71d0", + vaultFactory: "0x763f5c2E59f997A6cC48Bf1228aBf61325244702", + advTokenFactory: "0xD69e5B8F6FA0E5d94B93848700655A78DF24e387", + tributeMinion: "0xdb4D89F2199b9Cf451B7Ff4bdC94b1c96De4bdD0", + DAO:"0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", + }, + }, + gnosis: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x5DcE1044A7E2E35D6524001796cee47252f18411", + factory: "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", + advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + polygon: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x5DcE1044A7E2E35D6524001796cee47252f18411", + factory: "0x7e988A9db2F8597735fc68D21060Daed948a3e8C", + vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", + advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + tributeMinion: "0x51498dDdd2A8cdeC82932E08A37eBaF346C38EFd", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + polygonMumbai: { + addresses: { + lootSingleton: "0x1d0f5D1f5E1FB74a86c19309368D434E9f7BB608", + sharesSingleton: "0x594AF060c08EeA9f559Bc668484E50596BcB2CFB", + baalSingleton: "0x51498dDdd2A8cdeC82932E08A37eBaF346C38EFd", + factory: "0x3840453a3907916113dB88bFAc2349533a736c64", + vaultFactory: "0xbB907b1a769bD338c9d09Fb20C2997ECE5E715a3", + advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + tributeMinion: "0x898fc00771c148257a7edbdAD33c1469F4420740", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + arbitrumOne: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x17234C0Ae25AF09fAf57B9D5ea2B93C1f220E800", + factory: "0xb08Cc8C343cF6dC20d8cf51Fb2D6C436c6390dAa", + vaultFactory: "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1", + advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + tributeMinion: "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + }, + }, + optimisticEthereum: { + addresses: { + lootSingleton: "0x0444AE984b9563C8480244693ED65F25B3C64a4E", + sharesSingleton: "0x8124Cbb807A7b64123F3dEc3EF64995d8B10d3Eb", + baalSingleton: "0x17234C0Ae25AF09fAf57B9D5ea2B93C1f220E800", + factory: "0x3E0eAdE343Ddc556a6Cf0f858e4f685ba303ce71", + vaultFactory: "0xb04111e7b4576164145EF97EB81fd43DA0F2D675", + advTokenFactory: "0x84561C97156a128662B62952890469214FDC87bf", + tributeMinion: "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + DAO:"0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", + }, + }, + base: { + addresses: { + lootSingleton: "0x52acf023d38A31f7e7bC92cCe5E68d36cC9752d6", + sharesSingleton: "0xc650B598b095613cCddF0f49570FfA475175A5D5", + baalSingleton: "0xE0F33E95aF46EAd1Fe181d2A74919bff903cD5d4", + factory: "0x22e0382194AC1e9929E023bBC2fD2BA6b778E098", + vaultFactory: "0x2eF2fC8a18A914818169eFa183db480d31a90c5D", + advTokenFactory: "0x97Aaa5be8B38795245f1c38A883B44cccdfB3E11", + tributeMinion: "0x00768B047f73D88b6e9c14bcA97221d6E179d468", + DAO:"0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", + }, + }, + }, + }, +]; diff --git a/lib/Baal/src/addresses/setup.ts b/lib/Baal/src/addresses/setup.ts new file mode 100644 index 0000000..cf80187 --- /dev/null +++ b/lib/Baal/src/addresses/setup.ts @@ -0,0 +1,80 @@ +import { constants } from 'ethers'; +import { Network } from 'hardhat/types'; +import { DeploymentsExtension } from 'hardhat-deploy/types'; +import { + getCompatibilityFallbackHandlerDeployment, + getMultiSendDeployment, + getProxyFactoryDeployment, + getSafeSingletonDeployment, +} from 'safe-deployments'; +import { ContractVersions, SupportedNetworks } from '@gnosis.pm/zodiac'; + +export type ContractSetup = { + gnosisSingleton: string; + gnosisFallbackLibrary: string; + gnosisMultisendLibrary: string; + poster: string; + gnosisSafeProxyFactory: string; + moduleProxyFactory: string; + DAO: string; +} + +const DAO_ADDRESS: {[name: string]: string} = { + mainnet: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + goerli: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + sepolia: "0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", + gnosis: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + polygon: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + polygonMumbai: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + arbitrumOne: "0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", + optimisticEthereum: "0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", + base: "0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", +}; + +export const getSetupAddresses = async ( + chainId: string, + network: Network, + deployments?: DeploymentsExtension +): Promise => { + + if (network.name === 'hardhat') { + if (!deployments) throw Error(`Must specify contract deployments for ${network.name} network`); + return { + gnosisSingleton: (await deployments.get('GnosisSafe'))?.address, + gnosisFallbackLibrary: (await deployments.get('CompatibilityFallbackHandler'))?.address, + gnosisMultisendLibrary: (await deployments.get('MultiSend'))?.address, + poster: (await deployments?.get('Poster')).address, + gnosisSafeProxyFactory: (await deployments.get('GnosisSafeProxyFactory'))?.address, + moduleProxyFactory: (await deployments.get('ModuleProxyFactory'))?.address, + DAO: constants.AddressZero, + }; + } + + const filter = { network: chainId, version: '1.3.0' }; + + const gnosisSingleton = getSafeSingletonDeployment(filter)?.networkAddresses[chainId]; + const gnosisFallbackLibrary = getCompatibilityFallbackHandlerDeployment(filter)?.networkAddresses[chainId]; + const gnosisMultisendLibrary = getMultiSendDeployment(filter)?.networkAddresses[chainId]; + const gnosisSafeProxyFactory = getProxyFactoryDeployment(filter)?.networkAddresses[chainId]; + let moduleProxyFactory = Object.values(SupportedNetworks).includes(Number(chainId)) + ? ContractVersions[Number(chainId) as SupportedNetworks]?.factory?.['1.2.0'] + : undefined; + // TODO: Base network is not officially supported by the Zodiac SDK + if (chainId === '8453') moduleProxyFactory = '0x000000000000aDdB49795b0f9bA5BC298cDda236'; + const poster = '0x000000000000cd17345801aa8147b8D3950260FF'; + + if (!gnosisSingleton || !gnosisFallbackLibrary || !gnosisMultisendLibrary || !gnosisSafeProxyFactory) + throw new Error(`Safe infra not found for network ${network.name}`); + if (!moduleProxyFactory) + throw new Error(`Zodiac infra not found for network ${network.name}`); + + return { + gnosisSingleton, + gnosisFallbackLibrary, + gnosisMultisendLibrary, + gnosisSafeProxyFactory, + moduleProxyFactory, + poster, + DAO: DAO_ADDRESS[network.name], + }; +}; diff --git a/lib/Baal/src/hardhat/index.ts b/lib/Baal/src/hardhat/index.ts new file mode 100644 index 0000000..aeab286 --- /dev/null +++ b/lib/Baal/src/hardhat/index.ts @@ -0,0 +1,5 @@ +export * from "../signDelegation"; +export * from "../signPermit"; +export * from "../signVote"; +export * from "../util"; +export * from "../../test/utils"; diff --git a/lib/Baal/src/index.ts b/lib/Baal/src/index.ts new file mode 100644 index 0000000..4a9b443 --- /dev/null +++ b/lib/Baal/src/index.ts @@ -0,0 +1,32 @@ +/* + in order to adjust the build folder: + 1) import any files here you want in the build. + 2) copy the file path of the import. + 3) add the path to the ts.config.build.json under the { include: [...] } configuration. + 4) bump package.json version to publish a new package to npm. +*/ +export { Baal } from "./types/contracts/Baal"; +export { Baal__factory as BaalFactory } from "./types/factories/contracts/Baal__factory"; +export { BaalSummoner } from "./types/contracts/BaalSummoner"; +export { BaalSummoner__factory as BaalSummonerFactory } from "./types/factories/contracts/BaalSummoner__factory"; +export { BaalAdvTokenSummoner } from "./types/contracts/higherOrderFactories/BaalAdvTokenSummoner"; +export { BaalAdvTokenSummoner__factory as BaalAdvTokenSummonerFactory } from "./types/factories/contracts/higherOrderFactories/BaalAdvTokenSummoner__factory"; +export { BaalAndVaultSummoner } from "./types/contracts/higherOrderFactories/BaalAndVaultSummoner"; +export { BaalAndVaultSummoner__factory as BaalAndVaultFactory } from "./types/factories/contracts/higherOrderFactories/BaalAndVaultSummoner__factory"; +export { Loot } from "./types/contracts/LootERC20.sol/Loot"; +export { Loot__factory as LootFactory } from "./types/factories/contracts/LootERC20.sol/Loot__factory"; +export { Shares } from "./types/contracts/SharesERC20.sol/Shares"; +export { Shares__factory as SharesFactory } from "./types/factories/contracts/SharesERC20.sol/Shares__factory"; +export { Poster } from "./types/contracts/utils/Poster"; +export { Poster__factory as PosterFactory } from "./types/factories/contracts/utils/Poster__factory"; +export { TributeMinion } from "./types/contracts/tools/TributeMinion.sol/TributeMinion"; +export { TributeMinion__factory as TributeMinionFactory } from "./types/factories/contracts/tools/TributeMinion.sol/TributeMinion__factory"; +export { MultiSend } from "./types/@gnosis.pm/safe-contracts/contracts/libraries/MultiSend"; +export { MultiSend__factory as MultiSendFactory } from "./types/factories/@gnosis.pm/safe-contracts/contracts/libraries/MultiSend__factory"; + +// Interfaces +export { IBaalToken } from "./types/contracts/interfaces/IBaalToken"; +export { IBaal } from "./types/contracts/interfaces/IBaal"; + +export * from "./addresses/setup"; +export { deployments as DEPLOYMENT_ADDRESSES } from "./addresses/deployed"; diff --git a/lib/Baal/src/signDelegation.ts b/lib/Baal/src/signDelegation.ts new file mode 100644 index 0000000..2efc24a --- /dev/null +++ b/lib/Baal/src/signDelegation.ts @@ -0,0 +1,40 @@ +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +export const signDelegation = async ( + chainId: number, + contractAddress: string, + signer: SignerWithAddress, + name: string, + delegatee: string, + nonce: number, + expiry: number +) => { + const domain = { + name: 'delegation', + version: '4', + chainId, + verifyingContract: contractAddress, + } + + const types = { + Delegation: [ + { name: 'name', type: 'string' }, + { name: 'delegatee', type: 'address' }, + { name: 'nonce', type: 'uint256' }, + { name: 'expiry', type: 'uint256' }, + ], + } + + const values = { + name, + delegatee, + nonce, + expiry, + } + + const sig = await signer._signTypedData(domain, types, values) + + return sig +}; + +export default signDelegation; diff --git a/lib/Baal/src/signPermit.ts b/lib/Baal/src/signPermit.ts new file mode 100644 index 0000000..a510e65 --- /dev/null +++ b/lib/Baal/src/signPermit.ts @@ -0,0 +1,45 @@ +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' +import { BigNumber } from 'ethers' + +export const signPermit = async ( + chainId: number, + contractAddress: string, + signer: SignerWithAddress, + name: string, + owner: string, + spender: string, + value: number, + nonce: BigNumber, + deadline: number +) => { + // "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" + const domain = { + name, + version: '1', + chainId, + verifyingContract: contractAddress, + } + + // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); + const types = { + Permit: [ + { name: 'owner', type: 'address' }, + { name: 'spender', type: 'address' }, + { name: 'value', type: 'uint256' }, + { name: 'nonce', type: 'uint256' }, + { name: 'deadline', type: 'uint256' }, + ], + } + + const sig = await signer._signTypedData(domain, types, { + owner, + spender, + value, + nonce, + deadline + }) + + return sig +}; + +export default signPermit; diff --git a/lib/Baal/src/signVote.ts b/lib/Baal/src/signVote.ts new file mode 100644 index 0000000..08c4e1b --- /dev/null +++ b/lib/Baal/src/signVote.ts @@ -0,0 +1,46 @@ +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' + +export const signVote = async ( + chainId: number, + contractAddress: string, + signer: SignerWithAddress, + name: string, + expiry: number, + nonce: number, + proposalId: number, + support: boolean + +) => { + const domain = { + name: 'Vote', + version: '4', + chainId, + verifyingContract: contractAddress, + } + + const types = { + Vote: [ + { name: 'name', type: 'string' }, + { name: 'voter', type: 'address' }, + { name: 'expiry', type: 'uint256' }, + { name: 'nonce', type: 'uint256' }, + { name: 'proposalId', type: 'uint32' }, + { name: 'support', type: 'bool' }, + ], + } + + const values = { + name, + voter: signer.address, + expiry, + nonce, + proposalId, + support + } + + const sig = await signer._signTypedData(domain, types, values) + + return sig +}; + +export default signVote; diff --git a/lib/Baal/src/util.ts b/lib/Baal/src/util.ts new file mode 100644 index 0000000..9b48d96 --- /dev/null +++ b/lib/Baal/src/util.ts @@ -0,0 +1,57 @@ +import { BigNumber } from '@ethersproject/bignumber' +import { ethers } from 'hardhat' +import { encodeMultiSend, MetaTransaction } from '@gnosis.pm/safe-contracts' +import { MultiSend } from './types' + +export const encodeMultiAction = (multisend: MultiSend, actions: string[], tos: string[], values: BigNumber[], operations: number[]) => { + let metatransactions: MetaTransaction[] = [] + for (let index = 0; index < actions.length; index++) { + metatransactions.push({ + to: tos[index], + value: values[index], + data: actions[index], + operation: operations[index], + }) + } + const encodedMetatransactions = encodeMultiSend(metatransactions) + const multi_action = multisend.interface.encodeFunctionData('multiSend', [encodedMetatransactions]) + return multi_action +} + +export const decodeMultiAction = (multisend: MultiSend, encoded: string) => { + const OPERATION_TYPE = 2 + const ADDRESS = 40 + const VALUE = 64 + const DATA_LENGTH = 64 + + const actions = multisend.interface.decodeFunctionData('multiSend', encoded) + let transactionsEncoded = (actions[0] as string).slice(2) + + const transactions: MetaTransaction[] = [] + + while (transactionsEncoded.length >= OPERATION_TYPE + ADDRESS + VALUE + DATA_LENGTH) { + const thisTxLengthHex = transactionsEncoded.slice(OPERATION_TYPE + ADDRESS + VALUE, OPERATION_TYPE + ADDRESS + VALUE + DATA_LENGTH) + const thisTxLength = BigNumber.from('0x' + thisTxLengthHex).toNumber() + transactions.push({ + to: '0x' + transactionsEncoded.slice(2, OPERATION_TYPE + ADDRESS), + value: '0x' + transactionsEncoded.slice(OPERATION_TYPE + ADDRESS, OPERATION_TYPE + ADDRESS + VALUE), + data: + '0x' + + transactionsEncoded.slice(OPERATION_TYPE + ADDRESS + VALUE + DATA_LENGTH, OPERATION_TYPE + ADDRESS + VALUE + DATA_LENGTH + thisTxLength * 2), + operation: parseInt(transactionsEncoded.slice(0, 2)), + }) + transactionsEncoded = transactionsEncoded.slice(OPERATION_TYPE + ADDRESS + VALUE + DATA_LENGTH + thisTxLength * 2) + } + + return transactions +} + +export const hashOperation = (transactions: string): string => { + const abiCoder = ethers.utils.defaultAbiCoder + + const encoded = abiCoder.encode(['bytes'], [transactions]) + + const hashed = ethers.utils.solidityKeccak256(['bytes'], [encoded]) + + return hashed +} diff --git a/lib/Baal/tasks/setup.ts b/lib/Baal/tasks/setup.ts new file mode 100644 index 0000000..4af59c2 --- /dev/null +++ b/lib/Baal/tasks/setup.ts @@ -0,0 +1,842 @@ +import * as fs from "fs"; +import { ethers } from "ethers"; +import { task } from "hardhat/config"; + +import { BigNumber } from "@ethersproject/bignumber"; +import { encodeMultiSend, MetaTransaction } from "@gnosis.pm/safe-contracts"; + +import { deployments as currentDeployments } from '../src/addresses/deployed'; +import { getSetupAddresses } from '../src/addresses/setup'; + + +type SupportedNetwork = keyof typeof currentDeployments[0]['v103']; + +const DEBUG = true; + +task( + "generate", + "Create a mnemonic for builder deploys", + async (_, { ethers }) => { + const bip39 = require("bip39"); + const hdkey = require("ethereumjs-wallet/hdkey"); + const mnemonic = bip39.generateMnemonic(); + if (DEBUG) console.log("mnemonic", mnemonic); + const seed = await bip39.mnemonicToSeed(mnemonic); + if (DEBUG) console.log("seed", seed); + const hdwallet = hdkey.fromMasterSeed(seed); + const wallet_hdpath = "m/44'/60'/0'/0/"; + const account_index = 0; + let fullPath = wallet_hdpath + account_index; + if (DEBUG) console.log("fullPath", fullPath); + const wallet = hdwallet.derivePath(fullPath).getWallet(); + const privateKey = "0x" + wallet._privKey.toString("hex"); + if (DEBUG) console.log("privateKey", privateKey); + var EthUtil = require("ethereumjs-util"); + const address = + "0x" + EthUtil.privateToAddress(wallet._privKey).toString("hex"); + console.log( + "🔐 Account Generated as " + + address + + " and set as mnemonic in packages/hardhat" + ); + console.log( + "💬 Use 'yarn run account' to get more information about the deployment account." + ); + + fs.writeFileSync("../" + address + ".txt", mnemonic.toString()); + fs.writeFileSync("../mnemonic.txt", mnemonic.toString()); + } +); + +/* DAO tasks */ +/* TODO: DAO amin tasks */ + +task("baal:delegate", "Delegate shares") + .addParam("dao", "Dao address") + .addParam("to", "delegate to") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const Shares = await hre.ethers.getContractFactory("SharesERC20"); + const shares = Shares.attach(baal.address); + const delegateVotes = await shares.delegate(taskArgs.to); + console.log("Delegate votes txhash:", delegateVotes.hash); + }); + +task("baal:ragequit", "Ragequit shares and/or loot") + .addParam("dao", "Dao address") + .addParam("to", "RQ to") + .addParam("shares", "number of shares") + .addParam("loot", "number of loot") + .addParam( + "tokens", + 'the token addresses (array) (escape quotes) (no spaces) ex [\\"0x123...\\"]' + ) + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const tokens = JSON.parse(taskArgs.tokens); + const ragequitAction = await baal.ragequit( + taskArgs.to, + taskArgs.shares, + taskArgs.loot, + tokens + ); + console.log("Ragequit txhash:", ragequitAction.hash); + }); + +task("baal:tribute-prop", "Approve token and make a tribute proposal") + .addParam("dao", "Dao address") + .addParam("minion", "Tribute Minion address") + .addParam("token", "Tribute token address") + .addParam("amount", "Tribute token amount") + .addParam("shares", "Tribute shares requested") + .addParam("loot", "Tribute loot requested") + .addParam("baalGas", "Tribute baal gas date. 0 for none") + .addParam("expiration", "Tribute expiration date. 0 for ignore") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const Token = await hre.ethers.getContractFactory("TestERC20"); + const token = Token.attach(taskArgs.token); + const Minion = await hre.ethers.getContractFactory("TributeMinion"); + const minion = Minion.attach(taskArgs.minion); + const countBefore = await baal.proposalCount(); + console.log("countBefore", countBefore); + const deployers = await hre.ethers.getSigners(); + const address = await deployers[0].getAddress(); + // approve + const approve = await token.approve(taskArgs.minion, taskArgs.amount); + const encoded = await minion.encodeTributeProposal( + taskArgs.dao, + taskArgs.shares, + taskArgs.loot, + address, + countBefore + 1, + taskArgs.minion + ); + console.log("*****encoded proposal******"); + console.log(encoded); + console.log("***************************"); + + const tributeProposal = await minion.submitTributeProposal( + taskArgs.dao, + taskArgs.token, + taskArgs.amount, + taskArgs.shares, + taskArgs.loot, + taskArgs.expiration, + taskArgs.baalGas, + "tribute from cli" + ); + console.log("Tribute proposal submitted txhash:", tributeProposal.hash); + }); + +task("baal:cancel-prop", "Cancel a proposal") + .addParam("dao", "Dao address") + .addParam("id", "Proposal ID") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + // TODO: pull event data from etherscan + const cancelProposal = await baal.cancelProposal(taskArgs.id); + console.log("Proposal processed txhash:", cancelProposal.hash); + }); + +task("baal:process-prop", "Process a proposal") + .addParam("dao", "Dao address") + .addParam("id", "Proposal ID") + .addParam("data", "the data, need to get this from the submit events") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + // TODO: pull event data from etherscan + const processProposal = await baal.processProposal( + taskArgs.id, + taskArgs.data + ); + console.log("Proposal processed txhash:", processProposal.hash); + }); + +task("baal:vote-prop", "Vote on a proposal") + .addParam("dao", "Dao address") + .addParam("id", "Proposal ID") + .addParam("approve", "true is yes and false is no") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const submitVote = await baal.submitVote( + taskArgs.id, + taskArgs.approve === "true" + ); + console.log("Proposal voted on txhash:", submitVote.hash); + }); + +task("baal:sponsor-prop", "Status of a proposal") + .addParam("dao", "Dao address") + .addParam("id", "Proposal ID") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const proposal = await baal.sponsorProposal(taskArgs.id); + console.log("Proposal sponsored txhash:", proposal.hash); + }); + +task("baal:status-prop", "Status of a proposal") + .addParam("dao", "Dao address") + .addParam("id", "Proposal ID") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const proposal = await baal.proposals(taskArgs.id); + console.log("Proposal status:", proposal); + }); + +task("baal:getlatest-prop", "Current Proposal info") + .addParam("dao", "Dao address") + .setAction(async (taskArgs, hre) => { + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const count = await baal.functions.proposalCount(); + const lastSponsored = await baal.latestSponsoredProposalId(); + console.log("the current proposal count is:", count); + console.log("the last proposal sponsored is:", lastSponsored); + }); + +task("baal:member-prop", "Submits a new member proposal") + .addParam("dao", "Dao address") + .addParam("applicant", "applicant address") + .addParam("shares", "number shares") + .addParam("loot", "number loot") + .addParam( + "expiration", + "seconds after grace that proposal expires, 0 for none" + ) + .addOptionalParam("meta", "updated meta data") + .setAction(async (taskArgs, hre) => { + const { deployments, getChainId, network } = hre; + const chainId = await getChainId(); + const _addresses = await getSetupAddresses(chainId, network, deployments); + + const encodeMultiAction2 = ( + multisend: any, + actions: string[], + tos: string[], + values: BigNumber[], + operations: number[] + ) => { + let metatransactions: MetaTransaction[] = []; + for (let index = 0; index < actions.length; index++) { + metatransactions.push({ + to: tos[index], + value: values[index], + data: actions[index], + operation: operations[index], + }); + } + const encodedMetatransactions = encodeMultiSend(metatransactions); + const multi_action = multisend.interface.encodeFunctionData("multiSend", [ + encodedMetatransactions, + ]); + return multi_action; + }; + + const MultisendContract = await hre.ethers.getContractFactory("MultiSend"); + const multisend = MultisendContract.attach( + _addresses.gnosisMultisendLibrary + ); + + const block = await hre.ethers.provider.getBlock("latest"); + + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const countBefore = await baal.proposalCount(); + console.log("countBefore", countBefore); + + const mintLootAction = baal.interface.encodeFunctionData("mintLoot", [ + [taskArgs.applicant], + [taskArgs.loot], + ]); + const mintSharesAction = baal.interface.encodeFunctionData( + "mintShares", + [[taskArgs.applicant], [taskArgs.shares]] + ); + const metadataConfig = { + CONTENT: taskArgs.meta || '{"name":"test proposal"}', + TAG: "daohaus.proposal.metadata", + }; + // const posterFactory = await hre.ethers.getContractFactory("Poster"); + // const poster = (await posterFactory.attach(_addresses.poster)) as Poster; + // const postMetaData = await poster.interface.encodeFunctionData("post", [ + // metadataConfig.CONTENT, + // metadataConfig.TAG, + // ]); + // const posterFromBaal = await baal.interface.encodeFunctionData( + // "executeAsBaal", + // [poster.address, 0, postMetaData] + // ); + + const now = block.timestamp; + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + + const encodedAction = encodeMultiAction2( + multisend, + [mintLootAction, mintSharesAction], + [baal.address, baal.address], + [BigNumber.from(0), BigNumber.from(0)], + [0, 0, 0] + ); + + console.log("********encoded data*********"); + console.log(encodedAction); + console.log("*****************************"); + // TODO: poster should happen here probably, if in encodeAction it will run after processing + const submit = await baal.submitProposal( + encodedAction, + parseInt(taskArgs.expiration) + ? now + voting + grace + parseInt(taskArgs.expiration) + : 0, + 0, + metadataConfig.CONTENT // hre.ethers.utils.id("all hail baal") + ); + console.log("tx:", submit.hash); + }); + + +task("baal:shaman-prop", "Submits a new shman proposal") + .addParam("dao", "Dao address") + .addParam("shaman", "shaman address") + .addParam("permissions", "permission number") + .addParam( + "expiration", + "seconds after grace that proposal expires, 0 for none" + ) + .addOptionalParam("meta", "updated meta data") + .setAction(async (taskArgs, hre) => { + const { deployments, getChainId, network } = hre; + const chainId = await getChainId(); + const _addresses = await getSetupAddresses(chainId, network, deployments); + + const encodeMultiAction2 = ( + multisend: any, + actions: string[], + tos: string[], + values: BigNumber[], + operations: number[] + ) => { + let metatransactions: MetaTransaction[] = []; + for (let index = 0; index < actions.length; index++) { + metatransactions.push({ + to: tos[index], + value: values[index], + data: actions[index], + operation: operations[index], + }); + } + const encodedMetatransactions = encodeMultiSend(metatransactions); + const multi_action = multisend.interface.encodeFunctionData("multiSend", [ + encodedMetatransactions, + ]); + return multi_action; + }; + + const MultisendContract = await hre.ethers.getContractFactory("MultiSend"); + const multisend = MultisendContract.attach( + _addresses.gnosisMultisendLibrary + ); + + const block = await hre.ethers.provider.getBlock("latest"); + + const Baal = await hre.ethers.getContractFactory("Baal"); + const baal = Baal.attach(taskArgs.dao); + const countBefore = await baal.proposalCount(); + console.log("countBefore", countBefore); + + const addShamanAction = baal.interface.encodeFunctionData("setShamans", [ + [taskArgs.shaman], + [taskArgs.permissions], + ]); + + const metadataConfig = { + CONTENT: taskArgs.meta || '{"name":"test shaman proposal"}', + TAG: "daohaus.proposal.metadata", + }; + + const now = await block.timestamp; + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + + const encodedAction = encodeMultiAction2( + multisend, + [addShamanAction], + [baal.address], + [BigNumber.from(0)], + [0, 0, 0] + ); + + console.log("********encoded data*********"); + console.log(encodedAction); + console.log("*****************************"); + const submit = await baal.submitProposal( + encodedAction, + parseInt(taskArgs.expiration) + ? now + voting + grace + parseInt(taskArgs.expiration) + : 0, + 0, + metadataConfig.CONTENT // hre.ethers.utils.id("all hail baal") + ); + console.log("tx:", submit.hash); + }); + +/* example: +npx hardhat summon --factory 0xe2F42d9fd5C1a590F6c3d6b2A27802C0da93FEb7 +--summoners [\"0xadc...\"] +--shares [\"10000000000000000000\"] --loot [\"10000000000000000000\"] +--sharespaused false --lootpaused false +--shaman 0xadc... --name gB447 --network goerli +*/ +task("baal:summon", "Summons a new DAO") + .addParam("factory", "Dao factory address") + .addParam( + "summoners", + 'the summoner addresses (array) (escape quotes) (no spaces) ex [\\"0x123...\\"]' + ) + .addParam( + "shares", + "numnber of initial shares for summoners (string array, escape quotes)" + ) + .addParam( + "loot", + "numnber of initial loot for summoners (string array, escape quotes)" + ) + .addParam("sharespaused", "are shares transferable") + .addParam("lootpaused", "is loot transferable") + .addParam("shaman", "any initial shamans") + .addParam("name", "share token symbol") + .addOptionalParam("meta", "updated meta data") + .addOptionalParam("withsidecar", "add a vault (factory address)") + .setAction(async (taskArgs, hre) => { + const { deployments, getChainId, network } = hre; + const chainId = await getChainId(); + const _addresses = await getSetupAddresses(chainId, network, deployments); + + const zeroAddress = ethers.constants.AddressZero; + const metadataConfig = { + CONTENT: taskArgs.meta || '{"name":"test"}', + TAG: "daohaus.summoner.daoProfile", + }; + let summonerArr; + let lootArr; + let sharesArr; + + try { + summonerArr = JSON.parse(taskArgs.summoners); + lootArr = JSON.parse(taskArgs.loot); + sharesArr = JSON.parse(taskArgs.shares); + } catch (err) { + throw "loot shares and summoners should be arrays"; + } + if ( + !Array.isArray(summonerArr) || + !Array.isArray(lootArr) || + !Array.isArray(sharesArr) + ) { + throw "loot shares and summoners should be linked arrays"; + } + if ( + summonerArr.length !== lootArr.length || + lootArr.length !== sharesArr.length + ) { + throw "arrays must be of the same length"; + } + + const abiCoder = hre.ethers.utils.defaultAbiCoder; + + const getBaalParams = async function ( + baal: any, + poster: any, + config: { + PROPOSAL_OFFERING: any; + GRACE_PERIOD_IN_SECONDS: any; + VOTING_PERIOD_IN_SECONDS: any; + QUORUM_PERCENT: any; + SPONSOR_THRESHOLD: any; + MIN_RETENTION_PERCENT: any; + MIN_STAKING_PERCENT: any; + TOKEN_NAME: any; + TOKEN_SYMBOL: any; + }, + metadata: [string, string], + adminConfig: [boolean, boolean], + shamans: [string[], number[]], + shares: [string[], number[]], + loots: [string[], number[]] + ) { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [ + config.VOTING_PERIOD_IN_SECONDS, + config.GRACE_PERIOD_IN_SECONDS, + config.PROPOSAL_OFFERING, + config.QUORUM_PERCENT, + config.SPONSOR_THRESHOLD, + config.MIN_RETENTION_PERCENT, + ] + ); + + const setAdminConfig = await baal.interface.encodeFunctionData( + "setAdminConfig", + adminConfig + ); + const setGovernanceConfig = await baal.interface.encodeFunctionData( + "setGovernanceConfig", + [governanceConfig] + ); + const setShaman = await baal.interface.encodeFunctionData( + "setShamans", + shamans + ); + const mintShares = await baal.interface.encodeFunctionData( + "mintShares", + shares + ); + const mintLoot = await baal.interface.encodeFunctionData( + "mintLoot", + loots + ); + const postMetaData = await poster.interface.encodeFunctionData("post", [ + metadataConfig.CONTENT, + metadataConfig.TAG, + ]); + const posterFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [poster.address, 0, postMetaData] + ); + + const initalizationActions = [ + setAdminConfig, + setGovernanceConfig, + setShaman, + mintShares, + mintLoot, + posterFromBaal, + ]; + + // const initalizationActionsMulti = encodeMultiAction( + // multisend, + // [setAdminConfig, setGovernanceConfig, setGuildTokens, setShaman, mintShares, mintLoot], + // [baal.address, baal.address, baal.address, baal.address, baal.address, baal.address], + // [BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0), BigNumber.from(0)], + // [0, 0, 0, 0, 0, 0] + // ) + return { + initParams: abiCoder.encode( + ["string", "string", "address", "address", "address", "address","string","string"], + [ + config.TOKEN_NAME, + config.TOKEN_SYMBOL, + zeroAddress, + zeroAddress, + zeroAddress, + zeroAddress, + ] + ), + initalizationActions, + }; + }; + + let encodedInitParams: { + initParams: string; + initalizationActions: string[]; + }; + + const deploymentConfig = { + GRACE_PERIOD_IN_SECONDS: 300, + VOTING_PERIOD_IN_SECONDS: 200, + PROPOSAL_OFFERING: 0, + SPONSOR_THRESHOLD: 1, + MIN_RETENTION_PERCENT: 0, + MIN_STAKING_PERCENT: 0, + QUORUM_PERCENT: 0, + TOKEN_NAME: "Baal Shares", + TOKEN_SYMBOL: taskArgs.name, + }; + + const baalSummoner = await hre.ethers.getContractFactory("BaalSummoner"); + const contract = baalSummoner.attach(taskArgs.factory); + + const baalTemplateAddr = await contract.template(); + console.log("baalTemplateAddr", baalTemplateAddr); + + const posterFactory = await hre.ethers.getContractFactory("Poster"); + const posterAddress = _addresses.poster; + console.log("posterAddress", posterAddress); + + const poster = posterFactory.attach(posterAddress); + console.log("**********************"); + + const Baal = await hre.ethers.getContractFactory("Baal"); + const baalSingleton = Baal.attach(baalTemplateAddr); + const MultisendContract = await hre.ethers.getContractFactory("MultiSend"); + const multisend = MultisendContract.attach( + _addresses.gnosisMultisendLibrary + ); + + encodedInitParams = await getBaalParams( + baalSingleton, + poster, + deploymentConfig, + [metadataConfig.CONTENT, metadataConfig.TAG], + [taskArgs.sharesPaused, taskArgs.lootPaused], + [[taskArgs.shaman], [7]], + [summonerArr, sharesArr], + [summonerArr, lootArr] + ); + + const randomSeed = Math.floor(Math.random() * 10000000); + let tx; + if(taskArgs.withsidecar){ + const baalVaultSummoner = await hre.ethers.getContractFactory("BaalAndVaultSummoner"); + const contractVault = baalVaultSummoner.attach(taskArgs.withsidecar); + console.log("summon ball and vault from tasks"); + + tx = await contractVault.summonBaalAndVault( + encodedInitParams.initParams, + encodedInitParams.initalizationActions, + randomSeed, + hre.ethers.utils.formatBytes32String("daohausCLI"), + "test cli vault" + ); + } else { + console.log("summon ball from tasks"); + + tx = await contract.summonBaalFromReferrer( + encodedInitParams.initParams, + encodedInitParams.initalizationActions, + randomSeed, + hre.ethers.utils.formatBytes32String("daohausCLI") + ); + } + + console.log(taskArgs); + console.log("tx:", tx.hash); + const deployers = await hre.ethers.getSigners(); + const address = await deployers[0].getAddress(); + const balance = await deployers[0].getBalance(); + console.log("Account address:", address); + console.log("Account balance:", hre.ethers.utils.formatEther(balance)); + }); + + + /* example: +npx hardhat summonAdvToken --factory 0x68aA3E7389AC60563dE2fBdCCa06Df79e011043A +--summoners [\"0xCED608Aa29bB92185D9b6340Adcbfa263DAe075b\",\"0x83ab8e31df35aa3281d630529c6f4bf5ac7f7abf\"] +--shares [\"10000000000000000000\", \"10000000000000000000\"] --loot [\"10000000000000000000\"] +--sharespaused false --lootpaused false +--name gB447 --lootname gb447L007 --network goerli +*/ +task("baal:summon-advToken", "Summons a new DAO from Higher order factory") +.addParam("factory", "Dao factory address") +.addParam( + "summoners", + 'the summoner addresses (array) (escape quotes) (no spaces) ex [\\"0x123...\\"]' +) +.addParam( + "shares", + "numnber of initial shares for summoners (string array, escape quotes)" +) +.addParam( + "loot", + "numnber of initial loot for summoners (string array, escape quotes)" +) +.addParam("sharespaused", "are shares transferable") +.addParam("lootpaused", "is loot transferable") +.addParam("name", "share token symbol") +.addParam("lootname", "loot token symbol") +.addOptionalParam("meta", "updated meta data") +.setAction(async (taskArgs, hre) => { + const { deployments, getChainId, network } = hre; + const chainId = await getChainId(); + const _addresses = { + ...await getSetupAddresses(chainId, network, deployments), + baalDefaultSingleton: network.name === 'hardhat' + ? (await deployments.get('Baal'))?.address + : currentDeployments[0]['v103'][network.name as SupportedNetwork]?.addresses?.baalSingleton + } + const zeroAddress = ethers.constants.AddressZero; + const metadataConfig = { + CONTENT: taskArgs.meta || '{"name":"test"}', + TAG: "daohaus.summoner.daoProfile", + }; + let summonerArr; + let lootArr; + let sharesArr; + + try { + summonerArr = JSON.parse(taskArgs.summoners); + lootArr = JSON.parse(taskArgs.loot); + sharesArr = JSON.parse(taskArgs.shares); + } catch (err) { + throw "loot shares and summoners should be arrays"; + } + if ( + !Array.isArray(summonerArr) || + !Array.isArray(lootArr) || + !Array.isArray(sharesArr) + ) { + throw "loot shares and summoners should be linked arrays"; + } + if ( + summonerArr.length !== lootArr.length || + lootArr.length !== sharesArr.length + ) { + throw "arrays must be of the same length"; + } + + const abiCoder = hre.ethers.utils.defaultAbiCoder; + + const getBaalParams = async function ( + baal: any, + config: { + PROPOSAL_OFFERING: any; + GRACE_PERIOD_IN_SECONDS: any; + VOTING_PERIOD_IN_SECONDS: any; + QUORUM_PERCENT: any; + SPONSOR_THRESHOLD: any; + MIN_RETENTION_PERCENT: any; + MIN_STAKING_PERCENT: any; + TOKEN_NAME: any; + TOKEN_SYMBOL: any; + LOOT_TOKEN_NAME: any; + LOOT_TOKEN_SYMBOL: any; + LOOT_TOKEN_TRANSFERABLE: any; + TOKEN_TRANSFERABLE: any; + } + ) { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [ + config.VOTING_PERIOD_IN_SECONDS, + config.GRACE_PERIOD_IN_SECONDS, + config.PROPOSAL_OFFERING, + config.QUORUM_PERCENT, + config.SPONSOR_THRESHOLD, + config.MIN_RETENTION_PERCENT, + ] + ); + + const metadataConfig = { + CONTENT: taskArgs.meta || '{"name":"test proposal"}', + TAG: "daohaus.proposal.metadata", + }; + + const setGovernanceConfig = await baal.interface.encodeFunctionData( + "setGovernanceConfig", + [governanceConfig] + ); + + const postMetaData = poster.interface.encodeFunctionData("post", [ + metadataConfig.CONTENT, + metadataConfig.TAG, + ]); + const posterFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [poster.address, 0, postMetaData] + ); + + const initalizationActions = [ + setGovernanceConfig, + posterFromBaal + ]; + + + return { + initParams: abiCoder.encode( + ["string", "string", "string", "string", "bool", "bool"], + [ + config.TOKEN_NAME, + config.TOKEN_SYMBOL, + config.LOOT_TOKEN_NAME, + config.LOOT_TOKEN_SYMBOL, + config.LOOT_TOKEN_TRANSFERABLE, + config.TOKEN_TRANSFERABLE, + ] + ), + initalizationActions, + }; + }; + + let encodedInitParams: { + initParams: string; + initalizationActions: string[]; + }; + + const deploymentConfig = { + GRACE_PERIOD_IN_SECONDS: 300, + VOTING_PERIOD_IN_SECONDS: 200, + PROPOSAL_OFFERING: 0, + SPONSOR_THRESHOLD: 1, + MIN_RETENTION_PERCENT: 0, + MIN_STAKING_PERCENT: 0, + QUORUM_PERCENT: 0, + TOKEN_NAME: "Baal Shares", + TOKEN_SYMBOL: taskArgs.name, + LOOT_TOKEN_NAME: "Baal CUST Loot", + LOOT_TOKEN_SYMBOL: taskArgs.lootname, + LOOT_TOKEN_TRANSFERABLE: taskArgs.lootpaused, + TOKEN_TRANSFERABLE: taskArgs.sharespaused, + }; + + + const baalSummoner = await hre.ethers.getContractFactory("BaalAdvTokenSummoner"); + const contract = baalSummoner.attach(taskArgs.factory); + + const posterFactory = await hre.ethers.getContractFactory("Poster"); + const posterAddress = _addresses.poster; + console.log("posterAddress", posterAddress); + + const poster = posterFactory.attach(posterAddress); + console.log("**********************"); + + const Baal = await hre.ethers.getContractFactory("Baal"); + const baalSingleton = Baal.attach(_addresses.baalDefaultSingleton); + const MultisendContract = await hre.ethers.getContractFactory("MultiSend"); + const multisend = MultisendContract.attach( + _addresses.gnosisMultisendLibrary + ); + + encodedInitParams = await getBaalParams( + baalSingleton, + deploymentConfig + ); + + const randomSeed = Math.floor(Math.random() * 10000000); + let tx; + + console.log("summon ball from tasks", encodedInitParams); + + tx = await contract.summonBaalFromReferrer( + zeroAddress, + zeroAddress, + randomSeed, + abiCoder.encode( + ["address[]", "uint256[]", "uint256[]"], + [ + summonerArr, + sharesArr, + lootArr + ] + ), + encodedInitParams.initParams, + encodedInitParams.initalizationActions + ); + + console.log(taskArgs); + // console.log("tx:", tx?.hash); + const deployers = await hre.ethers.getSigners(); + const address = await deployers[0].getAddress(); + const balance = await deployers[0].getBalance(); + console.log("Account address:", address); + console.log("Account balance:", hre.ethers.utils.formatEther(balance)); +}); \ No newline at end of file diff --git a/lib/Baal/test/BaalSafe.test.ts b/lib/Baal/test/BaalSafe.test.ts new file mode 100644 index 0000000..08e32f9 --- /dev/null +++ b/lib/Baal/test/BaalSafe.test.ts @@ -0,0 +1,3671 @@ +import { expect } from 'chai'; +import { BigNumber } from 'ethers'; +import { deployments, ethers, getChainId, getNamedAccounts, getUnnamedAccounts } from 'hardhat'; +import { calculateProxyAddress } from "@gnosis.pm/zodiac"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; + +import { + abiCoder, + defaultDAOSettings, + defaultSummonSetup, + ProposalType, + PROPOSAL_STATES, + revertMessages, + setupBaal, + SHAMAN_PERMISSIONS, + verifyProposal, +} from './utils/baal'; +import { blockTime, moveForwardPeriods } from './utils/evm'; +import { baalSetup, mockBaalLessSharesSetup, ProposalHelpers, Signer } from './utils/fixtures'; +import { calculateSafeProxyAddress, getSaltNonce } from './utils/safe'; +import signDelegation from "../src/signDelegation"; +import signVote from "../src/signVote"; +import { sharesRevertMessages } from './utils/token'; +import { + Baal, + BaalSummoner, + GnosisSafe, + GnosisSafeProxyFactory, + Loot, + ModuleProxyFactory, + MultiSend, + Poster, + Shares, + TestAvatar, + TestERC20, +} from '../src/types'; +import { encodeMultiAction, hashOperation } from '../src/util'; + +const deploymentConfig = { + ...defaultDAOSettings, + TOKEN_NAME: "Baal Shares", + TOKEN_SYMBOL: "BAAL", +}; + +describe("Baal contract", function () { + let baal: Baal; + let baalSummoner: BaalSummoner; + let lootToken: Loot; + let sharesToken: Shares; + let weth: TestERC20; + let dai: TestERC20; + let multisend: MultiSend; + let forwarder: `0x${string}`; + let gnosisSafe: GnosisSafe; + let chainId: number; + + let proposal: ProposalType; + + let users: { + [key: string]: Signer; + }; + + const yes = true; + const no = false; + + let proposalHelpers: ProposalHelpers; + + beforeEach(async function () { + + forwarder = '0x0000000000000000000000000000000000000420'; + + const { + Baal, + Loot, + Shares, + BaalSummoner, + GnosisSafe, + MultiSend, + WETH, + DAI, + signers, + helpers, + } = await baalSetup({ + daoSettings: deploymentConfig, + forwarderAddress: forwarder, + }); + + baal = Baal; + lootToken = Loot; + sharesToken = Shares; + baalSummoner = BaalSummoner; + gnosisSafe = GnosisSafe; + multisend = MultiSend; + weth = WETH; + dai = DAI; + users = signers; + + proposalHelpers = helpers; + + chainId = Number(await getChainId()); + + const selfTransferAction = encodeMultiAction( + multisend, + ["0x"], + [gnosisSafe.address], + [BigNumber.from(0)], + [0] + ); + + proposal = { + flag: 0, + data: selfTransferAction, + details: "all hail baal", + expiration: 0, + baalGas: 0, + }; + }); + + describe("constructor", function () { + it("verify deployment parameters", async () => { + const now = await blockTime(); + + const gracePeriod = await baal.gracePeriod(); + expect(gracePeriod).to.equal(deploymentConfig.GRACE_PERIOD_IN_SECONDS); + + const votingPeriod = await baal.votingPeriod(); + expect(votingPeriod).to.equal(deploymentConfig.VOTING_PERIOD_IN_SECONDS); + + const proposalOffering = await baal.proposalOffering(); + expect(proposalOffering).to.equal(deploymentConfig.PROPOSAL_OFFERING); + + expect(await sharesToken.paused()).to.equal(false); + expect(await lootToken.paused()).to.equal(false); + + const shamans = await baal.shamans(users.shaman.address); + expect(shamans).to.be.equal(7); + + const summonerLoot = await lootToken.balanceOf(users.summoner.address); + expect(summonerLoot).to.equal(defaultSummonSetup.loot); + + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + expect(summonerVotes).to.equal(users.summoner.sharesInitial); + + const summonerSelfDelegates = await sharesToken.delegates( + users.summoner.address + ); + expect(summonerSelfDelegates).to.equal(users.summoner.address); + + const summonerShares = await sharesToken.balanceOf(users.summoner.address); + expect(summonerShares).to.equal(users.summoner.sharesInitial); + + const totalLoot = await baal.totalLoot(); + expect(totalLoot).to.equal(defaultSummonSetup.loot * 2); + + const trustedForwarder = await baal.trustedForwarder(); + expect(trustedForwarder).to.equal(forwarder); + }); + }); + + describe("token ownership", function () { + it("can not transfer ownership when not owner", async () => { + expect(await lootToken.owner()).to.equal(baal.address); + + await expect(lootToken.transferOwnership(users.summoner.address)).to.be.revertedWith( + revertMessages.OwnableCallerIsNotTheOwner + ); + }); + + it("can not be upgraded when not owner", async () => { + expect(await lootToken.owner()).to.equal(baal.address); + + await expect(lootToken.upgradeTo(sharesToken.address)).to.be.revertedWith( + revertMessages.OwnableCallerIsNotTheOwner + ); + }); + + it("can renounce loot token ownership", async () => { + expect(await lootToken.owner()).to.equal(baal.address); + + + const renounceAction = lootToken.interface.encodeFunctionData( + "renounceOwnership" + ); + + const renounceFromBaal = baal.interface.encodeFunctionData( + "executeAsBaal", + [lootToken.address, 0, renounceAction] + ); + + const encodedAction = encodeMultiAction( + multisend, + [renounceFromBaal], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect( + proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ) + .to.emit(baal, "ProcessProposal") + .withArgs(1, true, false); + + expect(await lootToken.owner()).to.equal(ethers.constants.AddressZero); + }); + + + it("can renounce shares token ownership", async () => { + expect(await sharesToken.owner()).to.equal(baal.address); + + const renounceAction = sharesToken.interface.encodeFunctionData( + "renounceOwnership" + ); + + const renounceFromBaal = baal.interface.encodeFunctionData( + "executeAsBaal", + [sharesToken.address, 0, renounceAction] + ); + + const encodedAction = encodeMultiAction( + multisend, + [renounceFromBaal], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect( + proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ) + .to.emit(baal, "ProcessProposal") + .withArgs(1, true, false); + + expect(await sharesToken.owner()).to.equal(ethers.constants.AddressZero); + }); + + it("can change loot token ownership to avatar", async () => { + expect(await lootToken.owner()).to.equal(baal.address); + + const transferOwnershipAction = await lootToken.interface.encodeFunctionData( + "transferOwnership", + [gnosisSafe.address] + ); + + const transferOwnershipFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [lootToken.address, 0, transferOwnershipAction] + ); + + const encodedAction = encodeMultiAction( + multisend, + [transferOwnershipFromBaal], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect( + proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ) + .to.emit(baal, "ProcessProposal") + .withArgs(1, true, false); + + expect(await lootToken.owner()).to.equal(gnosisSafe.address); + }); + + it("can change shares token ownership to avatar", async () => { + expect(await sharesToken.owner()).to.equal(baal.address); + + const transferOwnershipAction = await sharesToken.interface.encodeFunctionData( + "transferOwnership", + [gnosisSafe.address] + ); + + const transferOwnershipFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [sharesToken.address, 0, transferOwnershipAction] + ); + + const encodedAction = encodeMultiAction( + multisend, + [transferOwnershipFromBaal], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect( + proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ) + .to.emit(baal, "ProcessProposal") + .withArgs(1, true, false); + + expect(await sharesToken.owner()).to.equal(gnosisSafe.address); + }); + + it("can eject and upgrade token with eoa", async () => { + // upgrade token contracts to remove baal deps + // call from safe + // remove baal module + + // owner should be baal + expect(await sharesToken.owner()).to.equal(baal.address); + + const transferOwnershipAction = await sharesToken.interface.encodeFunctionData( + "transferOwnership", + [users.summoner.address] + ); + + const transferOwnershipFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [sharesToken.address, 0, transferOwnershipAction] + ); + + const encodedAction = encodeMultiAction( + multisend, + [transferOwnershipFromBaal], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect( + proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ) + .to.emit(baal, "ProcessProposal") + .withArgs(1, true, false); + + expect(await sharesToken.owner()).to.equal(users.summoner.address); + + // Upgrade Token + const { BaalLessShares } = await mockBaalLessSharesSetup(); + const baalLessSharesSingleton = BaalLessShares; + + expect(await baalLessSharesSingleton.version()).to.equal(0); + + await users.summoner.shares?.upgradeToAndCall( + baalLessSharesSingleton.address, + baalLessSharesSingleton.interface.encodeFunctionData("setUp", [ + 2 + ])); + // after upgrade token should have same balances + // after upgrade token should have a version + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial); + const newTokenInterface = baalLessSharesSingleton.attach(sharesToken.address); + expect(await newTokenInterface.version()).to.equal(2); + expect(await newTokenInterface.baal()).to.equal(ethers.constants.AddressZero); + + // new owner should be able to mint + await users.summoner.shares?.mint(users.summoner.address, 100); + + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial + 100); + + }); + }); + + describe("shaman actions - permission level 7 (full)", function () { + const amountToMint = 69; + let currentTotalLoot: number; + let currentTotalShares: number; + + this.beforeEach(async function() { + currentTotalLoot = users.summoner.lootInitial + users.applicant.lootInitial; + currentTotalShares = users.summoner.sharesInitial + users.applicant.sharesInitial; + }); + + it("setAdminConfig", async () => { + await users.shaman.baal?.setAdminConfig(true, true); + expect(await sharesToken.paused()).to.equal(true); + expect(await lootToken.paused()).to.equal(true); + }); + + it("mint shares - recipient has shares", async () => { + await users.shaman.baal?.mintShares([users.summoner.address], [amountToMint]); + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial + amountToMint); + const votes = await sharesToken.getVotes(users.summoner.address); + expect(votes).to.equal(users.summoner.sharesInitial + amountToMint); + const totalShares = await baal.totalShares(); + expect(totalShares).to.equal( + users.summoner.sharesInitial + amountToMint + + users.applicant.sharesInitial + ); + }); + + it("mint shares - new recipient", async () => { + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); + await blockTime(); + expect(await sharesToken.balanceOf(users.shaman.address)).to.equal(amountToMint); + + const votes = await sharesToken.getVotes(users.shaman.address); + expect(votes).to.equal(amountToMint); + + const shamanDelegate = await sharesToken.delegates(users.shaman.address); + expect(shamanDelegate).to.equal(users.shaman.address); + }); + + it("mint shares - recipient has delegate - new shares are also delegated", async () => { + await users.summoner.shares?.delegate(users.shaman.address); + // await blockTime(); + await users.shaman.baal?.mintShares([users.summoner.address], [amountToMint]); + + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial + amountToMint); + + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + expect(summonerVotes).to.equal(0); + + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(shamanVotes).to.equal(users.summoner.sharesInitial + amountToMint); + + const summonerDelegate = await sharesToken.delegates(users.summoner.address); + expect(summonerDelegate).to.equal(users.shaman.address); + }); + + it("mint shares - zero mint amount - no votes", async () => { + await users.shaman.baal?.mintShares([users.shaman.address], [0]); + // await blockTime(); + expect(await sharesToken.balanceOf(users.shaman.address)).to.equal(0); + const votes = await sharesToken.getVotes(users.shaman.address); + expect(votes).to.equal(0); + const totalShares = await sharesToken.totalSupply(); + expect(totalShares).to.equal(currentTotalShares); + + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(shamanVotes).to.equal(0); + + const shamanDelegate = await sharesToken.delegates(users.shaman.address); + expect(shamanDelegate).to.equal(ethers.constants.AddressZero); + }); + + it("mint shares - require fail - array parity", async () => { + await expect( + users.shaman.baal?.mintShares([users.summoner.address], [amountToMint, amountToMint]) + ).to.be.revertedWith(revertMessages.mintSharesArrayParity); + }); + + it("burn shares", async () => { + await users.shaman.baal?.burnShares([users.summoner.address], [amountToMint]); + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial - amountToMint); + }); + + it("burn shares - require fail - array parity", async () => { + await expect( + users.shaman.baal?.burnShares([users.summoner.address], [amountToMint, amountToMint]) + ).to.be.revertedWith(revertMessages.burnSharesArrayParity); + }); + + it("burn shares - require fail - insufficent shares", async () => { + await expect( + users.shaman.baal?.burnShares([users.summoner.address], [users.summoner.sharesInitial + 1]) + ).to.be.revertedWith(revertMessages.burnSharesInsufficientShares); + }); + + it("mint loot", async () => { + await users.shaman.baal?.mintLoot([users.summoner.address], [amountToMint]); + expect( + await lootToken.balanceOf(users.summoner.address) + ).to.equal(defaultSummonSetup.loot + amountToMint); + expect(await baal.totalLoot()).to.equal(currentTotalLoot + amountToMint); + }); + + it("mint loot - require fail - array parity", async () => { + await expect( + users.shaman.baal?.mintLoot([users.summoner.address], [amountToMint, amountToMint]) + ).to.be.revertedWith(revertMessages.mintSharesArrayParity); + }); + + it("burn loot", async () => { + await users.shaman.baal?.burnLoot([users.summoner.address], [amountToMint]); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(defaultSummonSetup.loot - amountToMint); + expect(await baal.totalLoot()).to.equal(currentTotalLoot - amountToMint); + }); + + it("burn loot - require fail - array parity", async () => { + await expect( + users.shaman.baal?.burnLoot([users.summoner.address], [amountToMint, amountToMint]) + ).to.be.revertedWith(revertMessages.burnLootArrayParity); + }); + + it("burn loot - require fail - insufficent shares", async () => { + await expect( + users.shaman.baal?.burnLoot([users.summoner.address], [defaultSummonSetup.loot + 1]) + ).to.be.revertedWith(revertMessages.burnLootInsufficientShares); + }); + + it("set trusted forwarder", async () => { + const newForwarderAddress = '0x0000000000000000000000000000000000000421'; + await users.shaman.baal?.setTrustedForwarder(newForwarderAddress); + expect(await baal.trustedForwarder()).to.equal(newForwarderAddress); + }); + + it("have shaman mint and burn _delegated_ shares", async () => { + const minting = 100; + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal(users.applicant.sharesInitial); + + // mint shares for a separate member than the summoner + await users.shaman.baal?.mintShares([users.applicant.address], [minting]); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal(users.applicant.sharesInitial + minting); + expect(await sharesToken.delegates(users.applicant.address)).to.equal( + users.applicant.address + ); + expect(await sharesToken.getVotes(users.applicant.address)).to.equal(users.applicant.sharesInitial + minting); + expect(await sharesToken.getVotes(users.summoner.address)).to.equal(users.summoner.sharesInitial); + + // delegate shares from applicant to the summoner + // const baalAsApplicant = sharesToken.connect(applicant); + + await expect(users.applicant.shares?.delegate(users.summoner.address)) + .to.emit(sharesToken, 'DelegateChanged') + .withArgs(users.applicant.address, users.applicant.address, users.summoner.address) + .to.emit(sharesToken, 'DelegateVotesChanged') + .withArgs( + users.summoner.address, users.summoner.sharesInitial, + users.summoner.sharesInitial + users.applicant.sharesInitial + minting + ); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal(users.applicant.sharesInitial + minting); + expect(await sharesToken.delegates(users.applicant.address)).to.equal( + users.summoner.address + ); + expect(await sharesToken.getVotes(users.applicant.address)).to.equal(0); + expect(await sharesToken.getVotes(users.summoner.address)).to.equal( + users.summoner.sharesInitial + users.applicant.sharesInitial + minting + ); + + // mint shares for the delegator + await expect(users.shaman.baal?.mintShares([users.applicant.address], [minting])) + .to.emit(sharesToken, 'DelegateVotesChanged') + .withArgs( + users.summoner.address, + users.summoner.sharesInitial + users.applicant.sharesInitial + minting, + users.summoner.sharesInitial + users.applicant.sharesInitial + 2 * minting + ); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal( + users.applicant.sharesInitial + 2 * minting + ); + expect(await sharesToken.delegates(users.applicant.address)).to.equal( + users.summoner.address + ); + expect(await sharesToken.getVotes(users.applicant.address)).to.equal(0); + expect(await sharesToken.getVotes(users.summoner.address)).to.equal( + users.summoner.sharesInitial + users.applicant.sharesInitial + 2 * minting + ); + + // burn shares for the delegator + await users.shaman.baal?.burnShares([users.applicant.address], [minting]); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal( + defaultSummonSetup.shares + minting + ); + expect(await sharesToken.delegates(users.applicant.address)).to.equal( + users.summoner.address + ); + expect(await sharesToken.getVotes(users.applicant.address)).to.equal( + defaultSummonSetup.shares - minting + ); + expect(await sharesToken.getVotes(users.summoner.address)).to.equal( + users.summoner.sharesInitial + users.applicant.sharesInitial + minting + ); + }); + + it("setGovernanceConfig", async () => { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [10, 20, 50, 1, 2, 3] + ); + + await users.shaman.baal?.setGovernanceConfig(governanceConfig); + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + const offering = await baal.proposalOffering(); + const quorum = await baal.quorumPercent(); + const sponsorThreshold = await baal.sponsorThreshold(); + const minRetentionPercent = await baal.minRetentionPercent(); + expect(voting).to.be.equal(10); + expect(grace).to.be.equal(20); + expect(offering).to.be.equal(50); + expect(quorum).to.be.equal(1); + expect(sponsorThreshold).to.be.equal(2); + expect(minRetentionPercent).to.equal(3); + }); + + it("setGovernanceConfig - doesnt set voting/grace if =0", async () => { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [0, 0, 50, 1, 2, 3] + ); + + await users.shaman.baal?.setGovernanceConfig(governanceConfig); + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + const offering = await baal.proposalOffering(); + const quorum = await baal.quorumPercent(); + const sponsorThreshold = await baal.sponsorThreshold(); + const minRetentionPercent = await baal.minRetentionPercent(); + expect(voting).to.be.equal(deploymentConfig.VOTING_PERIOD_IN_SECONDS); + expect(grace).to.be.equal(deploymentConfig.GRACE_PERIOD_IN_SECONDS); + expect(offering).to.be.equal(50); + expect(quorum).to.be.equal(1); + expect(sponsorThreshold).to.be.equal(2); + expect(minRetentionPercent).to.equal(3); + }); + + it("cancelProposal - happy case - as gov shaman", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.shaman.baal?.cancelProposal(1); // cancel as gov shaman + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + }); + + it("cancelProposal - happy case - as proposal sponsor", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.cancelProposal(1); // cancel as sponsor + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + }); + + // TODO: get prior votes is 100 and threshold is 1 + it("cancelProposal - happy case - after undelegation", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + // transfer all shares/votes to shaman + await users.summoner.shares?.transfer( + users.shaman.address, + users.summoner.sharesInitial + ); + await users.applicant.baal?.cancelProposal(1); // cancel as rando + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + }); + + it("cancelProposal - require fail - not cancellable by rando", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + expect(users.applicant.baal?.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotCancellable + ); + }); + + it("cancelProposal - require fail - !voting (submitted)", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.SUBMITTED); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + + it("cancelProposal - require fail - !voting (grace)", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + // add 1 extra second to push us into grace period + await moveForwardPeriods( + defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, + 1, + 1 + ); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.GRACE); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + + it("cancelProposal - require fail - !voting (defeated)", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.DEEFEATED); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + + it("cancelProposal - require fail - !voting (cancelled)", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.cancelProposal(1); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + + it("cancelProposal - require fail - !voting (ready)", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.READY); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + + it("cancelProposal - require fail - !voting (processed)", async () => { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.PROCESSED); + await expect(baal.cancelProposal(1)).to.be.revertedWith( + revertMessages.cancelProposalNotVoting + ); + }); + }); + + describe("shaman permissions: 0-6", function () { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [10, 20, 50, 1, 2, 3] + ); + const newForwarderAddress = '0x0000000000000000000000000000000000000421'; + + beforeEach(async function () { + const shamanAddresses = [ + users.shaman.address, + users.s1.address, + users.s2.address, + users.s3.address, + users.s4.address, + users.s5.address, + users.s6.address, + ]; + const permissions = [0, 1, 2, 3, 4, 5, 6]; + const setShaman = baal.interface.encodeFunctionData("setShamans", [ + shamanAddresses, + permissions, + ]); + const setShamanAction = encodeMultiAction( + multisend, + [setShaman], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = setShamanAction; + proposal.details = 'Shaman Proposal'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + const shamanPermission = await baal.shamans(users.shaman.address); + expect(shamanPermission).to.equal(0); + }); + + it("permission = 0 - all actions fail", async () => { + // admin + await expect(users.shaman.baal?.setAdminConfig(true, true)).to.be.revertedWith( + revertMessages.baalOrAdmin + ); + + // manager + await expect( + users.shaman.baal?.mintShares([users.shaman.address], [69]) + ).to.be.revertedWith(revertMessages.baalOrManager); + await expect( + users.shaman.baal?.burnShares([users.shaman.address], [69]) + ).to.be.revertedWith(revertMessages.baalOrManager); + await expect( + users.shaman.baal?.mintLoot([users.shaman.address], [69]) + ).to.be.revertedWith(revertMessages.baalOrManager); + await expect( + users.shaman.baal?.burnLoot([users.shaman.address], [69]) + ).to.be.revertedWith(revertMessages.baalOrManager); + + // governor + await expect( + users.shaman.baal?.setGovernanceConfig(governanceConfig) + ).to.be.revertedWith(revertMessages.baalOrGovernor); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await expect(users.shaman.baal?.cancelProposal(2)).to.be.revertedWith( + revertMessages.cancelProposalNotCancellable + ); + await expect(users.shaman.baal?.setTrustedForwarder(forwarder)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + }); + + it("permission = 1 - admin actions succeed", async () => { + // admin - success + await users.s1.baal?.setAdminConfig(true, true); + expect(await sharesToken.paused()).to.equal(true); + expect(await lootToken.paused()).to.equal(true); + + // manager - fail + expect(users.s1.baal?.mintShares([users.s1.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s1.baal?.burnShares([users.s1.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s1.baal?.mintLoot([users.s1.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s1.baal?.burnLoot([users.s1.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + + // governor - fail + expect(users.s1.baal?.setGovernanceConfig(governanceConfig)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + expect(users.s1.baal?.setTrustedForwarder(forwarder)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + expect(users.s1.baal?.cancelProposal(2)).to.be.revertedWith( + revertMessages.cancelProposalNotCancellable + ); + }); + + it("permission = 2 - manager actions succeed", async () => { + // admin - fail + expect(users.s2.baal?.setAdminConfig(true, true)).to.be.revertedWith( + revertMessages.baalOrAdmin + ); + + // manager - success + await users.s2.baal?.mintShares([users.s2.address], [69]); + expect(await sharesToken.balanceOf(users.s2.address)).to.equal(69); + await users.s2.baal?.burnShares([users.s2.address], [69]); + expect(await sharesToken.balanceOf(users.s2.address)).to.equal(0); + await users.s2.baal?.mintLoot([users.s2.address], [69]); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(69); + await users.s2.baal?.burnLoot([users.s2.address], [69]); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(0); + + // cleanup - mint summoner shares so they can submit/sponsor + await users.s2.baal?.mintShares([users.summoner.address], [100]); + + // governor - fail + expect(users.s2.baal?.setGovernanceConfig(governanceConfig)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + await expect(users.s2.baal?.setTrustedForwarder(forwarder)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + expect(users.s2.baal?.cancelProposal(2)).to.be.revertedWith( + revertMessages.cancelProposalNotCancellable + ); + }); + + it("permission = 3 - admin + manager actions succeed", async () => { + // admin - success + await users.s3.baal?.setAdminConfig(true, true); + expect(await sharesToken.paused()).to.equal(true); + expect(await lootToken.paused()).to.equal(true); + + // manager - success + await users.s3.baal?.mintShares([users.s3.address], [69]); + expect(await sharesToken.balanceOf(users.s3.address)).to.equal(69); + await users.s3.baal?.burnShares([users.s3.address], [69]); + expect(await sharesToken.balanceOf(users.s3.address)).to.equal(0); + await users.s3.baal?.mintLoot([users.s3.address], [69]); + expect(await lootToken.balanceOf(users.s3.address)).to.equal(69); + await users.s3.baal?.burnLoot([users.s3.address], [69]); + expect(await lootToken.balanceOf(users.s3.address)).to.equal(0); + + // cleanup - mint summoner shares so they can submit/sponsor + await users.s3.baal?.mintShares([users.summoner.address], [100]); + + // governor - fail + expect(users.s3.baal?.setGovernanceConfig(governanceConfig)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + expect(users.s3.baal?.setTrustedForwarder(forwarder)).to.be.revertedWith( + revertMessages.baalOrGovernor + ); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + expect(users.s3.baal?.cancelProposal(2)).to.be.revertedWith( + revertMessages.cancelProposalNotCancellable + ); + }); + + it("permission = 4 - governor actions succeed", async () => { + // admin - fail + await expect(users.s4.baal?.setAdminConfig(true, true)).to.be.revertedWith( + revertMessages.baalOrAdmin + ); + + // manager - fail + await expect(users.s4.baal?.mintShares([users.s4.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + await expect(users.s4.baal?.burnShares([users.s4.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + await expect(users.s4.baal?.mintLoot([users.s4.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + await expect(users.s4.baal?.burnLoot([users.s4.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + + // governor - succeed + await users.s4.baal?.setGovernanceConfig(governanceConfig); + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + const offering = await baal.proposalOffering(); + const quorum = await baal.quorumPercent(); + const sponsorThreshold = await baal.sponsorThreshold(); + expect(voting).to.be.equal(10); + expect(grace).to.be.equal(20); + expect(offering).to.be.equal(50); + expect(quorum).to.be.equal(1); + expect(sponsorThreshold).to.be.equal(2); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.s4.baal?.cancelProposal(2); + const state = await baal.state(2); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + + await users.s4.baal?.setTrustedForwarder(newForwarderAddress); + expect(await users.s4.baal?.trustedForwarder()).to.equal(newForwarderAddress); + }); + + it("permission = 5 - admin + governor actions succeed", async () => { + // admin - success + await users.s5.baal?.setAdminConfig(true, true); + expect(await sharesToken.paused()).to.equal(true); + expect(await lootToken.paused()).to.equal(true); + + // manager - fail + expect(users.s5.baal?.mintShares([users.s5.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s5.baal?.burnShares([users.s5.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s5.baal?.mintLoot([users.s5.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + expect(users.s5.baal?.burnLoot([users.s5.address], [69])).to.be.revertedWith( + revertMessages.baalOrManager + ); + + // governor - succeed + await users.s5.baal?.setGovernanceConfig(governanceConfig); + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + const offering = await baal.proposalOffering(); + const quorum = await baal.quorumPercent(); + const sponsorThreshold = await baal.sponsorThreshold(); + expect(voting).to.be.equal(10); + expect(grace).to.be.equal(20); + expect(offering).to.be.equal(50); + expect(quorum).to.be.equal(1); + expect(sponsorThreshold).to.be.equal(2); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.s5.baal?.cancelProposal(2); + const state = await baal.state(2); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + + await users.s5.baal?.setTrustedForwarder(newForwarderAddress); + expect(await users.s5.baal?.trustedForwarder()).to.equal(newForwarderAddress); + }); + + it("permission = 6 - manager + governor actions succeed", async () => { + // admin - fail + expect(users.s6.baal?.setAdminConfig(true, true)).to.be.revertedWith( + revertMessages.baalOrAdmin + ); + + // manager - success + await users.s6.baal?.mintShares([users.s6.address], [69]); + expect(await sharesToken.balanceOf(users.s6.address)).to.equal(69); + await users.s6.baal?.burnShares([users.s6.address], [69]); + expect(await sharesToken.balanceOf(users.s6.address)).to.equal(0); + await users.s6.baal?.mintLoot([users.s6.address], [69]); + expect(await lootToken.balanceOf(users.s6.address)).to.equal(69); + await users.s6.baal?.burnLoot([users.s6.address], [69]); + expect(await lootToken.balanceOf(users.s6.address)).to.equal(0); + + // cleanup - mint summoner shares so they can submit/sponsor + await users.s6.baal?.mintShares([users.summoner.address], [100]); + + // governor - succeed + await users.s6.baal?.setGovernanceConfig(governanceConfig); + const voting = await baal.votingPeriod(); + const grace = await baal.gracePeriod(); + const offering = await baal.proposalOffering(); + const quorum = await baal.quorumPercent(); + const sponsorThreshold = await baal.sponsorThreshold(); + expect(voting).to.be.equal(10); + expect(grace).to.be.equal(20); + expect(offering).to.be.equal(50); + expect(quorum).to.be.equal(1); + expect(sponsorThreshold).to.be.equal(2); + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.s6.baal?.cancelProposal(2); + const state = await baal.state(2); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + + await users.s6.baal?.setTrustedForwarder(newForwarderAddress); + expect(await users.s6.baal?.trustedForwarder()).to.equal(newForwarderAddress); + }); + }); + + describe("shaman locks", function () { + + it("lockAdmin", async function () { + const lockAdmin = baal.interface.encodeFunctionData("lockAdmin"); + const lockAdminAction = encodeMultiAction( + multisend, + [lockAdmin], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = lockAdminAction; + proposal.details = 'Shaman Locks'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.adminLock()).to.equal(true); + }); + + it("lockManager", async () => { + const lockManager = baal.interface.encodeFunctionData( + "lockManager" + ); + const lockManagerAction = encodeMultiAction( + multisend, + [lockManager], + [baal.address], + [BigNumber.from(0)], + [0] + ); + proposal.data = lockManagerAction; + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.managerLock()).to.equal(true); + }); + + it("lockGovernor", async () => { + const lockGovernor = await baal.interface.encodeFunctionData( + "lockGovernor" + ); + const lockGovernorAction = encodeMultiAction( + multisend, + [lockGovernor], + [baal.address], + [BigNumber.from(0)], + [0] + ); + proposal.data = lockGovernorAction; + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.governorLock()).to.equal(true); + }); + }); + + describe("setShamans - adminLock (1, 3, 5, 7)", function () { + + beforeEach(async function () { + const lockAdmin = baal.interface.encodeFunctionData("lockAdmin"); + const lockAdminAction = encodeMultiAction( + multisend, + [lockAdmin], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = lockAdminAction; + proposal.details = 'Admin Locks'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.adminLock()).to.equal(true); + }); + + it("setShamans - 0 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, 0); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + + it("setShamans - 1 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 2 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.MANAGER); + }); + + it("setShamans - 3 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 4 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.GOVERNANCE); + }); + + it("setShamans - 5 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 6 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.MANAGER_GOVERNANCE); + }); + + it("setShamans - 7 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.summoner.address, SHAMAN_PERMISSIONS.ALL); // use summoner bc shaman default = 7 + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.summoner.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + }); + + describe("setShamans - managerLock (2, 3, 6, 7)", function () { + beforeEach(async function () { + const lockManager = baal.interface.encodeFunctionData( + "lockManager" + ); + const lockManagerAction = encodeMultiAction( + multisend, + [lockManager], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = lockManagerAction; + proposal.details = 'Manager Locks'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.managerLock()).to.equal(true); + }); + + it("setShamans - 0 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.NONE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + + it("setShamans - 1 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ADMIN); + }); + + it("setShamans - 2 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 3 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 4 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.GOVERNANCE); + }); + + it("setShamans - 5 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ADMIN_GOVERNANCE); + }); + + it("setShamans - 6 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 7 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.summoner.address, SHAMAN_PERMISSIONS.ALL); // use summoner bc shaman default = 7 + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.summoner.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + }); + + describe("setShamans - governorLock (4, 5, 6, 7)", function () { + beforeEach(async function () { + const lockGovernor = baal.interface.encodeFunctionData( + "lockGovernor" + ); + const lockGovernorAction = encodeMultiAction( + multisend, + [lockGovernor], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = lockGovernorAction; + proposal.details = 'Governor Locks'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.governorLock()).to.equal(true); + }); + + it("setShamans - 0 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.NONE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + + it("setShamans - 1 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ADMIN); + }); + + it("setShamans - 2 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.MANAGER); + }); + + it("setShamans - 3 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ADMIN_MANAGER); + }); + + it("setShamans - 4 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 5 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 6 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 7 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.summoner.address, SHAMAN_PERMISSIONS.ALL); // use summoner bc shaman default = 7 + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.summoner.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + }); + + describe("setShamans - all locked", function () { + beforeEach(async function () { + const lockAdmin = baal.interface.encodeFunctionData("lockAdmin"); + const lockManager = baal.interface.encodeFunctionData( + "lockManager" + ); + const lockGovernor = baal.interface.encodeFunctionData( + "lockGovernor" + ); + const lockAllAction = encodeMultiAction( + multisend, + [lockAdmin, lockManager, lockGovernor], + [baal.address, baal.address, baal.address], + [BigNumber.from(0), BigNumber.from(0), BigNumber.from(0)], + [0, 0, 0] + ); + + proposal.data = lockAllAction; + proposal.details = 'Locks All'; + + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await baal.submitVote(1, true); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + expect(await baal.adminLock()).to.equal(true); + expect(await baal.managerLock()).to.equal(true); + expect(await baal.governorLock()).to.equal(true); + }); + + it("setShamans - 0 - success", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.NONE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, false]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + + it("setShamans - 1 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 2 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 3 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_MANAGER); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 4 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 5 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.ADMIN_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 6 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.shaman.address, SHAMAN_PERMISSIONS.MANAGER_GOVERNANCE); + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.shaman.address)).to.equal(SHAMAN_PERMISSIONS.ALL); + }); + + it("setShamans - 7 - fail", async () => { + const id = await proposalHelpers.setShamanProposal(baal, multisend, users.summoner.address, SHAMAN_PERMISSIONS.ALL); // use summoner bc shaman default = 7 + const propStatus = await baal.getProposalStatus(id); + expect(propStatus).to.eql([false, true, true, true]); // [cancelled, processed, passed, actionFailed] + expect(await baal.shamans(users.summoner.address)).to.equal(SHAMAN_PERMISSIONS.NONE); + }); + }); + + // ----------------------------------------------------------- + // ------------------ SHARES --------------------------------- + // ----------------------------------------------------------- + + describe("erc20 shares - approve", function () { + const amountToApprove = 20; + + it("happy case", async () => { + await users.summoner.shares?.approve(users.shaman.address, amountToApprove); + const allowance = await sharesToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance).to.equal(amountToApprove); + }); + + it("overwrites previous value", async () => { + await users.summoner.shares?.approve(users.shaman.address, amountToApprove); + const allowance = await sharesToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance).to.equal(amountToApprove); + + await users.summoner.shares?.approve(users.shaman.address, 50); + const allowance2 = await sharesToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance2).to.equal(50); + }); + }); + + describe("erc20 shares - transfer", function () { + + it("transfer to first time recipient - auto self delegates", async () => { + await users.summoner.shares?.transfer( + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + + const summonerBalance = await sharesToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await sharesToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(summonerBalance).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(summonerVotes).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanBalance).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanVotes).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + + const summonerCheckpoints = await sharesToken.numCheckpoints( + users.summoner.address + ); + const shamanCheckpoints = await sharesToken.numCheckpoints( + users.shaman.address + ); + const summonerCP0 = await sharesToken.checkpoints(users.summoner.address, 0); + const summonerCP1 = await sharesToken.checkpoints(users.summoner.address, 1); + const shamanCP0 = await sharesToken.checkpoints(users.shaman.address, 0); + const shamanCP1 = await sharesToken.checkpoints(users.shaman.address, 1); + expect(summonerCheckpoints).to.equal(2); + expect(shamanCheckpoints).to.equal(1); + expect(summonerCP0.votes).to.equal(users.summoner.sharesInitial); + expect(summonerCP1.votes).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanCP0.votes).to.equal(1); + expect(shamanCP1.fromTimePoint).to.equal(0); // checkpoint DNE + + const delegate = await sharesToken.delegates(users.shaman.address); + expect(delegate).to.equal(users.shaman.address); + }); + + it("require fails - shares paused", async () => { + await users.shaman.baal?.setAdminConfig(true, false); // pause shares + await expect( + users.summoner.shares?.transfer(users.shaman.address, deploymentConfig.SPONSOR_THRESHOLD) + ).to.be.revertedWith(revertMessages.sharesTransferPaused); + }); + + it("require fails - insufficient balance", async () => { + await expect( + users.summoner.shares?.transfer(users.shaman.address, users.summoner.sharesInitial + 1) + ).to.be.revertedWith(revertMessages.sharesInsufficientBalance); + }); + + it("0 transfer - doesnt update delegates", async () => { + await users.summoner.shares?.transfer(users.shaman.address, 0); + const summonerBalance = await sharesToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await sharesToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(summonerBalance).to.equal(users.summoner.sharesInitial); + expect(summonerVotes).to.equal(users.summoner.sharesInitial); + expect(shamanBalance).to.equal(0); + expect(shamanVotes).to.equal(0); + + const summonerCheckpoints = await sharesToken.numCheckpoints( + users.summoner.address + ); + const shamanCheckpoints = await sharesToken.numCheckpoints( + users.shaman.address + ); + const summonerCP0 = await sharesToken.checkpoints(users.summoner.address, 0); + const shamanCP0 = await sharesToken.checkpoints(users.shaman.address, 0); + expect(summonerCheckpoints).to.equal(1); + expect(shamanCheckpoints).to.equal(0); + expect(summonerCP0.votes).to.equal(users.summoner.sharesInitial); + expect(shamanCP0.fromTimePoint).to.equal(0); // checkpoint DNE + }); + + it("self transfer - doesnt update delegates", async () => { + await users.summoner.shares?.transfer(users.summoner.address, 10); + const summonerBalance = await sharesToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + expect(summonerBalance).to.equal(users.summoner.sharesInitial); + expect(summonerVotes).to.equal(users.summoner.sharesInitial); + + const summonerCheckpoints = await sharesToken.numCheckpoints( + users.summoner.address + ); + const summonerCP0 = await sharesToken.checkpoints(users.summoner.address, 0); + expect(summonerCheckpoints).to.equal(1); + expect(summonerCP0.votes).to.equal(users.summoner.sharesInitial); + }); + + it("transferring to shareholder w/ delegate assigns votes to delegate", async () => { + await users.summoner.shares?.transfer( + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + await users.shaman.shares?.delegate(users.applicant.address); // set shaman delegate -> applicant + await users.summoner.shares?.transfer( + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + + const summonerBalance = await sharesToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await sharesToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + const applicantBalance = await sharesToken.balanceOf(users.applicant.address); + const applicantVotes = await sharesToken.getVotes(users.applicant.address); + expect(summonerBalance).to.equal(users.summoner.sharesInitial - 2 * deploymentConfig.SPONSOR_THRESHOLD); + expect(summonerVotes).to.equal(users.summoner.sharesInitial - 2 * deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanBalance).to.equal(2 * deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanVotes).to.equal(0); + expect(applicantBalance).to.equal(defaultSummonSetup.shares); + expect(applicantVotes).to.equal(defaultSummonSetup.shares + 2 * deploymentConfig.SPONSOR_THRESHOLD); + + const delegate = await sharesToken.delegates(users.shaman.address); + expect(delegate).to.equal(users.applicant.address); + + const summonerCheckpoints = await sharesToken.numCheckpoints( + users.summoner.address + ); + const shamanCheckpoints = await sharesToken.numCheckpoints( + users.shaman.address + ); + const applicantCheckpoints = await sharesToken.numCheckpoints( + users.applicant.address + ); + const summonerCP0 = await sharesToken.checkpoints(users.summoner.address, 0); + const summonerCP1 = await sharesToken.checkpoints(users.summoner.address, 1); + const summonerCP2 = await sharesToken.checkpoints(users.summoner.address, 2); + const shamanCP0 = await sharesToken.checkpoints(users.shaman.address, 0); + const shamanCP1 = await sharesToken.checkpoints(users.shaman.address, 1); + const applicantCP0 = await sharesToken.checkpoints(users.applicant.address, 0); + const applicantCP1 = await sharesToken.checkpoints(users.applicant.address, 1); + const applicantCP2 = await sharesToken.checkpoints(users.applicant.address, 2); + expect(summonerCheckpoints).to.equal(3); + expect(shamanCheckpoints).to.equal(2); + expect(applicantCheckpoints).to.equal(3); + expect(summonerCP0.votes).to.equal(users.summoner.sharesInitial); + expect(summonerCP1.votes).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(summonerCP2.votes).to.equal(users.summoner.sharesInitial - 2 * deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanCP0.votes).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanCP1.votes).to.equal(0); + expect(applicantCP0.votes).to.equal(defaultSummonSetup.shares); + expect(applicantCP1.votes).to.equal(defaultSummonSetup.shares + deploymentConfig.SPONSOR_THRESHOLD); + expect(applicantCP2.votes).to.equal(defaultSummonSetup.shares + 2 * deploymentConfig.SPONSOR_THRESHOLD); + }); + }); + + describe("erc20 shares - transferFrom", function () { + it("transfer to first time recipient", async () => { + await users.summoner.shares?.approve( + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + + const allowanceBefore = await sharesToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowanceBefore).to.equal(1); + + await users.shaman.shares?.transferFrom( + users.summoner.address, + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + + const allowanceAfter = await sharesToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowanceAfter).to.equal(0); + + const summonerBalance = await sharesToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await sharesToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(summonerBalance).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(summonerVotes).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanBalance).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanVotes).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + + const summonerCheckpoints = await sharesToken.numCheckpoints( + users.summoner.address + ); + const shamanCheckpoints = await sharesToken.numCheckpoints( + users.shaman.address + ); + const summonerCP0 = await sharesToken.checkpoints(users.summoner.address, 0); + const summonerCP1 = await sharesToken.checkpoints(users.summoner.address, 1); + const shamanCP0 = await sharesToken.checkpoints(users.shaman.address, 0); + const shamanCP1 = await sharesToken.checkpoints(users.shaman.address, 1); + expect(summonerCheckpoints).to.equal(2); + expect(shamanCheckpoints).to.equal(1); + expect(summonerCP0.votes).to.equal(users.summoner.sharesInitial); + expect(summonerCP1.votes).to.equal(users.summoner.sharesInitial - deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanCP0.votes).to.equal(deploymentConfig.SPONSOR_THRESHOLD); + expect(shamanCP1.fromTimePoint).to.equal(0); // checkpoint DNE + }); + + it("require fails - shares paused", async () => { + await users.shaman.baal?.setAdminConfig(true, false); // pause shares + await users.shaman.shares?.approve( + users.summoner.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + await expect( + users.summoner.shares?.transferFrom( + users.shaman.address, + users.summoner.address, + deploymentConfig.SPONSOR_THRESHOLD + ) + ).to.be.revertedWith(revertMessages.sharesTransferPaused); + }); + + it("require fails - insufficeint approval", async () => { + await sharesToken.approve(users.shaman.address, 1); + + await expect( + sharesToken.transferFrom(users.summoner.address, users.shaman.address, 2) + ).to.be.revertedWith(revertMessages.sharesInsufficientApproval); + }); + }); + + // ----------------------------------------------------------- + // ------------------ LOOT ----------------------------------- + // ----------------------------------------------------------- + + describe("erc20 loot - approve", function () { + const amountToTransfer = 20; + + it("happy case", async () => { + await users.summoner.loot?.approve(users.shaman.address, amountToTransfer); + const allowance = await lootToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance).to.equal(amountToTransfer); + }); + + it("overwrites previous value", async () => { + await users.summoner.loot?.approve(users.shaman.address, amountToTransfer); + const allowance = await lootToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance).to.equal(amountToTransfer); + + await users.summoner.loot?.approve(users.shaman.address, 50); + const allowance2 = await lootToken.allowance( + users.summoner.address, + users.shaman.address + ); + expect(allowance2).to.equal(50); + }); + }); + + describe("erc20 loot - transfer", function () { + const amountToTransfer = 500; + it("sends tokens, not votes", async () => { + await users.summoner.loot?.transfer(users.shaman.address, amountToTransfer); + const summonerBalance = await lootToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await lootToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(summonerBalance).to.equal(defaultSummonSetup.loot - amountToTransfer); + expect(summonerVotes).to.equal(users.summoner.sharesInitial); + expect(shamanBalance).to.equal(amountToTransfer); + expect(shamanVotes).to.equal(0); + }); + + it("require fails - loot paused", async () => { + await users.shaman.baal?.setAdminConfig(false, true); // pause loot + await expect(users.summoner.loot?.transfer(users.shaman.address, 1)).to.be.revertedWith( + revertMessages.lootTransferPaused + ); + }); + + it("require fails - insufficient balance", async () => { + await expect(lootToken.transfer(users.shaman.address, 501)).to.be.revertedWith( + revertMessages.lootInsufficientBalance + ); + }); + }); + + describe("erc20 loot - transferFrom", function () { + const amountToTransfer = 500; + + it("sends tokens, not votes", async () => { + await users.summoner.loot?.approve(users.shaman.address, amountToTransfer); + await users.shaman.loot?.transferFrom(users.summoner.address, users.shaman.address, amountToTransfer); + const summonerBalance = await lootToken.balanceOf(users.summoner.address); + const summonerVotes = await sharesToken.getVotes(users.summoner.address); + const shamanBalance = await lootToken.balanceOf(users.shaman.address); + const shamanVotes = await sharesToken.getVotes(users.shaman.address); + expect(summonerBalance).to.equal(0); + expect(summonerVotes).to.equal(users.summoner.sharesInitial); + expect(shamanBalance).to.equal(amountToTransfer); + expect(shamanVotes).to.equal(0); + }); + + it("require fails - loot paused", async () => { + await users.shaman.baal?.setAdminConfig(false, true); // pause loot + await users.summoner.loot?.approve(users.shaman.address, amountToTransfer); + await expect( + users.shaman.loot?.transferFrom(users.summoner.address, users.shaman.address, amountToTransfer) + ).to.be.revertedWith(revertMessages.lootTransferPaused); + }); + + it("require fails - insufficient balance", async () => { + const toTransfer = defaultSummonSetup.loot + 1 + await users.summoner.loot?.approve(users.shaman.address, toTransfer); + await expect( + users.shaman.loot?.transferFrom(users.summoner.address, users.shaman.address, toTransfer) + ).to.be.revertedWith(revertMessages.lootInsufficientBalance); + }); + + it("require fails - insufficeint approval", async () => { + await users.summoner.loot?.approve(users.shaman.address, defaultSummonSetup.loot - 1); + await expect( + users.shaman.loot?.transferFrom(users.summoner.address, users.shaman.address, defaultSummonSetup.loot) + ).to.be.revertedWith(revertMessages.lootInsufficientApproval); + }); + }); + + // ----------------------------------------------------------- + // ------------------ PROPOSALS ------------------------------ + // ----------------------------------------------------------- + + describe("submitProposal", function () { + it("happy case", async () => { + // note - this also tests that members can submit proposals without offering tribute + // note - this also tests that member proposals are self-sponsored (bc votingStarts != 0) + const countBefore = await baal.proposalCount(); + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + // TODO test return value - use a helper contract to submit + save the returned ID + + const now = await blockTime(); + + const countAfter = await baal.proposalCount(); + expect(countAfter).to.equal(countBefore + 1); + + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.VOTING); + + const proposalData = await baal.proposals(1); + expect(proposalData.id).to.equal(1); + expect(proposalData.votingStarts).to.equal(now); + expect(proposalData.votingEnds).to.equal( + now + deploymentConfig.VOTING_PERIOD_IN_SECONDS + ); + expect(proposalData.yesVotes).to.equal(0); + expect(proposalData.noVotes).to.equal(0); + expect(proposalData.expiration).to.equal(proposal.expiration); + expect(hashOperation(proposal.data)).to.equal( + proposalData.proposalDataHash + ); + const proposalStatus = await baal.getProposalStatus(1); + expect(proposalStatus).to.eql([false, false, false, false]); + }); + + it("require fail - expiration passed", async () => { + const now = await blockTime(); + + await expect( + baal.submitProposal( + proposal.data, + now, + proposal.baalGas, + ethers.utils.id(proposal.details) + ) + ).to.be.revertedWith(revertMessages.submitProposalExpired); + }); + + it("edge case - expiration exists, but far enough ahead", async () => { + const countBefore = await baal.proposalCount(); + const expiration = + (await blockTime()) + + deploymentConfig.VOTING_PERIOD_IN_SECONDS + + deploymentConfig.GRACE_PERIOD_IN_SECONDS + + 10000; + await users.summoner.baal?.submitProposal( + proposal.data, + expiration, + 0, + ethers.utils.id(proposal.details) + ); + + const countAfter = await baal.proposalCount(); + expect(countAfter).to.equal(countBefore + 1); + + const proposalData = await baal.proposals(1); + expect(proposalData.id).to.equal(1); + }); + }); + + describe("sponsorProposal", function () { + it("happy case", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + const proposalData = await baal.proposals(1); + expect(proposalData.votingStarts).to.equal(0); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.SUBMITTED); + + await users.summoner.baal?.sponsorProposal(1); + const now = await blockTime(); + const proposalDataSponsored = await baal.proposals(1); + expect(proposalDataSponsored.votingStarts).to.equal(now); + expect(proposalDataSponsored.votingEnds).to.equal( + now + deploymentConfig.VOTING_PERIOD_IN_SECONDS + ); + + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.VOTING); + }); + + it("require fail - proposal expired", async () => { + const now = await blockTime(); + + const expiration = + now + + deploymentConfig.VOTING_PERIOD_IN_SECONDS + + deploymentConfig.GRACE_PERIOD_IN_SECONDS + + 1000; + + await users.shaman.baal?.submitProposal( + proposal.data, + expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + + // TODO: fix + await expect(baal.sponsorProposal(1)).to.be.revertedWith( + revertMessages.sponsorProposalExpired + ); + }); + + it("edge case - expiration exists, but far enough ahead 2", async () => { + const now = await blockTime(); + const expiration = + now + + deploymentConfig.VOTING_PERIOD_IN_SECONDS + + deploymentConfig.GRACE_PERIOD_IN_SECONDS + + 100000; + await baal.submitProposal( + proposal.data, + expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + const proposalDataSponsored = await baal.proposals(1); + const now2 = await blockTime(); + + expect(proposalDataSponsored.votingStarts).to.equal(now2); + }); + + it("require fail - not sponsor", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + await expect(users.shaman.baal?.sponsorProposal(1)).to.be.revertedWith( + revertMessages.proposalNotSponsored + ); + }); + + it("edge case - just enough shares to sponsor", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + const proposalData = await baal.proposals(1); + expect(proposalData.votingStarts).to.equal(0); + + await users.summoner.shares?.transfer( + users.shaman.address, + deploymentConfig.SPONSOR_THRESHOLD + ); + + await users.shaman.baal?.sponsorProposal(1); + const now = await blockTime(); + const proposalDataSponsored = await baal.proposals(1); + expect(proposalDataSponsored.votingStarts).to.equal(now); + }); + + it("require fail - proposal doesnt exist", async () => { + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.UNBORN); + await expect(baal.sponsorProposal(1)).to.be.revertedWith( + revertMessages.sponsorProposalNotSubmitted + ); + }); + + it("require fail - already sponsored", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + const proposalData = await baal.proposals(1); + expect(proposalData.votingStarts).to.equal(0); + await users.summoner.baal?.sponsorProposal(1); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.VOTING); + await expect(users.summoner.baal?.sponsorProposal(1)).to.be.revertedWith( + revertMessages.sponsorProposalNotSubmitted + ); + }); + }); + + describe("submitVote (w/ auto self-sponsor)", function () { + beforeEach(async function () { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + }); + + it("happy case - yes vote", async () => { + await users.summoner.baal?.submitVote(1, yes); + const prop = await baal.proposals(1); + const nCheckpoints = await sharesToken.numCheckpoints(users.summoner.address); + const votes = ( + await sharesToken.checkpoints(users.summoner.address, nCheckpoints.sub(1)) + ).votes; + const priorVotes = await sharesToken.getPastVotes( + users.summoner.address, + prop.votingStarts + ); + expect(priorVotes).to.equal(votes); + expect(prop.yesVotes).to.equal(votes); + expect(prop.maxTotalSharesAndLootAtVote) + .to.equal(defaultSummonSetup.shares * 3 + defaultSummonSetup.loot * 2); + }); + + it("happy case - no vote", async () => { + await users.summoner.baal?.submitVote(1, no); + const prop = await baal.proposals(1); + const nCheckpoints = await sharesToken.numCheckpoints(users.summoner.address); + const votes = ( + await sharesToken.checkpoints(users.summoner.address, nCheckpoints.sub(1)) + ).votes; + expect(prop.noVotes).to.equal(votes); + }); + + it("require fail - voting period has ended", async () => { + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.DEEFEATED); + await expect(users.summoner.baal?.submitVote(1, no)).to.be.revertedWith( + revertMessages.submitVoteNotVoting + ); + }); + + it("require fail - already voted", async () => { + await users.summoner.baal?.submitVote(1, yes); + await expect(users.summoner.baal?.submitVote(1, yes)).to.be.revertedWith( + revertMessages.submitVoteVoted + ); + }); + + it("require fail - not a member", async () => { + await expect(users.shaman.baal?.submitVote(1, yes)).to.be.revertedWith( + revertMessages.submitVoteMember + ); + }); + + it("scenario - two yes votes", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); // p2 + await users.summoner.baal?.submitVote(1, yes); + await users.summoner.baal?.submitVote(2, yes); + const prop1 = await baal.proposals(1); + const votes1 = await sharesToken.getPastVotes( + users.summoner.address, + prop1.votingStarts + ); + expect(prop1.yesVotes).to.equal(votes1); + + const prop2 = await baal.proposals(2); + const votes2 = await sharesToken.getPastVotes( + users.summoner.address, + prop2.votingStarts + ); + expect(prop2.yesVotes).to.equal(votes2); + }); + }); + + describe("submitVote (no self-sponsor)", function () { + const amountToMint = 100; + const currentShares = defaultSummonSetup.shares * 3; + const currentLoot = defaultSummonSetup.loot * 2; + + it("require fail - voting not started", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.SUBMITTED); + await expect(users.summoner.baal?.submitVote(1, no)).to.be.revertedWith( + revertMessages.submitVoteNotVoting + ); + }); + + it("scenario - increase shares during voting", async () => { + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); // shares for shaman + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const prop1 = await baal.proposals(1); + expect(prop1.maxTotalSharesAndLootAtVote).to.equal( + currentShares + currentLoot + amountToMint + ); + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); // add another 100 shares for shaman + await users.shaman.baal?.submitVote(1, yes); + const prop = await baal.proposals(1); + expect(prop.yesVotes).to.equal(users.summoner.sharesInitial + amountToMint); // summoner shares and 1st shares from shaman are counted + expect(prop.maxTotalSharesAndLootAtVote).to.equal( + currentShares + currentLoot + 2 * amountToMint + ); + }); + + it("scenario - decrease shares during voting", async () => { + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); // shares for shaman + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const prop1 = await baal.proposals(1); + expect(prop1.maxTotalSharesAndLootAtVote).to.equal( + currentShares + currentLoot + amountToMint + ); + await users.shaman.baal?.ragequit(users.shaman.address, amountToMint / 2, 0, [weth.address]); + await users.shaman.baal?.submitVote(1, yes); + const prop = await baal.proposals(1); + expect(prop.yesVotes).to.equal(users.summoner.sharesInitial + amountToMint); // summoner votes and initial votes from shaman are counted (not affected by rq) + expect(prop.maxTotalSharesAndLootAtVote).to.equal(currentShares + currentLoot + amountToMint); // unchanged + }); + }); + + describe("submitVoteWithSig (w/ auto self-sponsor)", function () { + let signer: SignerWithAddress; + beforeEach(async function () { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + signer = await ethers.getSigner(users.summoner.address); + }); + + it("happy case - yes vote", async () => { + const expiry = await blockTime() + 1200; + const signature = await signVote( + chainId, + baal.address, + signer, + await sharesToken.name(), + expiry, + 0, + 1, + true + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + await baal.submitVoteWithSig(signer.address, expiry, 0, 1, true, v, r, s); + const prop = await baal.proposals(1); + const nCheckpoints = await sharesToken.numCheckpoints(signer.address); + const votes = ( + await sharesToken.checkpoints(signer.address, nCheckpoints.sub(1)) + ).votes; + const priorVotes = await sharesToken.getPastVotes( + signer.address, + prop.votingStarts + ); + expect(await baal.votingNonces(signer.address)).to.equal(1); + expect(priorVotes).to.equal(votes); + expect(prop.yesVotes).to.equal(votes); + }); + + + it("fail case - fails with different voter", async () => { + const expiry = await blockTime() + 1200; + const signature = await signVote( + chainId, + baal.address, + signer, + await sharesToken.name(), + expiry, + 0, + 1, + true + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + expect( + baal.submitVoteWithSig(users.applicant.address, expiry, 0, 1, true, v, r, s) + ).to.be.revertedWith("invalid signature"); + expect(await baal.votingNonces(users.applicant.address)).to.equal(0); + }); + + it("fail case - cant vote twice", async () => { + const expiry = await blockTime() + 1200; + const signature = await signVote( + chainId, + baal.address, + signer, + await sharesToken.name(), + expiry, + 0, + 1, + true + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + await baal.submitVoteWithSig(signer.address, expiry, 0, 1, true, v, r, s); + + const signatureTwo = await signVote( + chainId, + baal.address, + signer, + deploymentConfig.TOKEN_NAME, + expiry, + 1, + 1, + true + ); + const sigTwo = await ethers.utils.splitSignature(signatureTwo); + expect( + baal.submitVoteWithSig(signer.address, expiry, 1, 1, true, sigTwo.v, sigTwo.r, sigTwo.s) + ).to.be.revertedWith("voted"); + expect(await baal.votingNonces(signer.address)).to.equal(1); + }); + }); + + describe("delegateBySig", function () { + let signer: SignerWithAddress; + + beforeEach(async function () { + await baal.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + signer = await ethers.getSigner(users.summoner.address); + }); + + it("happy case ", async () => { + const expiry = (await blockTime()) + 10000; + const nonce = 0; + const signature = await signDelegation( + chainId, + sharesToken.address, + signer, + await sharesToken.name(), + users.shaman.address, + nonce, + expiry + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + await users.shaman.shares?.delegateBySig(users.shaman.address, nonce, expiry, v, r, s); + const summonerDelegate = await sharesToken.delegates(users.summoner.address); + expect(summonerDelegate).to.equal(users.shaman.address); + }); + + it("require fail - nonce is re-used", async () => { + const expiry = (await blockTime()) + 10000; + const nonce = 0; + const signature = await signDelegation( + chainId, + sharesToken.address, + signer, + await sharesToken.name(), + users.shaman.address, + nonce, + expiry + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + await users.shaman.shares?.delegateBySig(users.shaman.address, nonce, expiry, v, r, s); + expect( + users.shaman.shares?.delegateBySig(users.shaman.address, nonce, expiry, v, r, s) + ).to.be.revertedWith(sharesRevertMessages.invalidNonce); + }); + + it("require fail - signature expired", async () => { + const nonce = 0; + const signature = await signDelegation( + chainId, + sharesToken.address, + signer, + await sharesToken.name(), + users.shaman.address, + nonce, + 0 + ); + + const { v, r, s } = ethers.utils.splitSignature(signature); + expect( + users.shaman.shares?.delegateBySig(users.shaman.address, nonce, 0, v, r, s) + ).to.be.revertedWith(sharesRevertMessages.signatureExpired); + }); + }); + + describe("processProposal", function () { + + const quorumGovernanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [ + deploymentConfig.VOTING_PERIOD_IN_SECONDS, + deploymentConfig.GRACE_PERIOD_IN_SECONDS, + deploymentConfig.PROPOSAL_OFFERING, + 10, // QUORUM_PERCENT + deploymentConfig.SPONSOR_THRESHOLD, + deploymentConfig.MIN_RETENTION_PERCENT, + ] + ); + + const minRetetionGovernanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [ + deploymentConfig.VOTING_PERIOD_IN_SECONDS, + deploymentConfig.GRACE_PERIOD_IN_SECONDS, + deploymentConfig.PROPOSAL_OFFERING, + deploymentConfig.QUORUM_PERCENT, + deploymentConfig.SPONSOR_THRESHOLD, + 90, // MIN_RETENTION_PERCENT = 90%, ragequit > 10% of shares+loot to trigger + ] + ); + + it("happy case yes wins", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const beforeProcessed = await baal.proposals(1); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, true, false]); + }); + + it("require fail - not enough gas", async () => { + const baalGas = 10000000; + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + baalGas, + ethers.utils.id(proposal.details) + ); + + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 3); + + // const procprop = baal.processProposal(1, proposal.data); + const procprop = baal.processProposal(1, proposal.data, {gasPrice: ethers.utils.parseUnits('1', 'gwei'), gasLimit: 10000000}) + + expect(procprop).to.be.revertedWith(revertMessages.notEnoughGas); + + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.READY); + }); + + it("require fail - baalGas to high", async () => { + const baalGas = 20000001; + await expect(users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + baalGas, + ethers.utils.id(proposal.details) + )).to.be.revertedWith(revertMessages.baalGasToHigh); + + }); + + it("has enough baalGas", async () => { + const baalGas = 1000000; + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + baalGas, + ethers.utils.id(proposal.details) + ); + + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 5); + await baal.processProposal(1, proposal.data, { + gasPrice: ethers.utils.parseUnits("100", "gwei"), + gasLimit: 10000000, + }); + + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.PROCESSED); + }); + + it("require fail - no wins, proposal is defeated", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, no); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 5); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.DEEFEATED); + await expect(baal.processProposal(1, proposal.data)).to.be.revertedWith( + revertMessages.processProposalNotReady + ); + }); + + it("require fail - proposal does not exist", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const state = await baal.state(2); + expect(state).to.equal(PROPOSAL_STATES.UNBORN); + }); + + it("require fail - no sponser", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const state = await baal.state(2); + expect(state).to.equal(PROPOSAL_STATES.UNBORN); + // proposal.sponsor = null; + await expect(baal.processProposal(2, proposal.data)).to.be.revertedWith( + revertMessages.proposalNotSponsored + ); + }); + + it("require fail - prev proposal not processed", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(2, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await expect(baal.processProposal(2, proposal.data)).to.be.revertedWith( + "prev!processed" // TODO: + ); + }); + + it("require fail - proposal data mismatch on processing", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + const badSelfTransferAction = encodeMultiAction( + multisend, + ["0xbeefbabe"], + [baal.address], + [BigNumber.from(0)], + [0] + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await expect( + baal.processProposal(1, badSelfTransferAction) + ).to.be.revertedWith("incorrect calldata"); // TODO: + }); + + it("require fail - proposal not in voting", async () => { + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + + await expect(users.summoner.baal?.processProposal(1, proposal.data)).to.be.revertedWith( + revertMessages.proposalNotSponsored + ); // fail at submitted + + await users.summoner.baal?.sponsorProposal(1); + await expect(baal.processProposal(1, proposal.data)).to.be.revertedWith( + revertMessages.processProposalNotReady + ); // fail at voting + + await users.summoner.baal?.submitVote(1, yes); + const beforeProcessed = await baal.proposals(1); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 1); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.GRACE); + await expect(baal.processProposal(1, proposal.data)).to.be.revertedWith( + revertMessages.processProposalNotReady + ); // fail at grace + + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 1); + await baal.processProposal(1, proposal.data); // propsal ready, works + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.PROCESSED); + + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, true, false]); + }); + + it("require fail - proposal cancelled", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await users.shaman.baal?.cancelProposal(1); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state = await baal.state(1); + expect(state).to.equal(PROPOSAL_STATES.CANCELLED); + await expect(baal.processProposal(1, proposal.data)).to.be.revertedWith( + revertMessages.processProposalNotReady + ); + }); + + it("require fail - proposal expired 2", async () => { + const now = await blockTime(); + const expiration = + now + + deploymentConfig.VOTING_PERIOD_IN_SECONDS + + deploymentConfig.GRACE_PERIOD_IN_SECONDS + + 60; + + await users.summoner.baal?.submitProposal( + proposal.data, + expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.READY); + + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, false, false]); // passed [3] is false + }); + + it("edge case - exactly at quorum", async () => { + // mint shares to make total shares supply 2000 so summoner has exectly 10% w/ 200 shares + const amountToMint = BigNumber.from(2000).sub(await baal.totalShares()); + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); + // const totalSupply = await baal.totalSupply(); + const totalSupply = await baal.totalShares(); + expect(totalSupply).to.equal(2000); + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.READY); + await users.shaman.baal?.setGovernanceConfig(quorumGovernanceConfig); // set quorum to 10% + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, true, false]); // passed [3] is true + }); + + it("quorum should not factor loot", async () => { + // mint shares so summoner has > 10% w/ 200 shares + const amountToMint = BigNumber.from(1000).sub(await baal.totalShares()); + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); + await users.shaman.baal?.mintLoot([users.shaman.address], [100000000000]); // mint 100000000000 loot so summoner has a ton of it + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.READY); + await users.shaman.baal?.setGovernanceConfig(quorumGovernanceConfig); // set quorum to 10% + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, true, false]); // passed [3] is true + }); + + it("edge case - just under quorum", async () => { + // mint shares so summoner has <10% w/ 200 shares + const amountToMint = BigNumber.from(2001).sub(await baal.totalShares()); + await users.shaman.baal?.mintShares([users.shaman.address], [amountToMint]); + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.READY); + await users.shaman.baal?.setGovernanceConfig(quorumGovernanceConfig); // set quorum to 10% + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, false, false]); // passed [3] is false + }); + + it("edge case - exactly at minRetentionPercent", async () => { + await users.shaman.baal?.setGovernanceConfig(minRetetionGovernanceConfig); // set min retention to 90% + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + // ragequit 30 shares out of 200 shares and 100 loot out of 500 -> 10% totalSupply + await users.summoner.baal?.ragequit(users.summoner.address, 30, 100, [weth.address]); + expect(state1).to.equal(PROPOSAL_STATES.READY); + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, true, false]); // passed [3] is true + }); + + it("edge case - just below minRetentionPercent - shares+loot", async () => { + await users.shaman.baal?.setGovernanceConfig(minRetetionGovernanceConfig); // set min retention to 90% + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + // ragequit 31 shares out of 200, and 101 loot out of 500 -> > 10% totalSupply + await users.summoner.baal?.ragequit(users.summoner.address, 31, 101, [weth.address]); + expect(state1).to.equal(PROPOSAL_STATES.READY); + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, false, false]); // passed [3] is false - min retention exceeded + }); + + it("edge case - just below minRetentionPercent - just shares", async () => { + await users.shaman.baal?.setGovernanceConfig(minRetetionGovernanceConfig); // set min retention to 90% + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + // ragequit 131 shares out of 200, and 0 out of 500 -> > 10% totalSupply + await users.summoner.baal?.ragequit(users.summoner.address, 131, 0, [weth.address]); + expect(state1).to.equal(PROPOSAL_STATES.READY); + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, false, false]); // passed [3] is false - min retention exceeded + }); + + it("edge case - just below minRetentionPercent - just loot", async () => { + await users.shaman.baal?.setGovernanceConfig(minRetetionGovernanceConfig); // set min retention to 90% + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + // ragequit 0 shares out of 200, and 131 loot out of 500 -> > 10% totalSupply + await users.summoner.baal?.ragequit(users.summoner.address, 0, 131, [weth.address]); + expect(state1).to.equal(PROPOSAL_STATES.READY); + const beforeProcessed = await baal.proposals(1); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(1); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(1); + expect(propStatus).to.eql([false, true, false, false]); // passed [3] is false - min retention exceeded + }); + + it("scenario - offer tribute unsafe", async () => { + await users.summoner.weth?.transfer(users.s1.address, 100); // summoner transfer 100 weth + const offerWeth = weth.interface.encodeFunctionData("transferFrom", [ + users.s1.address, + gnosisSafe.address, + 100, + ]); + const tributeMultiAction = encodeMultiAction( + multisend, + [offerWeth], + [weth.address], + [BigNumber.from(0)], + [0] + ); + + proposal.data = tributeMultiAction; + proposal.details = 'Tribute Proposal'; + + await users.s1.weth?.approve(gnosisSafe.address, 100); + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + const beforeProcessed = await baal.proposals(1); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + const afterProcessed = await baal.proposals(1); + verifyProposal(afterProcessed, beforeProcessed, { + processed: true, + passed: true, + }); + const applicantWethBalance = await weth.balanceOf(users.s1.address); + expect(applicantWethBalance).to.equal(0); + const safeWethBalance = await weth.balanceOf(gnosisSafe.address); + expect(safeWethBalance).to.equal(100); + }); + + it("scenario - two propsals, prev is processed", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(2, yes); + const beforeProcessed = await baal.proposals(2); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, proposal.data); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.PROCESSED); // prev prop processed + await baal.processProposal(2, proposal.data); + const afterProcessed = await baal.proposals(2); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(2); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(2); + expect(propStatus).to.eql([false, true, true, false]); + }); + + it("scenario - two propsals, prev is defeated", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, no); + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(2, yes); + const beforeProcessed = await baal.proposals(2); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.DEEFEATED); // prev prop defeated + await baal.processProposal(2, proposal.data); + const afterProcessed = await baal.proposals(2); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(2); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(2); + expect(propStatus).to.eql([false, true, true, false]); + }); + + it("scenario - two propsals, prev is cancelled", async () => { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(1, yes); + await users.shaman.baal?.cancelProposal(1); + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + await users.summoner.baal?.submitVote(2, yes); + const beforeProcessed = await baal.proposals(2); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + const state1 = await baal.state(1); + expect(state1).to.equal(PROPOSAL_STATES.CANCELLED); // prev prop cancelled + await baal.processProposal(2, proposal.data); + const afterProcessed = await baal.proposals(2); + verifyProposal(afterProcessed, beforeProcessed); + const state2 = await baal.state(2); + expect(state2).to.equal(PROPOSAL_STATES.PROCESSED); + const propStatus = await baal.getProposalStatus(2); + expect(propStatus).to.eql([false, true, true, false]); + }); + + it("happy case - mint shares via proposal", async () => { + const minting = 100; + + expect( + await sharesToken.balanceOf(users.applicant.address) + ).to.equal(defaultSummonSetup.shares); + + const mintAction = baal.interface.encodeFunctionData( + "mintShares", + [[users.applicant.address], [minting]] + ); + + const encodedAction = encodeMultiAction( + multisend, + [mintAction], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect(proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1, + }) + ).to.emit(baal, "ProcessProposal").withArgs(1, true, false); + + expect( + await sharesToken.balanceOf(users.applicant.address) + ).to.equal(defaultSummonSetup.shares + minting); + }); + + it("happy case - burn shares via proposal", async () => { + const burning = 100; + + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial); + + const burnAction = baal.interface.encodeFunctionData( + "burnShares", + [[users.summoner.address], [burning]] + ); + + const encodedAction = encodeMultiAction( + multisend, + [burnAction], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect(proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ).to.emit(baal, "ProcessProposal").withArgs(1, true, false); + + expect( + await sharesToken.balanceOf(users.summoner.address) + ).to.equal(users.summoner.sharesInitial - burning); + }); + + it("happy case - mint loot via proposal", async () => { + const minting = 100; + + expect( + await lootToken.balanceOf(users.applicant.address) + ).to.equal(defaultSummonSetup.loot); + + const mintAction = await baal.interface.encodeFunctionData( + "mintLoot", + [[users.applicant.address], [minting]] + ); + + const encodedAction = encodeMultiAction( + multisend, + [mintAction], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect(proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ).to.emit(baal, "ProcessProposal").withArgs(1, true, false); + + expect( + await lootToken.balanceOf(users.applicant.address) + ).to.equal(defaultSummonSetup.loot + minting); + }); + + it("happy case - burn loot via proposal", async () => { + const burning = 100; + + expect( + await lootToken.balanceOf(users.summoner.address) + ).to.equal(defaultSummonSetup.loot); + + const burnAction = baal.interface.encodeFunctionData( + "burnLoot", + [[users.summoner.address], [burning]] + ); + + const encodedAction = encodeMultiAction( + multisend, + [burnAction], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + await expect(proposalHelpers.submitAndProcessProposal({ + baal, + encodedAction, + proposal, + proposalId: 1 + }) + ).to.emit(baal, "ProcessProposal").withArgs(1, true, false); + + expect( + await lootToken.balanceOf(users.summoner.address) + ).to.equal(defaultSummonSetup.loot - burning); + }); + + // setting and unsetting shamans covered + + // TODO set / unset tokens via proposal + }); + + // ---------------------------------------------------------- + // ------------------ RAGEQUIT ------------------------------ + // ---------------------------------------------------------- + + describe("ragequit", function () { + const depositAmount = 100; + + it("happy case - full ragequit", async () => { + const summonerWethBefore = await weth.balanceOf(users.summoner.address); + + await weth.transfer(gnosisSafe.address, depositAmount); + const share = BigNumber.from( + users.summoner.sharesInitial + defaultSummonSetup.loot + ).mul(depositAmount).div(await baal.totalSupply()); + + await users.summoner.baal?.ragequit( + users.summoner.address, + users.summoner.sharesInitial, + defaultSummonSetup.loot, + [weth.address] + ); + const sharesAfter = await sharesToken.balanceOf(users.summoner.address); + const lootAfter = await lootToken.balanceOf(users.summoner.address); + const summonerWethAfter = await weth.balanceOf(users.summoner.address); + const safeWethAfter = await weth.balanceOf(gnosisSafe.address); + expect(lootAfter).to.equal(0); + expect(sharesAfter).to.equal(0); + expect(summonerWethAfter).to.equal(summonerWethBefore.add(share)); + expect(safeWethAfter).to.equal(BigNumber.from(depositAmount).sub(share)); + }); + + it("happy case - partial ragequit", async () => { + const lootBefore = await lootToken.balanceOf(users.summoner.address); + const sharesBefore = await sharesToken.balanceOf(users.summoner.address); + const lootToBurn = defaultSummonSetup.loot / 2; + // const sharesToBurn = (await baal.totalShares()).div(2); // half of shares supplied + const sharesToBurn = defaultSummonSetup.shares / 2; + const summonerWethBefore = await weth.balanceOf(users.summoner.address); + + await weth.transfer(gnosisSafe.address, depositAmount); + const share = BigNumber.from( + sharesToBurn + lootToBurn + ).mul(depositAmount).div(await baal.totalSupply()); + + await users.summoner.baal?.ragequit( + users.summoner.address, + sharesToBurn, + lootToBurn, + [weth.address] + ); + const sharesAfter = await sharesToken.balanceOf(users.summoner.address); + const lootAfter = await lootToken.balanceOf(users.summoner.address); + const summonerWethAfter = await weth.balanceOf(users.summoner.address); + const safeWethAfter = await weth.balanceOf(gnosisSafe.address); + expect(lootAfter).to.equal(lootBefore.sub(lootToBurn)); + expect(sharesAfter).to.equal(sharesBefore.sub(sharesToBurn)); + expect(summonerWethAfter).to.equal(summonerWethBefore.add(share)); + expect(safeWethAfter).to.equal(BigNumber.from(depositAmount).sub(share)); + }); + + it("happy case - full ragequit to different address", async () => { + const applicantWethBefore = await weth.balanceOf(users.applicant.address); + const summonerWethBefore = await weth.balanceOf(users.summoner.address); + + await weth.transfer(gnosisSafe.address, depositAmount); + const share = BigNumber.from( + users.summoner.sharesInitial + defaultSummonSetup.loot + ).mul(depositAmount).div(await baal.totalSupply()); + + await users.summoner.baal?.ragequit( + users.applicant.address, // ragequit to applicant + users.summoner.sharesInitial, + defaultSummonSetup.loot, + [weth.address] + ); + const sharesAfter = await sharesToken.balanceOf(users.summoner.address); + const lootAfter = await lootToken.balanceOf(users.summoner.address); + const summonerWethAfter = await weth.balanceOf(users.summoner.address); + const safeWethAfter = await weth.balanceOf(gnosisSafe.address); + const applicantWethAfter = await weth.balanceOf(users.applicant.address); + expect(lootAfter).to.equal(0); + expect(sharesAfter).to.equal(0); + expect(summonerWethAfter).to.equal(summonerWethBefore); + expect(safeWethAfter).to.equal(BigNumber.from(depositAmount).sub(share)); + expect(applicantWethAfter).to.equal(applicantWethBefore.add(share)); + }); + + it("happy case - full ragequit - two tokens", async () => { + // expect: receive 50% of weth and dai from DAO + + const summonerWethBefore = await weth.balanceOf(users.summoner.address); + const summonerDaiBefore = await dai.balanceOf(users.summoner.address); + + await weth.transfer(gnosisSafe.address, depositAmount); + await dai.transfer(gnosisSafe.address, depositAmount * 2); + + const lootToBurn = defaultSummonSetup.loot; + const lootBefore = await lootToken.balanceOf(users.summoner.address); + + const shareWeth = BigNumber.from( + users.summoner.sharesInitial + lootToBurn + ).mul(depositAmount).div(await baal.totalSupply()); + const shareDai = BigNumber.from( + users.summoner.sharesInitial + lootToBurn + ).mul(depositAmount * 2).div(await baal.totalSupply()); + + const orderedTokens = [dai.address, weth.address].sort((a, b) => { + return parseInt(a.slice(2), 16) - parseInt(b.slice(2), 16); + }); + + await users.summoner.baal?.ragequit( + users.summoner.address, + users.summoner.sharesInitial, + lootToBurn, + orderedTokens + ); + + const sharesAfter = await sharesToken.balanceOf(users.summoner.address); + const lootAfter = await lootToken.balanceOf(users.summoner.address); + const summonerWethAfter = await weth.balanceOf(users.summoner.address); + const summonerDaiAfter = await dai.balanceOf(users.summoner.address); + const safeWethAfter = await weth.balanceOf(gnosisSafe.address); + const safeDaiAfter = await dai.balanceOf(gnosisSafe.address); + + expect(sharesAfter).to.equal(0); + expect(lootAfter).to.equal(lootBefore.sub(lootToBurn)); + expect(summonerWethAfter).to.equal(summonerWethBefore.add(shareWeth)); // minus 100, plus 50 + expect(summonerDaiAfter).to.equal(summonerDaiBefore.add(shareDai)); // minus 200, plus 100 + expect(safeWethAfter).to.equal(BigNumber.from(depositAmount).sub(shareWeth)); + expect(safeDaiAfter).to.equal(BigNumber.from(depositAmount * 2).sub(shareDai)); + }); + }); + + describe("ragequit", function () { + const depositAmount = 100; + + // TODO: + // it("collects tokens not on the list", async () => { + // // note - skips having shaman add LOOT to guildTokens + // // transfer 300 loot to DAO (summoner has 200 shares + 500 loot, so that's 50% of total) + // // transfer 100 weth to DAO + // // ragequit 100% of remaining shares & loot + // // expect: receive 50% of weth / loot from DAO + // await users.shaman.baal?.mintShares([users.applicant.address], [100]); // 100 extra to even loot supply + // const summonerWethBefore = await weth.balanceOf(users.summoner.address); + + // await weth.transfer(gnosisSafe.address, depositAmount); + // await users.summoner.loot?.transfer(gnosisSafe.address, 300); + + // const tokens = [lootToken.address, weth.address].sort((a, b) => { + // return parseInt(a.slice(2), 16) - parseInt(b.slice(2), 16); + // }); + // console.log('Supply', (await baal.totalSupply()).toString()); + + // await users.summoner.baal?.ragequit( + // users.summoner.address, + // users.summoner.sharesInitial, + // defaultSummonSetup.loot - 300, + // tokens + // ); + + // const sharesAfter = await sharesToken.balanceOf(users.summoner.address); + // const lootAfter = await lootToken.balanceOf(users.summoner.address); + // const safeLootAfter = await lootToken.balanceOf(gnosisSafe.address); + // const summonerWethAfter = await weth.balanceOf(users.summoner.address); + // const safeWethAfter = await weth.balanceOf(gnosisSafe.address); + // // TODO: Should be 85? + // // expect(lootAfter).to.equal(150); // burn 200, receive 150 + // expect(sharesAfter).to.equal(0); + // expect(summonerWethAfter).to.equal(summonerWethBefore.add(50)); // minus 100, plus 50 + // expect(safeWethAfter).to.equal(50); + // expect(safeLootAfter).to.equal(150); + // }); + + it("require fail - enforces ascending order", async () => { + await weth.transfer(gnosisSafe.address, depositAmount); + await users.summoner.loot?.transfer(baal.address, 300); + const tokens = [lootToken.address, weth.address] + .sort((a, b) => { + return parseInt(a.slice(2), 16) - parseInt(b.slice(2), 16); + }) + .reverse(); + + await expect( + users.summoner.baal?.ragequit( + users.summoner.address, + users.summoner.sharesInitial, + defaultSummonSetup.loot - 300, + tokens + ) + ).to.be.revertedWith(revertMessages.ragequitUnordered); + }); + + it("require fail - prevents actual duplicate", async () => { + await weth.transfer(gnosisSafe.address, depositAmount); + await expect( + users.summoner.baal?.ragequit( + users.summoner.address, + defaultSummonSetup.shares, + defaultSummonSetup.loot - 300, + [ + weth.address, + weth.address, + ] + ) + ).to.be.revertedWith(revertMessages.ragequitUnordered); + }); + }); + + // -------------------------------------------------------- + // ------------------ VOTING ------------------------------ + // -------------------------------------------------------- + + describe("getVotes", function () { + it("happy case - account with votes", async () => { + const currentVotes = await sharesToken.getVotes(users.summoner.address); + const nCheckpoints = await sharesToken.numCheckpoints(users.summoner.address); + const checkpoints = await sharesToken.checkpoints( + users.summoner.address, + nCheckpoints.sub(1) + ); + const votes = checkpoints.votes; + expect(currentVotes).to.equal(votes); + }); + + it("happy case - account without votes", async () => { + const currentVotes = await sharesToken.getVotes(users.shaman.address); + expect(currentVotes).to.equal(0); + }); + }); + + describe("getPastVotes", function () { + beforeEach(async function () { + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + }); + + it("happy case - yes vote", async () => { + const blockT = await blockTime(); + await users.summoner.baal?.submitVote(1, yes); + const priorVote = await sharesToken.getPastVotes(users.summoner.address, blockT); + const nCheckpoints = await sharesToken.numCheckpoints(users.summoner.address); + const votes = ( + await sharesToken.checkpoints(users.summoner.address, nCheckpoints.sub(1)) + ).votes; + expect(priorVote).to.equal(votes); + }); + + it("happy case - no vote", async () => { + const blockT = await blockTime(); + await users.summoner.baal?.submitVote(1, no); + const priorVote = await sharesToken.getPastVotes(users.summoner.address, blockT); + const nCheckpoints = await sharesToken.numCheckpoints(users.summoner.address); + const votes = ( + await sharesToken.checkpoints(users.summoner.address, nCheckpoints.sub(1)) + ).votes; + expect(priorVote).to.equal(votes); + }); + + it("require fail - timestamp not determined", async () => { + const blockT = await blockTime(); + await expect( + sharesToken.getPastVotes(users.summoner.address, blockT) + ).to.be.revertedWith("!determined"); + }); + }); +}); + +describe("Baal contract - offering required", function () { + let customConfig = { + ...deploymentConfig, + PROPOSAL_OFFERING: 69, + SPONSOR_THRESHOLD: 1, + }; + + let baal: Baal; + let multisend: MultiSend; + let gnosisSafe: GnosisSafe; + + let proposal: ProposalType; + + let users: { + [key: string]: Signer; + }; + + beforeEach(async function () { + + const { + Baal, + GnosisSafe, + MultiSend, + signers + } = await baalSetup({ + daoSettings: customConfig, + }); + + baal = Baal; + gnosisSafe = GnosisSafe; + multisend = MultiSend; + users = signers; + + const selfTransferAction = encodeMultiAction( + multisend, + ["0x"], + [gnosisSafe.address], + [BigNumber.from(0)], + [0] + ); + + proposal = { + flag: 0, + data: selfTransferAction, + details: "all hail baal", + expiration: 0, + baalGas: 0, + }; + }); + + describe("submitProposal", function () { + it("submit proposal", async () => { + // note - this also tests that the proposal is NOT sponsored + const countBefore = await baal.proposalCount(); + + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details), + { value: 69 } + ); + + const countAfter = await baal.proposalCount(); + expect(countAfter).to.equal(countBefore + 1); + + const proposalData = await baal.proposals(1); + expect(proposalData.id).to.equal(1); + }); + + it("happy case - sponsors can submit without offering, auto-sponsors", async () => { + const countBefore = await baal.proposalCount(); + + await users.summoner.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + const now = await blockTime(); + + const countAfter = await baal.proposalCount(); + expect(countAfter).to.equal(countBefore + 1); + const proposalData = await baal.proposals(1); + expect(proposalData.id).to.equal(1); + expect(proposalData.votingStarts).to.equal(now); + }); + + it("edge case - sponsors can submit without offering at threshold", async () => { + const countBefore = await baal.proposalCount(); + await users.summoner.shares?.transfer(users.shaman.address, 1); // transfer 1 share to shaman, putting them at threshold (1) + + await users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ); + const now = await blockTime(); + + const countAfter = await baal.proposalCount(); + expect(countAfter).to.equal(countBefore + 1); + const proposalData = await baal.proposals(1); + expect(proposalData.id).to.equal(1); + expect(proposalData.votingStarts).to.equal(now); + }); + + it("require fail - no offering offered", async () => { + await expect( + users.shaman.baal?.submitProposal( + proposal.data, + proposal.expiration, + proposal.baalGas, + ethers.utils.id(proposal.details) + ) + ).to.be.revertedWith(revertMessages.submitProposalOffering); + }); + }); +}); + +describe("BaalSummoner contract", function () { + let avatar: TestAvatar; + let baalSingleton: Baal; + let baalSummoner: BaalSummoner; + let expectedAddress: string; + let moduleProxyFactory: ModuleProxyFactory; + let gnosisSafeProxyFactory: GnosisSafeProxyFactory; + let poster: Poster; + + beforeEach(async function () { + const { deployer } = await getNamedAccounts(); + + await deployments.fixture(['Infra', 'BaalSummoner']); // Deployment Tags + + baalSingleton = (await ethers.getContract('Baal', deployer)) as Baal; + baalSummoner = (await ethers.getContract('BaalSummoner', deployer)) as BaalSummoner; + moduleProxyFactory = (await ethers.getContract('ModuleProxyFactory', deployer)) as ModuleProxyFactory; + gnosisSafeProxyFactory = (await ethers.getContract('GnosisSafeProxyFactory', deployer)) as GnosisSafeProxyFactory; + poster = (await ethers.getContract('Poster', deployer)) as Poster + + const deployedAvatar = await deployments.deploy('TestAvatar', { + from: deployer, + args: [] + }); + + avatar = (await ethers.getContractAt('TestAvatar', deployedAvatar.address, deployer)) as TestAvatar; + }); + + describe("Baal summoned after safe", function () { + it("should have the expected address of the module the same as the deployed", async () => { + const [summoner, applicant, shaman] = await getUnnamedAccounts(); + + const initData = baalSingleton.interface.encodeFunctionData("avatar"); + const saltNonce = getSaltNonce(); + + expectedAddress = calculateProxyAddress( + moduleProxyFactory, + baalSingleton.address, + initData, + saltNonce + ); + + await avatar.enableModule(expectedAddress); + + const loot = defaultSummonSetup.loot; + const lootPaused = defaultSummonSetup.lootPaused; + const shares = defaultSummonSetup.shares; + const sharesPaused = defaultSummonSetup.sharesPaused; + + const shamanPermissions = defaultSummonSetup.shamanPermissions; + + const addresses = await setupBaal({ + baalSummoner, + baalSingleton, + poster, + config: defaultDAOSettings, + adminConfig: [sharesPaused, lootPaused], + shamans: [[shaman], [shamanPermissions]], + shares: [ + [summoner, applicant], + [shares, shares] + ], + loots: [ + [summoner, applicant], + [loot, loot] + ], + safeAddress: avatar.address as `0x${string}`, + forwarderAddress: ethers.constants.AddressZero, + lootAddress: ethers.constants.AddressZero, + sharesAddress: ethers.constants.AddressZero as `0x${string}`, + saltNonceOverride: saltNonce + }); + + expect(expectedAddress).to.equal(addresses.baal); + }); + }); + + describe("Baal summoner with fresh treasury vault", function () { + it("should have the expected address for both the module and safe", async () => { + const [summoner, applicant, shaman] = await getUnnamedAccounts(); + + const initData = baalSingleton.interface.encodeFunctionData("avatar"); + const saltNonce = getSaltNonce(); + + expectedAddress = calculateProxyAddress( + moduleProxyFactory, + baalSingleton.address, + initData, + saltNonce + ); + const masterCopyAddress = await baalSummoner.gnosisSingleton(); + + const expectedSafeAddress = await calculateSafeProxyAddress({ + gnosisSafeProxyFactory, + masterCopyAddress, + saltNonce, + }); + + const loot = defaultSummonSetup.loot; + const lootPaused = defaultSummonSetup.lootPaused; + const shares = defaultSummonSetup.shares; + const sharesPaused = defaultSummonSetup.sharesPaused; + + const shamanPermissions = defaultSummonSetup.shamanPermissions; + + const addresses = await setupBaal({ + baalSummoner, + baalSingleton, + poster, + config: defaultDAOSettings, + adminConfig: [sharesPaused, lootPaused], + shamans: [[shaman], [shamanPermissions]], + shares: [ + [summoner, applicant], + [shares, shares] + ], + loots: [ + [summoner, applicant], + [loot, loot] + ], + forwarderAddress: ethers.constants.AddressZero, + lootAddress: ethers.constants.AddressZero, + sharesAddress: ethers.constants.AddressZero as `0x${string}`, + saltNonceOverride: saltNonce + }); + + expect(expectedAddress).to.equal(addresses.baal); + expect(expectedSafeAddress).to.equal(addresses.safe); + }); + }); +}); diff --git a/lib/Baal/test/LootERC20.test.ts b/lib/Baal/test/LootERC20.test.ts new file mode 100644 index 0000000..2a0a90b --- /dev/null +++ b/lib/Baal/test/LootERC20.test.ts @@ -0,0 +1,417 @@ +import { expect } from 'chai'; +import { ethers, getChainId } from 'hardhat'; + +import signPermit from '../src/signPermit' +import { Loot, MockBaal } from '../src/types'; +import { blockTime } from './utils/evm'; +import { mockBaalSetup, Signer } from './utils/fixtures'; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; + +const revertMessages = { + lootAlreadyInitialized: 'Initializable: contract is already initialized', + permitNotAuthorized: 'ERC20Permit: invalid signature', + permitExpired: 'ERC20Permit: expired deadline', + lootNotBaal: 'Ownable: caller is not the owner', + notTransferable: 'loot: !transferable', + transferToZero: 'ERC20: transfer to the zero address' +}; + +describe('Loot ERC20 contract', function () { + let lootSingleton: Loot; + let mockBaal: MockBaal; + let lootToken: Loot; + let chainId: number; + + let users: { + [key: string]: Signer; + }; + + this.beforeAll(async function () { + chainId = Number(await getChainId()); + }); + + beforeEach(async function () { + const { Loot, LootSingleton, MockBaal, signers } = await mockBaalSetup(); + lootSingleton = LootSingleton; + lootToken = Loot; + mockBaal = MockBaal; + users = signers; + }); + + describe('constructor', async function () { + it('creates an unusable template', async () => { + expect(await lootSingleton.owner()).to.equal(ethers.constants.AddressZero); + }); + + it('require fail - initializer (setup) cant be called twice on loot', async () => { + await expect(lootToken.setUp('NAME', 'SYMBOL')) + .to.be.revertedWith(revertMessages.lootAlreadyInitialized); + }); + + it('require fail - initializer (setup) cant be called on singleton', async () => { + await expect(lootSingleton.setUp('NAME', 'SYMBOL')) + .to.be.revertedWith(revertMessages.lootAlreadyInitialized); + }); + }); + + describe('er20 loot - authorized minting, burning', async function () { + it('happy case - allows baal to mint when loot not paused', async () => { + expect(await mockBaal.lootPaused()).to.equal(false); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(0); + await mockBaal.mintLoot(users.s2.address, 100); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(100); + }); + + it('happy case - allows baal to mint when loot paused', async () => { + await mockBaal.setLootPaused(true); + expect(await mockBaal.lootPaused()).to.equal(true); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(0); + await mockBaal.mintLoot(users.s2.address, 100); + expect(await lootToken.balanceOf(users.s2.address)).to.equal(100); + }); + + it('require fail - non baal tries to mint', async () => { + await expect(users.s1.loot?.mint(users.s1.address, 100)) + .to.be.revertedWith(revertMessages.lootNotBaal); + }); + + it('happy case - allows baal to burn when loot not paused', async () => { + expect(await mockBaal.lootPaused()).to.equal(false); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(500); + await mockBaal.burnLoot(users.summoner.address, 100); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(400); + }); + + it('happy case - allows baal to burn when loot paused', async () => { + await mockBaal.setLootPaused(true); + expect(await mockBaal.lootPaused()).to.equal(true); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(500); + await mockBaal.burnLoot(users.summoner.address, 100); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(400); + }); + + it('require fail - non baal tries to burn', async () => { + await mockBaal.mintLoot(users.s2.address, 100); + await expect(users.s1.loot?.burn(users.s2.address, 50)) + .to.be.revertedWith(revertMessages.lootNotBaal); + }); + + it('require fail - non baal tries to send to 0', async () => { + await mockBaal.mintLoot(users.s2.address, 100); + await expect(users.s1.loot?.transfer(ethers.constants.AddressZero, 50)) + .to.be.revertedWith(revertMessages.transferToZero); + }); + }); + + describe('er20 loot - restrict transfer', async function () { + it('happy case - allows loot to be transferred when enabled', async () => { + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(500); + expect(await lootToken.balanceOf(users.s1.address)).to.equal(0); + expect(await mockBaal.lootPaused()).to.equal(false); + await users.summoner.loot?.transfer(users.s1.address, 100); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(400); + expect(await lootToken.balanceOf(users.s1.address)).to.equal(100); + }); + + it('require fail - tries to transfer loot when paused', async () => { + await mockBaal.setLootPaused(true); + expect(await mockBaal.lootPaused()).to.equal(true); + await expect(lootToken.transfer(users.s1.address, 100)) + .to.be.revertedWith(revertMessages.notTransferable); + }); + + it('happy case - allows loot to be transfered with approval when enabled', async () => { + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(500); + expect(await lootToken.balanceOf(users.s1.address)).to.equal(0); + expect(await mockBaal.lootPaused()).to.equal(false); + await users.summoner.loot?.approve(users.s2.address, 100); + await users.s2.loot?.transferFrom(users.summoner.address, users.s1.address, 100); + expect(await lootToken.balanceOf(users.summoner.address)).to.equal(400); + expect(await lootToken.balanceOf(users.s1.address)).to.equal(100); + }); + + it('require fail - tries to transfer with approval loot when paused', async () => { + await mockBaal.setLootPaused(true); + await users.summoner.loot?.approve(users.s2.address, 100); + await expect( + users.s2.loot?.transferFrom( + users.summoner.address, + users.s1.address, + 100 + ) + ).to.be.revertedWith(revertMessages.notTransferable); + }); + + }) + + describe('erc20 loot - increase allowance with permit', function () { + let signer: SignerWithAddress; + + this.beforeEach(async function () { + signer = await ethers.getSigner(users.summoner.address); + }); + + it('happy case - increase allowance with valid permit', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, // chainId + lootToken.address, // contractAddress + signer, // signer + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, // owner + users.s1.address, // spender + 500, // value + nonce, // nonce + deadline, // deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await lootToken.permit(users.summoner.address, users.s1.address, 500, deadline, v, r, s); // owner, spender, value, deadline, v, r, s + const s1Allowance = await lootToken.allowance(users.summoner.address, users.s1.address); + expect(s1Allowance).to.equal(500); + }) + + it('Require fail - invalid nonce', async () => { + const deadline = (await blockTime()) + 10000 + const nonce = await lootToken.nonces(users.summoner.address) + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 500, + nonce.add(1), + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }) + + it('Require fail - invalid chain Id', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + 420, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 500, + nonce, + deadline + ); + + const {v,r,s} = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }) + + it('Require fail - invalid name', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + 'invalid', + users.summoner.address, + users.s1.address, + 500, + nonce, + deadline + ); + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }); + + it('Require fail - invalid address', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address) + const permitSignature = await signPermit( + chainId, + ethers.constants.AddressZero, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 500, + nonce, + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }); + + it('Require fail - invalid owner', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.s1.address, + users.s1.address, + 500, + nonce, + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }) + + it('Require fail - invalid spender', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s2.address, + 500, + nonce, + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }); + + it('Require fail - invalid amount', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 499, + nonce, + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }); + + it('Require fail - invalid deadline', async () => { + const deadline = (await blockTime()) + 10000; + const nonce = await lootToken.nonces(users.summoner.address) + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 500, + nonce, + deadline - 1 + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitNotAuthorized); + }); + + it('Require fail - expired deadline', async () => { + const deadline = (await blockTime()) - 1; + const nonce = await lootToken.nonces(users.summoner.address); + const permitSignature = await signPermit( + chainId, + lootToken.address, + signer, + await lootToken.name(), // name -- replacing await lootToken.name() with 'Loot' for new signing scope + users.summoner.address, + users.s1.address, + 500, + nonce, + deadline + ); + + const { v, r, s } = await ethers.utils.splitSignature(permitSignature); + await expect( + lootToken.permit( + users.summoner.address, + users.s1.address, + 500, + deadline, + v, r, s + ) + ).to.be.revertedWith(revertMessages.permitExpired); + }); + }); +}); diff --git a/lib/Baal/test/README.md b/lib/Baal/test/README.md new file mode 100644 index 0000000..265a1fd --- /dev/null +++ b/lib/Baal/test/README.md @@ -0,0 +1,198 @@ +Other than the flavor text at the beginning, this is a direct copy/paste from the test in Moloch Ventures V2 code. I hope at some point in time the test cases can be written to this spec and this intro text can be removed and new specific instructions will be added. To do that some modification needs to be made. + +1. Repeated actions on the smart contracts should be refactored into functions. +2. Use of snapshot and revert should be put in so a known baseline is forced on the tests. +3. Care should be given to explore every require and modifier. + + +### Setup +Run `npx hardhat test` from the top level directory to run the tests. This assumes that you have installed the prerequisits and have compiled the code. + +--- + +This document is intended to help those interested in learning about testing solidity in general, and also to act as a guide for testing future iterations of the Moloch smart contracts. It is organized as a set of principles and, where possible, examples demonstrating their practical application. + +### Test Code Quality + +Tests should be written, not only to verify correctness of the target code, but to be comprehensively reviewed by other programmers. Therefore, for mission critical solidity code, the quality of the tests are just as important (if not more so) than the code itself, and should be written with the highest standards of clarity and elegance. + +### Tests Should Follow DRY (Don't Repeat Yourself) +The first pass of unit tests will inevitably proceed faster by copy-pasting the setup and verification code from one test to the next, but these duplicated lines of code get in the way of careful indedepent review. A reviewer must read *every* line of test code and must thus constantly fight the urge to gloss over certain lines that look the same as in the previous test, in case there is a slight but meaningful deviation that requires their evaluation. + +After the first pass of unit tests, it is important to refactor the common setup and verification into their own functions. Not only does this save time for a reviewer who only has to review those functions once, but it also **emphasizes the differences** between unit test scenarios and make them easier to reason about. + +#### Verification Functions + +For each Moloch.sol function, the Moloch tests have a *verification function* that checks each state transition expected from the successful execution of the function. + +For example, `verifySubmitVote` checks that the `proposal.yesVotes` or `proposal.noVotes` were tallied (depending on which way a member voted), that the `proposal.maxTotalSharesAtYesVote` is updated if needed, and that the vote is also recorded in the `proposal.votesByMember` mapping. + +The `member.highestIndexYesVote` field is also conditionally updated by `submitVote`, but the conditional was complex enough to omit from the main verification function and check it separately. + +#### Snapshot & Revert + +The Moloch tests make heavy use of EVM snapshot & revert both to speed up the tests and to allow for less repetitive setup code. + +``` + beforeEach(async () => { + snapshotId = await snapshot() + + proposal1 = { + applicant: applicant1, + tokenTribute: 100, + sharesRequested: 1, + details: 'all hail moloch' + } + + token.transfer(summoner, initSummonerBalance, { from: creator }) + }) + + afterEach(async () => { + await restore(snapshotId) + }) +``` + +The `beforeEach` is invoked before each unit test, and the `afterEach` is invoked after each unit test. The highest level `beforeEach` shown above takes a fresh snapshot, resets the global `proposal1` data to a predictable baseline, and transfers to the summoner their expected initial token balance. The `afterEach` simply reverts to the snapshot. + +Nested in the next `describe` test block is another `beforeEach` which is invoked before only the unit tests in the `desribe` test block. The higher level `beforeEach` above is still called before this one on every unit test in the block. + +`beforeEach_1 -> beforeEach_2 -> { test } -> afterEach` + +``` + describe('submitProposal', () => { + beforeEach(async () => { + await token.transfer(proposal1.applicant, proposal1.tokenTribute, { + from: creator + }) + await token.approve(moloch.address, 10, { from: summoner }) + await token.approve(moloch.address, proposal1.tokenTribute, { + from: proposal1.applicant + }) + }) + ... +``` + +This `beforeEach` performs the setup for the `submitProposal` unit tests by transferring the proposal applicant the required amount of tribute tokens, approving the transfer of those tokens from the applicant to the Moloch contract, and also approving the transfer of enough tokens to cover the proposal deposit from the summoner. + +This setup code is re-used in the following 8 tests, which only minimally deviate from the initial setup in order to test various other scenarios. For example, the first happy case test simply calls submit proposal with the baseline `proposal1` parameters, and then calls the `verifySubmitProposal` to check the state transitions. + +``` + it('happy case', async () => { + await moloch.submitProposal( + proposal1.applicant, + proposal1.tokenTribute, + proposal1.sharesRequested, + proposal1.details, + { from: summoner } + ) + await verifySubmitProposal(proposal1, 0, summoner, { + initialTotalShares: 1, + initialApplicantBalance: proposal1.tokenTribute, + initialProposerBalance: initSummonerBalance + }) + }) +``` + +The next unit test changes *ONLY* one thing, which is that it sets the shares requested to the 1e18 (1 x 10^18) to test the maximum value enforced by has been exceeded, and that the call to `submitProposal` properly fails with the correct error message from the triggered `require`: "too many shares requested". +``` + it('require fail - uint overflow', async () => { + proposal1.sharesRequested = _1e18 + await moloch + .submitProposal( + proposal1.applicant, + proposal1.tokenTribute, + proposal1.sharesRequested, + proposal1.details, + { from: summoner } + ) + .should.be.rejectedWith('too many shares requested') + }) +``` + +### Trigger Every Require / Assert + +There are several reasons to write unit tests trigger every `require` (and `assert`, if you prefer to use those): +1. To make sure that the function fails when it should +2. To identify obviated `require` checks that no scenario can actually trigger +3. To force you, the tester, to reason about every single `require` and think about every single way your function can fail + +When writing unit tests to trigger a `require` failure, it is important to follow DRY as described above and minimally deviate from the happy case baseline in setting up the unit test to make it exceptionally obvious what parameter has been changed that is now causing the function to fail. + +It is also important to add unique `require` messages for each function and in the tests check for the specific error message from the `require` you intended to trigger to make sure not only that the function failed, but that it failed for the expected reason. + +### Test Modifier Existence + +Similar to `require` checks, the proper application of all modifiers should be tested. For example, the `submitProposal` unit tests check the `onlyDelegate` modifier to make sure it prevents access from non-delegates (changing *only* the `from` field from the summoner to the creator and leaving everything else the same). + +``` + it('modifier - delegate', async () => { + await moloch + .submitProposal( + proposal1.applicant, + proposal1.tokenTribute, + proposal1.sharesRequested, + proposal1.details, + { from: creator } + ) + .should.be.rejectedWith('not a delegate') + }) +``` + +It is especially important to also test the existence of the `internal` modifier when used. To do so, remove the `internal` modifier from your function, write a test case that successfully executes your function, then add the `internal` modifier back to the function, and only then update your unit test to enforce a failing function call. Following this pattern helps prevent cases where you might forget to add `internal` back to the function, and the test still passes because the function call fails for some other reason. + +### Test Boundary Conditions + +For example, for most integer inputs, this means testing `0`, `1`, `uint_max`, and `uint_max - 1`. This will trigger any potential overflows that might otherwise not be caught by `require` checks. In Moloch we hard-coded a few upper limits for certain variables and also used `SafeMath` for all math operations to eliminate the risk of overflows. + +``` +// HARD-CODED LIMITS +// These numbers are quite arbitrary; they are small enough to avoid overflows when doing calculations +// with periods or shares, yet big enough to not limit reasonable use cases. +uint256 constant MAX_VOTING_PERIOD_LENGTH = 10**18; // maximum length of voting period +uint256 constant MAX_GRACE_PERIOD_LENGTH = 10**18; // maximum length of grace period +uint256 constant MAX_DILUTION_BOUND = 10**18; // maximum dilution bound +uint256 constant MAX_NUMBER_OF_SHARES = 10**18; // maximum number of shares that can be minted +``` + +We still check the boundaries, however, as it is not sufficient to check that the maximum value properly fails, it is also necessary to check that *one less than the maximum value* properly succeeds. + +``` + it('success - request 1 less share than the overflow limit', async () => { + proposal1.sharesRequested = _1e18.sub(new BN(1)) // 1 less + await moloch.submitProposal( + proposal1.applicant, + proposal1.tokenTribute, + proposal1.sharesRequested, + proposal1.details, + { from: summoner } + ) + await verifySubmitProposal(proposal1, 0, summoner, { + initialTotalShares: 1, + initialApplicantBalance: proposal1.tokenTribute, + initialProposerBalance: initSummonerBalance + }) + }) + +``` + +### Test All Code Paths + +This likely goes without saying but 100% of the code paths must be tested. For every conditional evaluation, there should be a unique test for each possible outcome. Combinations of conditionals inside a single `if` statement (e.g. `if (a && b)` should be treated as separate conditions (e.g. 4 tests) even if the resulting code path is the same. This combinatorial complexity of code interactions is the fundamental reason why it is so important to keep the smart contract code as simple as possible—not doing so results in exponentially more tests required. + +### Test in a Logical Progression + +Like any codebase, the tests should provide an intuitive map of the territory. The tests should roughly align with the usage flow of the smart contract. For example, the Moloch tests are organized in the same order as the Moloch.sol smart contract: +1. constructor +2. submitProposal +3. submitVote +4. processProposal +5. ragequit +6. abort +7. updateDelegateKey +8. more complex tests (multi-member/proposal) + +The unit tests for each function are organized as follows: +1. happy cases +2. trigger requires +3. check modifiers +4. edge cases \ No newline at end of file diff --git a/lib/Baal/test/Tribute.test.ts b/lib/Baal/test/Tribute.test.ts new file mode 100644 index 0000000..27d68b8 --- /dev/null +++ b/lib/Baal/test/Tribute.test.ts @@ -0,0 +1,315 @@ +import { expect } from 'chai'; +import { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; + +import { + DAOSettings, + defaultDAOSettings, + defaultProposalSettings, + revertMessages, +} from './utils/baal'; +import { moveForwardPeriods } from './utils/evm'; +import { baalSetup, ProposalHelpers, Signer } from './utils/fixtures'; +import { + Baal, + TestERC20, + TributeMinion, + Loot, + MultiSend, + BaalSummoner, + GnosisSafe, + Shares, +} from '../src/types'; +import { encodeMultiAction } from '../src/util'; + +describe("Tribute proposal type", function () { + let baal: Baal; + let lootToken: Loot; + let sharesToken: Shares; + let weth: TestERC20; + let multisend: MultiSend; + + let baalSummoner: BaalSummoner; + let gnosisSafe: GnosisSafe; + + let tributeMinion: TributeMinion; + + let users: { + [key: string]: Signer; + }; + + const yes = true; + const no = false; + + let proposalHelpers: ProposalHelpers; + + beforeEach(async () => { + const { + Baal, + Loot, + Shares, + BaalSummoner, + GnosisSafe, + MultiSend, + TributeMinion, + WETH, + signers, + helpers, + } = await baalSetup({}); + + baal = Baal; + lootToken = Loot; + sharesToken = Shares; + baalSummoner = BaalSummoner; + gnosisSafe = GnosisSafe; + multisend = MultiSend; + weth = WETH; + // poster = Poster; + tributeMinion = TributeMinion; + users = signers; + + proposalHelpers = helpers; + }); + + describe("Dangerous proposal tribute", () => { + const tribute = 100; + const requestedShares = 100; + + it("Allows applicant to tribute tokens in exchange for shares", async () => { + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + + await users.applicant.weth?.approve(gnosisSafe.address, tribute); + + const currentShares = await sharesToken.balanceOf(users.applicant.address); + + const mintShares = baal.interface.encodeFunctionData("mintShares", [ + [users.applicant.address], + [requestedShares], + ]); + const sendTribute = weth.interface.encodeFunctionData( + "transferFrom", + [users.applicant.address, gnosisSafe.address, tribute] + ); + + const encodedProposal = encodeMultiAction( + multisend, + [mintShares, sendTribute], + [baal.address, weth.address], + [BigNumber.from(0), BigNumber.from(0)], + [0, 0] + ); + + await users.applicant.baal?.submitProposal( + encodedProposal, + defaultProposalSettings.EXPIRATION, + defaultProposalSettings.BAAL_GAS, + ethers.utils.id(defaultProposalSettings.DETAILS), + { value: defaultDAOSettings.PROPOSAL_OFFERING } + ); + await baal.submitVote(1, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + await baal.processProposal(1, encodedProposal); + + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(tribute); + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal( + currentShares.add(requestedShares) // current shares plus new shares + ); + }); + + it("EXPLOIT - Allows another proposal to spend tokens intended for tribute", async () => { + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + + await users.applicant.weth?.approve(gnosisSafe.address, tribute); + + const currentShares = await sharesToken.balanceOf(users.applicant.address); + + const mintShares = baal.interface.encodeFunctionData("mintShares", [ + [users.applicant.address], + [requestedShares], + ]); + const sendTribute = weth.interface.encodeFunctionData( + "transferFrom", + [users.applicant.address, gnosisSafe.address, tribute] + ); + + const encodedProposal = encodeMultiAction( + multisend, + [mintShares, sendTribute], + [baal.address, weth.address], + [BigNumber.from(0), BigNumber.from(0)], + [0, 0] + ); + const maliciousProposal = encodeMultiAction( + multisend, + [sendTribute], + [weth.address], + [BigNumber.from(0)], + [0] + ); + + await users.applicant.baal?.submitProposal( + encodedProposal, + defaultProposalSettings.EXPIRATION, + defaultProposalSettings.BAAL_GAS, + ethers.utils.id(defaultProposalSettings.DETAILS), + { value: defaultDAOSettings.PROPOSAL_OFFERING } + ); + await users.applicant.baal?.submitProposal( + maliciousProposal, + defaultProposalSettings.EXPIRATION, + defaultProposalSettings.BAAL_GAS, + ethers.utils.id(defaultProposalSettings.DETAILS), + { value: defaultDAOSettings.PROPOSAL_OFFERING } + ); + await baal.submitVote(1, no); + await baal.submitVote(2, yes); + await moveForwardPeriods(defaultDAOSettings.VOTING_PERIOD_IN_SECONDS, 2); + // await baal.processProposal(1, encodedProposal) + await baal.processProposal(2, maliciousProposal); + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(tribute); + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal(currentShares); // only current shares no new ones + }); + }); + + describe("Baal with NO proposal offering - Safe Tribute Proposal", () => { + + const tribute = 100; + const requestedShares = 1234; + const requestedLoot = 1007; + + it("allows external tribute minion to submit share proposal in exchange for tokens", async () => { + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + expect(await weth.balanceOf(users.applicant.address)).to.equal(1000); + + await users.applicant.weth?.approve(tributeMinion.address, 10000); + + const currentShares = await sharesToken.balanceOf(users.applicant.address); + + users.applicant.tributeMinion && await proposalHelpers.submitAndProcessTributeProposal({ + tributeMinion: users.applicant.tributeMinion, + baal, + applicantAddress: users.applicant.address, + tributeToken: weth.address, + tribute, + requestedShares, + requestedLoot, + }); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal( + requestedShares + parseInt(currentShares.toString()) + ); + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(tribute); + }); + }); + + describe("Baal with proposal offering - Safe Tribute Proposal", function () { + let daoConfig: Partial; + let baal: Baal; + let gnosisSafe: GnosisSafe; + let sharesToken: Shares; + let tributeMinion: TributeMinion; + + const tribute = 100; + const requestedShares = 1234; + const requestedLoot = 1007; + + this.beforeEach(async function () { + daoConfig = { + PROPOSAL_OFFERING: 69, + SPONSOR_THRESHOLD: 101, + }; + const { + Baal, + Shares, + GnosisSafe, + TributeMinion, + } = await baalSetup({ + daoSettings: daoConfig, + }); + baal = Baal; + gnosisSafe = GnosisSafe; + sharesToken = Shares; + tributeMinion = TributeMinion; + }); + + it("allows external tribute minion to submit share proposal in exchange for tokens", async () => { + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + expect(await weth.balanceOf(users.applicant.address)).to.equal(1000); + + await users.applicant.weth?.approve(tributeMinion.address, 10000); + + const currentShares = await sharesToken.balanceOf(users.applicant.address); + + users.applicant.tributeMinion && await proposalHelpers.submitAndProcessTributeProposal({ + tributeMinion: users.applicant.tributeMinion, + baal, + applicantAddress: users.applicant.address, + tributeToken: weth.address, + tribute, + requestedShares, + requestedLoot, + proposalOffering: daoConfig.PROPOSAL_OFFERING + }); + + expect(await sharesToken.balanceOf(users.applicant.address)).to.equal( + requestedShares + parseInt(currentShares.toString()) + ); + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(tribute); + }); + + // tribute proposal can not self sponsor because of potential tx.origin issues + // it("should not fail to tribute without offering", async () => { + // const currentShares = await sharesToken.balanceOf(users.summoner.address); + // // CONDITION: Member should be able to self-sponsor if shares >= SPONSOR_THRESHOLD + // expect(currentShares.gte(BigNumber.from(daoConfig.SPONSOR_THRESHOLD))); + + // // const summonerTributeMinion = tributeMinion.connect(summoner); + // // const requestedShares = 1234; + // // const tribute = 1000; + // // const tributeToken = weth.connect(summoner); + + // expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + // expect(await weth.balanceOf(users.summoner.address)).to.gte(tribute); + + // await users.summoner.weth?.approve(tributeMinion.address, tribute); + + // users.summoner.tributeMinion && await proposalHelpers.submitAndProcessTributeProposal({ + // tributeMinion: users.summoner.tributeMinion, + // baal, + // applicantAddress: users.summoner.address, + // tributeToken: weth.address, + // tribute, + // requestedShares, + // requestedLoot, + // // proposalOffering: daoConfig.PROPOSAL_OFFERING + // }); + + // expect(await sharesToken.balanceOf(users.summoner.address)) + // .to.eq( + // currentShares.add(BigNumber.from(requestedShares)), + // ); + // }); + + it("fails to tribute without offering", async () => { + const currentShares = await sharesToken.balanceOf(users.applicant.address); + // CONDITION: Member should send tribute if shares < SPONSOR_THRESHOLD + expect(currentShares.lt(BigNumber.from(daoConfig.SPONSOR_THRESHOLD))); + + expect(await weth.balanceOf(gnosisSafe.address)).to.equal(0); + expect(await weth.balanceOf(users.applicant.address)).to.equal(1000); + + await users.applicant.weth?.approve(tributeMinion.address, 10000); + + users.applicant.tributeMinion && await expect(users.applicant.tributeMinion.submitTributeProposal( + baal.address, + weth.address, + tribute, + requestedShares, + requestedLoot, + defaultProposalSettings.EXPIRATION, + defaultProposalSettings.BAAL_GAS, + "tribute" + )).to.be.revertedWith(revertMessages.submitProposalOffering); + }); + }); +}); diff --git a/lib/Baal/test/utils/baal.ts b/lib/Baal/test/utils/baal.ts new file mode 100644 index 0000000..300c22f --- /dev/null +++ b/lib/Baal/test/utils/baal.ts @@ -0,0 +1,371 @@ +import { expect } from 'chai'; +import { BigNumber, BigNumberish, Contract, ContractTransaction } from 'ethers'; +import { ethers } from 'hardhat'; + +import { Baal, BaalSummoner, MultiSend, Poster } from '../../src/types'; +import { encodeMultiAction } from '../../src/util'; +import { moveForwardPeriods } from './evm'; +import { getSaltNonce } from './safe'; + +export type DAOSettings = { + PROPOSAL_OFFERING: any; + GRACE_PERIOD_IN_SECONDS: any; + VOTING_PERIOD_IN_SECONDS: any; + QUORUM_PERCENT: any; + SPONSOR_THRESHOLD: any; + MIN_RETENTION_PERCENT: any; + MIN_STAKING_PERCENT: any; + TOKEN_NAME: any; + TOKEN_SYMBOL: any; +}; + +export const abiCoder = ethers.utils.defaultAbiCoder; + +export const revertMessages = { + molochAlreadyInitialized: "Initializable: contract is already initialized", + molochConstructorSharesCannotBe0: "shares cannot be 0", + molochConstructorVotingPeriodCannotBe0: "votingPeriod cannot be 0", + submitProposalExpired: "expired", + submitProposalOffering: "Baal requires an offering", + submitProposalVotingPeriod: "!votingPeriod", + submitProposalArrays: "!array parity", + submitProposalArrayMax: "array max", + submitProposalFlag: "!flag", + sponsorProposalExpired: "expired", + sponsorProposalSponsor: "!sponsor", + sponsorProposalExists: "!exist", + sponsorProposalSponsored: "sponsored", + submitVoteNotSponsored: "!sponsored", + submitVoteTimeEnded: "ended", + submitVoteVoted: "voted", + submitVoteMember: "!member", + submitVoteWithSigTimeEnded: "ended", + submitVoteWithSigVoted: "voted", + submitVoteWithSigMember: "!member", + proposalMisnumbered: "!exist", + unsetGuildTokensLastToken: + "reverted with panic code 0x32 (Array accessed at an out-of-bounds or negative index)", + sharesTransferPaused: "shares: !transferable", + sharesInsufficientBalance: + "ERC20: transfer amount exceeds balance", + + // ----- + lootAlreadyInitialized: "Initializable: contract is already initialized", + molochSetupSharesNoShares: "shares != 0", + proposalNotSponsored: "!sponsor", + sponsorProposalNotSubmitted: "!submitted", + submitVoteNotVoting: "!voting", + processProposalNotReady: "!ready", + ragequitUnordered: "!order", + // unsetGuildTokensLastToken: 'reverted with panic code 0x32 (Array accessed at an out-of-bounds or negative index)', + sharesInsufficientApproval: "ERC20: insufficient allowance", // Error: Transaction reverted without a reason string + lootTransferPaused: "loot: !transferable", + lootInsufficientBalance: + "ERC20: transfer amount exceeds balance", + // lootInsufficientApproval: 'reverted with panic code 0x11 (Arithmetic operation underflowed or overflowed outside of an unchecked block)', + lootInsufficientApproval: "ERC20: insufficient allowance", // Error: Transaction reverted without a reason string + mintSharesArrayParity: "!array parity", + burnSharesArrayParity: "!array parity", + burnSharesInsufficientShares: "ERC20: burn amount exceeds balance", + mintLootArrayParity: "!array parity", + burnLootArrayParity: "!array parity", + burnLootInsufficientShares: + "ERC20: burn amount exceeds balance", + cancelProposalNotVoting: "!voting", + cancelProposalNotCancellable: "!cancellable", + baalOrAdmin: "!baal & !admin", + baalOrManager: "!baal & !manager", + baalOrGovernor: "!baal & !governor", + permitNotAuthorized: "!authorized", + permitExpired: "expired", + notEnoughGas: "not enough gas", + baalGasToHigh: "baalGas to high", + OwnableCallerIsNotTheOwner: "Ownable: caller is not the owner", +}; + +export type ProposalType = { + flag: BigNumberish; + account?: `0x${string}`; + data: string; + details: string; + expiration: BigNumberish; + baalGas: BigNumberish; +}; + +export const PROPOSAL_STATES = { + UNBORN: 0, + SUBMITTED: 1, + VOTING: 2, + CANCELLED: 3, + GRACE: 4, + READY: 5, + PROCESSED: 6, + DEEFEATED: 7, +}; + +export enum SHAMAN_PERMISSIONS { + NONE, + ADMIN, + MANAGER, + ADMIN_MANAGER, + GOVERNANCE, + ADMIN_GOVERNANCE, + MANAGER_GOVERNANCE, + ALL, +}; + +export const defaultDAOSettings: DAOSettings = { + GRACE_PERIOD_IN_SECONDS: 43200, + VOTING_PERIOD_IN_SECONDS: 432000, + PROPOSAL_OFFERING: 0, + SPONSOR_THRESHOLD: 1, + MIN_RETENTION_PERCENT: 0, + MIN_STAKING_PERCENT: 0, + QUORUM_PERCENT: 0, + TOKEN_NAME: "wrapped ETH", + TOKEN_SYMBOL: "WETH", +}; + +export const defaultMetadataConfig = { + CONTENT: '{"name":"test"}', + TAG: "daohaus.summoner.daoProfile", +}; + +export const defaultProposalSettings = { + DETAILS: 'all hail baal', + EXPIRATION: 0, + BAAL_GAS: 0, +}; + +export type SummonSetup = { + loot: number; + lootPaused: boolean; + shamanPermissions: SHAMAN_PERMISSIONS; + shares: number; + sharesPaused: boolean; +}; + +export const defaultSummonSetup: SummonSetup = { + loot: 500, + lootPaused: false, + shamanPermissions: SHAMAN_PERMISSIONS.ALL, + shares: 100, + sharesPaused: false, +}; + +export type NewBaalParams = { + baalSummoner: Contract; + baalSingleton: Baal; + poster: Poster; + config: DAOSettings; + adminConfig: [boolean, boolean]; + shamans: [string[], number[]]; + shares: [string[], number[]]; + loots: [string[], number[]]; + safeAddress?: `0x${string}`; + forwarderAddress?: `0x${string}`; + lootAddress?: `0x${string}`; + sharesAddress?: `0x${string}`; + saltNonceOverride?: string; +} + +export type NewBaalAddresses = { + baal: string; + loot: string; + shares: string; + safe: string; +} + +export const getNewBaalAddresses = async (tx: ContractTransaction): Promise => { + const receipt = await ethers.provider.getTransactionReceipt(tx.hash); + // console.log({logs: receipt.logs}) + let baalSummonAbi = [ + "event SummonBaal(address indexed baal, address indexed loot, address indexed shares, address safe, address forwarder, uint256 existingAddrs)", + ]; + let iface = new ethers.utils.Interface(baalSummonAbi); + let log = iface.parseLog(receipt.logs[receipt.logs.length - 1]); + const { baal, loot, shares, safe } = log.args; + return { baal, loot, shares, safe }; +}; + +export const getBaalParams = async function ( + baal: Baal, + poster: Poster, + config: DAOSettings, + adminConfig: [boolean, boolean], + shamans: [string[], number[]], + shares: [string[], number[]], + loots: [string[], number[]], + safeAddress: string = ethers.constants.AddressZero, + forwarderAddress: string = ethers.constants.AddressZero, + lootAddress: string = ethers.constants.AddressZero, + sharesAddress: string = ethers.constants.AddressZero, +) { + const governanceConfig = abiCoder.encode( + ["uint32", "uint32", "uint256", "uint256", "uint256", "uint256"], + [ + config.VOTING_PERIOD_IN_SECONDS, + config.GRACE_PERIOD_IN_SECONDS, + config.PROPOSAL_OFFERING, + config.QUORUM_PERCENT, + config.SPONSOR_THRESHOLD, + config.MIN_RETENTION_PERCENT, + ] + ); + + const setAdminConfig = await baal.interface.encodeFunctionData( + "setAdminConfig", + adminConfig + ); + const setGovernanceConfig = await baal.interface.encodeFunctionData( + "setGovernanceConfig", + [governanceConfig] + ); + const setShaman = await baal.interface.encodeFunctionData( + "setShamans", + shamans + ); + const mintShares = await baal.interface.encodeFunctionData( + "mintShares", + shares + ); + const mintLoot = await baal.interface.encodeFunctionData("mintLoot", loots); + const postMetaData = await poster.interface.encodeFunctionData("post", [ + defaultMetadataConfig.CONTENT, + defaultMetadataConfig.TAG, + ]); + const posterFromBaal = await baal.interface.encodeFunctionData( + "executeAsBaal", + [poster.address, 0, postMetaData] + ); + + const initalizationActions = [ + setAdminConfig, + setGovernanceConfig, + setShaman, + mintShares, + mintLoot, + posterFromBaal, + ]; + + return { + initParams: abiCoder.encode( + ["string", "string", "address", "address", "address", "address"], + [ + config.TOKEN_NAME, + config.TOKEN_SYMBOL, + safeAddress, + forwarderAddress, + lootAddress, + sharesAddress, + ], + ), + initalizationActions, + }; +}; + +// export const setupBaal = async (params: NewBaalParams) => { +export const setupBaal = async ({ + baalSummoner, + baalSingleton, + poster, + config, + adminConfig, + shamans, + shares, + loots, + safeAddress, + forwarderAddress, + lootAddress, + sharesAddress, + saltNonceOverride +}: NewBaalParams) => { + const saltNonce = saltNonceOverride || getSaltNonce(); + const encodedInitParams = await getBaalParams( + baalSingleton, + poster, + config, + adminConfig, + shamans, + shares, + loots, + safeAddress, + forwarderAddress, + lootAddress, + sharesAddress, + ); + const tx = await (baalSummoner as BaalSummoner).summonBaal( + encodedInitParams.initParams, + encodedInitParams.initalizationActions, + saltNonce, + ); + return await getNewBaalAddresses(tx); +}; + +export type ProposalParams = { + baal: Baal; + encodedAction: string; + proposal: ProposalType; + proposalId?: BigNumberish; + daoSettings?: DAOSettings; + extraSeconds?: number; +}; + +export const submitAndProcessProposal = async ({ + baal, + encodedAction, + proposal, + proposalId, + daoSettings = defaultDAOSettings, + extraSeconds = 2, + }: ProposalParams) => { + await baal.submitProposal(encodedAction, proposal.expiration, proposal.baalGas, ethers.utils.id(proposal.details)); + const id = proposalId ? proposalId : await baal.proposalCount(); + await baal.submitVote(id, true); + await moveForwardPeriods(daoSettings.VOTING_PERIOD_IN_SECONDS, extraSeconds); + return await baal.processProposal(id, encodedAction); + }; + +export const setShamanProposal = async ( + baal: Baal, + multisend: MultiSend, + shamanAddress: string, + permission: BigNumberish, + daoSettings = defaultDAOSettings, + extraSeconds = 2, +) => { + const setShaman = baal.interface.encodeFunctionData('setShamans', [ + [shamanAddress], + [permission], + ]); + const setShamanAction = encodeMultiAction( + multisend, + [setShaman], + [baal.address], + [BigNumber.from(0)], + [0] + ); + + // ---- + await baal.submitProposal(setShamanAction, 0, 0, ''); + const proposalId = await baal.proposalCount(); + await baal.submitVote(proposalId, true); + await moveForwardPeriods(daoSettings.VOTING_PERIOD_IN_SECONDS, extraSeconds); + await baal.processProposal(proposalId, setShamanAction); + return proposalId; +}; + +export const verifyProposal = (prop1: any, prop2: any, overrides?: any) => { + for (let key in prop1) { + if (Number.isInteger(+key)) { + continue; + } + if (overrides && key in overrides) { + // console.log('override', key) + expect(prop1[key]).to.equal(overrides[key]); + } else { + // console.log('check', key) + expect(prop1[key]).to.equal(prop2[key]); + } + } +}; diff --git a/lib/Baal/test/utils/evm.ts b/lib/Baal/test/utils/evm.ts new file mode 100644 index 0000000..72d5e9f --- /dev/null +++ b/lib/Baal/test/utils/evm.ts @@ -0,0 +1,18 @@ +import { mine, time } from "@nomicfoundation/hardhat-network-helpers"; + +export const blockTime = async () => { + return time.latest(); +}; + +export const blockNumber = async () => { + return time.latestBlock(); +}; + +export const moveForwardPeriods = async ( + blockTimeInSecs: number, + blocks: number, + extra: number = 1 +) => { + await mine(blocks + extra, { interval: blockTimeInSecs }); + return true; +}; diff --git a/lib/Baal/test/utils/fixtures.ts b/lib/Baal/test/utils/fixtures.ts new file mode 100644 index 0000000..59ff835 --- /dev/null +++ b/lib/Baal/test/utils/fixtures.ts @@ -0,0 +1,378 @@ +import { deployments } from 'hardhat'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; + +import { Baal, BaalLessShares, BaalSummoner, GnosisSafe, Loot, MockBaal, MultiSend, Poster, Shares, TestERC20, TributeMinion } from '../../src/types'; +import { DAOSettings, NewBaalAddresses, NewBaalParams, ProposalParams, ProposalType, SummonSetup, defaultDAOSettings, defaultSummonSetup, setShamanProposal, setupBaal, submitAndProcessProposal } from './baal'; +import { BigNumberish, ContractTransaction } from 'ethers'; +import { TributeProposalParams, TributeProposalStatus, submitAndProcessTributeProposal } from './tribute'; + +export type Signer = { + address: string; + sharesInitial: number; + lootInitial: number; + baal?: Baal; + loot?: Loot; + shares?: Shares; + tributeMinion?: TributeMinion; + weth?: TestERC20; + dai?: TestERC20; + }; + +export type ProposalHelpers = { + submitAndProcessProposal: (params: Omit) => Promise, + submitAndProcessTributeProposal: (params: Omit) => Promise, + setShamanProposal: (baal: Baal, multisend: MultiSend, shamanAddress: string, permission: BigNumberish) => Promise, +}; + +export type BaalSetupType = { + Loot: Loot; + Shares: Shares; + Baal: Baal; + BaalSummoner: BaalSummoner; + GnosisSafe: GnosisSafe; + MultiSend: MultiSend; + Poster?: Poster; + TributeMinion: TributeMinion; + WETH: TestERC20; + DAI: TestERC20; + signers: { + [key: string]: Signer; + }; + daoSettings: DAOSettings; + helpers: ProposalHelpers; +} + +type MockBaalSetupType = { + Loot: Loot; + LootSingleton: Loot; + MockBaal: MockBaal; + signers: { + [key: string]: Signer; + }; +} + +type MockBaalLessTokenSetupType = { + BaalLessShares: BaalLessShares; +} + +export type SetupUsersParams = { + addresses: NewBaalAddresses; + baal: Baal; + hre: HardhatRuntimeEnvironment; +}; + +export type UsersSetup = { + dai: TestERC20; + weth: TestERC20; + signers: { [key: string]: Signer }; +} + +type BaalSetupOpts = { + fixtureTags?: Array; + daoSettings?: Partial; + summonSetupOpts?: Partial; + safeAddress?: `0x${string}`; + forwarderAddress?: `0x${string}`; + lootAddress?: `0x${string}`; + sharesAddress?: `0x${string}`; + setupBaalOverride?: (params: NewBaalParams) => Promise; + setupUsersOverride?: (params: SetupUsersParams) => Promise; +} + +export const setupUsersDefault = async ({ + // addresses, + baal, + hre, +}: SetupUsersParams) => { + const { ethers, deployments, getNamedAccounts, getUnnamedAccounts } = hre; + const { deployer } = await getNamedAccounts(); + const [summoner, applicant, shaman, s1, s2, s3, s4, s5, s6] = await getUnnamedAccounts(); + + const tributeMinion = (await ethers.getContract('TributeMinion', deployer)) as TributeMinion; + + const lootTokenAddress = await baal.lootToken(); + const lootToken = (await ethers.getContractAt('Loot', lootTokenAddress)) as Loot; + + const sharesTokenAddress = await baal.sharesToken(); + const sharesToken = (await ethers.getContractAt('Shares', sharesTokenAddress)) as Shares; + + const wethDeployed = await deployments.deploy('TestERC20', { + from: deployer, + args: ['WETH', 'WETH', ethers.utils.parseUnits('10000000', 'ether')] + }); + + const daiDeployed = await deployments.deploy('TestERC20', { + from: deployer, + args: ['DAI', 'DAI', ethers.utils.parseUnits('10000000', 'ether')] + }); + + const weth = (await ethers.getContractAt('TestERC20', wethDeployed.address, deployer)) as TestERC20; + await weth.transfer(summoner, 1000); + await weth.transfer(applicant, 1000); + + const dai = (await ethers.getContractAt('TestERC20', daiDeployed.address, deployer)) as TestERC20; + await dai.transfer(summoner, ethers.utils.parseUnits('10', 'ether')); + await dai.transfer(applicant, ethers.utils.parseUnits('10', 'ether')); + await dai.transfer(s1, ethers.utils.parseUnits('10', 'ether')); + await dai.transfer(s2, ethers.utils.parseUnits('10', 'ether')); + + return { + weth, + dai, + signers: { + summoner: { + address: summoner, + baal: baal, + loot: (await ethers.getContractAt('Loot', lootToken.address, summoner)) as Loot, + lootInitial: (await lootToken.balanceOf(summoner)).toNumber(), + shares: (await ethers.getContractAt('Shares', sharesTokenAddress, summoner)) as Shares, + sharesInitial: (await sharesToken.balanceOf(summoner)).toNumber(), + tributeMinion: (await ethers.getContractAt('TributeMinion', tributeMinion.address, summoner)) as TributeMinion, + weth: (await ethers.getContractAt('TestERC20', weth.address, summoner)) as TestERC20, + dai: (await ethers.getContractAt('TestERC20', dai.address, summoner)) as TestERC20, + }, + applicant: { + address: applicant, + baal: (await ethers.getContractAt('Baal', baal.address, applicant)) as Baal, + loot: (await ethers.getContractAt('Loot', lootToken.address, applicant)) as Loot, + lootInitial: (await lootToken.balanceOf(applicant)).toNumber(), + shares: (await ethers.getContractAt('Shares', sharesToken.address, applicant)) as Shares, + sharesInitial: (await sharesToken.balanceOf(applicant)).toNumber(), + tributeMinion: (await ethers.getContractAt('TributeMinion', tributeMinion.address, applicant)) as TributeMinion, + weth: (await ethers.getContractAt('TestERC20', weth.address, applicant)) as TestERC20, + dai: (await ethers.getContractAt('TestERC20', dai.address, applicant)) as TestERC20, + }, + shaman: { + address: shaman, + baal: (await ethers.getContractAt('Baal', baal.address, shaman)) as Baal, + loot: (await ethers.getContractAt('Loot', lootToken.address, shaman)) as Loot, + lootInitial: 0, + sharesInitial: 0, + shares: (await ethers.getContractAt('Shares', sharesToken.address, shaman)) as Shares, + }, + s1: { + address: s1, + baal: (await ethers.getContractAt('Baal', baal.address, s1)) as Baal, + lootInitial: 0, + sharesInitial: 0, + weth: (await ethers.getContractAt('TestERC20', weth.address, s1)) as TestERC20, + dai: (await ethers.getContractAt('TestERC20', dai.address, s1)) as TestERC20, + }, + s2: { + address: s2, + baal: (await ethers.getContractAt('Baal', baal.address, s2)) as Baal, + lootInitial: 0, + sharesInitial: 0, + weth: (await ethers.getContractAt('TestERC20', weth.address, s2)) as TestERC20, + dai: (await ethers.getContractAt('TestERC20', dai.address, s2)) as TestERC20, + }, + s3: { + address: s3, + baal: (await ethers.getContractAt('Baal', baal.address, s3)) as Baal, + lootInitial: 0, + sharesInitial: 0, + }, + s4: { + address: s4, + baal: (await ethers.getContractAt('Baal', baal.address, s4)) as Baal, + lootInitial: 0, + sharesInitial: 0, + }, + s5: { + address: s5, + baal: (await ethers.getContractAt('Baal', baal.address, s5)) as Baal, + lootInitial: 0, + sharesInitial: 0, + }, + s6: { + address: s6, + baal: (await ethers.getContractAt('Baal', baal.address, s6)) as Baal, + lootInitial: 0, + sharesInitial: 0, + }, + }, + }; +} + +export const baalSetup = deployments.createFixture( + async (hre: HardhatRuntimeEnvironment, options?: BaalSetupOpts +) => { + const { ethers, deployments, getNamedAccounts, getUnnamedAccounts } = hre; + const { deployer } = await getNamedAccounts(); + const [summoner, applicant, shaman] = await getUnnamedAccounts(); + + await deployments.fixture(['Infra', 'TributeMinion', 'BaalSummoner', ...(options?.fixtureTags || [])]); // Deployment Tags + + console.log('baalSetup fixture', options); + // console.log('deployments', Object.keys(await deployments.all())); + + const loot = options?.summonSetupOpts?.loot || defaultSummonSetup.loot; + const lootPaused = options?.summonSetupOpts?.lootPaused || defaultSummonSetup.lootPaused; + const shares = options?.summonSetupOpts?.shares || defaultSummonSetup.shares; + const sharesPaused = options?.summonSetupOpts?.sharesPaused || defaultSummonSetup.sharesPaused; + const shamanPermissions = options?.summonSetupOpts?.shamanPermissions || defaultSummonSetup.shamanPermissions; + + const baalSingleton = (await ethers.getContract('Baal', deployer)) as Baal; + const baalSummoner = (await ethers.getContract('BaalSummoner', deployer)) as BaalSummoner; + const poster = (await ethers.getContract('Poster', deployer)) as Poster + const tributeMinion = (await ethers.getContract('TributeMinion', deployer)) as TributeMinion; + + const summonerDist = { + shares: shares * 2, + loot, + }; + const applicantDist = { shares, loot }; + + const daoSettings = { + ...defaultDAOSettings, + ...options?.daoSettings, + }; + + const setupParams: NewBaalParams = { + baalSummoner, + baalSingleton, + poster, + config: daoSettings, + adminConfig: [sharesPaused, lootPaused], + shamans: [[shaman], [shamanPermissions]], + shares: [ + [summoner, applicant], + [summonerDist.shares, applicantDist.shares] + ], + loots: [ + [summoner, applicant], + [summonerDist.loot, applicantDist.loot] + ], + safeAddress: options?.safeAddress, + forwarderAddress: options?.forwarderAddress, + lootAddress: options?.lootAddress, + sharesAddress: options?.sharesAddress, + }; + + const addresses = options?.setupBaalOverride + ? await options.setupBaalOverride(setupParams) + : await setupBaal(setupParams); // use default setup + // console.log('addresses', addresses); + + const baal = (await ethers.getContractAt('Baal', addresses.baal, summoner)) as Baal; + const gnosisSafe = (await ethers.getContractAt('GnosisSafe', addresses.safe)) as GnosisSafe; + + const lootTokenAddress = await baal.lootToken(); + const lootToken = (await ethers.getContractAt('Loot', lootTokenAddress)) as Loot; + + const sharesTokenAddress = await baal.sharesToken(); + const sharesToken = (await ethers.getContractAt('Shares', sharesTokenAddress)) as Shares; + + const { + dai, + weth, + signers, + } = options?.setupUsersOverride + ? await options.setupUsersOverride({ addresses, baal, hre }) + : await setupUsersDefault({ addresses, baal, hre }); + + return { + daoSettings, + Loot: lootToken, + Shares: sharesToken, + // Baal: (await ethers.getContract('Baal', deployer)) as Baal, + Baal: baal, + BaalSummoner: baalSummoner, + GnosisSafe: gnosisSafe, + MultiSend: (await ethers.getContract('MultiSend', deployer)) as MultiSend, + // Poster: poster, + TributeMinion: tributeMinion, + WETH: weth, + DAI: dai, + signers, + helpers: { + setShamanProposal: (baal, multisend, shamanAddress, permission) => { + return setShamanProposal(baal, multisend, shamanAddress, permission, daoSettings); + }, + submitAndProcessProposal: (params) => { + return submitAndProcessProposal({ ...params, daoSettings }); + }, + submitAndProcessTributeProposal(params) { + return submitAndProcessTributeProposal({ ...params, daoSettings }); + }, + } + }; + + +}, 'setupBaal'); + +export const mockBaalSetup = deployments.createFixture( + async (hre: HardhatRuntimeEnvironment, options?: unknown +) => { + const { ethers, deployments, getNamedAccounts, getUnnamedAccounts } = hre; + const { deployer } = await getNamedAccounts(); + const [summoner, , , s1, s2] = await getUnnamedAccounts(); + + await deployments.fixture(['Infra', 'BaalSummoner']); + + const lootSingleton = (await ethers.getContract('Loot', deployer)) as Loot; + await deployments.deploy('MockBaal', { + contract: 'MockBaal', + from: deployer, + args: [ + lootSingleton.address, + 'NAME', + 'SYMBOL' + ], + log: false, + }); + + const mockBaal = (await ethers.getContract('MockBaal', deployer)) as MockBaal; + const lootTokenAddress = await mockBaal.lootToken(); + await mockBaal.mintLoot(summoner, 500); + + return { + Loot: (await ethers.getContractAt('Loot', lootTokenAddress)) as Loot, + LootSingleton: lootSingleton, + MockBaal: mockBaal, + signers: { + summoner: { + address: summoner, + loot: (await ethers.getContractAt('Loot', lootTokenAddress, summoner)) as Loot, + lootInitial: 0, + sharesInitial: 0, + + }, + s1: { + address: s1, + loot: (await ethers.getContractAt('Loot', lootTokenAddress, s1)) as Loot, + lootInitial: 0, + sharesInitial: 0, + }, + s2: { + address: s2, + loot: (await ethers.getContractAt('Loot', lootTokenAddress, s2)) as Loot, + lootInitial: 0, + sharesInitial: 0, + }, + } + }; +}, 'setupMockBaal'); + +export const mockBaalLessSharesSetup = deployments.createFixture( + async (hre: HardhatRuntimeEnvironment, options?: unknown +) => { + const { ethers, deployments, getNamedAccounts, getUnnamedAccounts } = hre; + const { deployer } = await getNamedAccounts(); + const [summoner] = await getUnnamedAccounts(); + + // await deployments.fixture(['Infra', 'BaalSummoner']); + + await deployments.deploy('BaalLessShares', { + contract: 'BaalLessShares', + from: deployer, + args: [], + log: false, + }); + + const baalLessSharesSingleton = (await ethers.getContract('BaalLessShares', deployer)) as BaalLessShares; + + return { + BaalLessShares: baalLessSharesSingleton, + }; +}, 'setupBaalLessShares'); diff --git a/lib/Baal/test/utils/index.ts b/lib/Baal/test/utils/index.ts new file mode 100644 index 0000000..fa50e16 --- /dev/null +++ b/lib/Baal/test/utils/index.ts @@ -0,0 +1,6 @@ +export * from './baal'; +export * from './evm'; +export * from './token'; +export * from './tribute'; +export * from './fixtures'; +export * from './safe'; diff --git a/lib/Baal/test/utils/safe.ts b/lib/Baal/test/utils/safe.ts new file mode 100644 index 0000000..7e93c62 --- /dev/null +++ b/lib/Baal/test/utils/safe.ts @@ -0,0 +1,49 @@ +import { ethers } from "hardhat"; + +import { GnosisSafeProxyFactory } from "../../src/types"; + +export const getSaltNonce = (length = 24) => { + let text = ''; + const possible = '0123456789'; + for (let i = 0; i < length; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; +}; + +const getSafeAddressFromRevertMessage = (e: any): string => { + if (e.error.data) { + return ethers.utils.getAddress(e.error.data.slice(138, 178)); + } + const messages: string[] = e.error.split(' '); + return messages.find((m) => m.match(/^0x[a-fA-F0-9]{40,44}$/))?.replace(',', '') ?? ethers.constants.AddressZero; +}; + +export const calculateSafeProxyAddress = async ({ + gnosisSafeProxyFactory, + initializer = "0x", + masterCopyAddress, + saltNonce, +} : { + gnosisSafeProxyFactory: GnosisSafeProxyFactory; + initializer?: string; + masterCopyAddress: string; + saltNonce: string; +}) => { + + const signer = await ethers.getSigner(gnosisSafeProxyFactory.address); + + let expectedSafeAddress = ethers.constants.AddressZero; + try { + await gnosisSafeProxyFactory.connect(signer).estimateGas.calculateCreateProxyWithNonceAddress( + masterCopyAddress, + initializer, + saltNonce, + { from: gnosisSafeProxyFactory.address } + ); + } catch (e: unknown) { + expectedSafeAddress = getSafeAddressFromRevertMessage(e); + } finally { + return expectedSafeAddress; + } +}; diff --git a/lib/Baal/test/utils/token.ts b/lib/Baal/test/utils/token.ts new file mode 100644 index 0000000..0f52736 --- /dev/null +++ b/lib/Baal/test/utils/token.ts @@ -0,0 +1,5 @@ + +export const sharesRevertMessages = { + invalidNonce: "ERC20Votes: invalid nonce", + signatureExpired: "ERC20Votes: signature expired", +}; diff --git a/lib/Baal/test/utils/tribute.ts b/lib/Baal/test/utils/tribute.ts new file mode 100644 index 0000000..15958cf --- /dev/null +++ b/lib/Baal/test/utils/tribute.ts @@ -0,0 +1,89 @@ +import { DAOSettings, defaultDAOSettings } from './baal'; +import { moveForwardPeriods } from './evm'; +import { Baal, TributeMinion } from '../../src/types'; +import { BigNumber } from 'ethers'; + +const yes = true; + +export type TributeProposalParams = { + tributeMinion: TributeMinion, + baal: Baal, + applicantAddress: string, + tributeToken: string, + tribute: number, + requestedShares: number, + requestedLoot: number, + sponsor?: boolean; + proposalId?: number; + proposalOffering?: number; + proposalExpiration?: number; + proposalBaalGas?: number; + daoSettings?: DAOSettings; + extraSeconds?: number; +}; + +export type TributeProposalStatus = { + spentInGas: BigNumber; + state: number; + propStatus: [boolean, boolean, boolean, boolean]; +}; + +export const submitAndProcessTributeProposal = async ({ + tributeMinion, + baal, + applicantAddress, + tributeToken, + tribute, + requestedShares, + requestedLoot, + sponsor = true, + proposalId = 1, + proposalOffering = 0, + proposalExpiration = 0, + proposalBaalGas = 0, + daoSettings = defaultDAOSettings, + extraSeconds = 2, +}: TributeProposalParams): Promise => { + + const tx_1 = await tributeMinion.submitTributeProposal( + baal.address, + tributeToken, + tribute, + requestedShares, + requestedLoot, + proposalExpiration, + proposalBaalGas, + "tribute", + { value: proposalOffering }, + ); + const tx_1_r = await tx_1.wait(); + const tx_2 = sponsor ? await baal.sponsorProposal(proposalId) : undefined; + const tx_2_r = tx_2 ? await tx_2.wait() : undefined; + const tx_3 = await baal.submitVote(proposalId, yes); + const tx_3_r = await tx_3.wait(); + await moveForwardPeriods(daoSettings.VOTING_PERIOD_IN_SECONDS, extraSeconds); + + const encodedProposal = await tributeMinion.encodeTributeProposal( + baal.address, + requestedShares, + requestedLoot, + applicantAddress, + proposalId, + tributeMinion.address, + ); + + const tx_4 = await baal.processProposal(proposalId, encodedProposal); + const tx_4_r = await tx_4.wait(); + + const state = await baal.state(proposalId); + const propStatus = await baal.getProposalStatus(proposalId); + + return { + spentInGas: tx_1_r.gasUsed.mul(tx_1_r.effectiveGasPrice) + .add(tx_2_r ? tx_2_r.gasUsed.mul(tx_2_r.effectiveGasPrice) : BigNumber.from(0)) + .add(tx_3_r.gasUsed.mul(tx_3_r.effectiveGasPrice)) + .add(tx_4_r.gasUsed.mul(tx_4_r.effectiveGasPrice)), + state, + propStatus, + }; +}; diff --git a/lib/Baal/tsconfig.build.json b/lib/Baal/tsconfig.build.json new file mode 100644 index 0000000..8a48ab1 --- /dev/null +++ b/lib/Baal/tsconfig.build.json @@ -0,0 +1,54 @@ +{ + "compilerOptions": { + "assumeChangesOnlyAffectDirectDependencies": true, + "allowSyntheticDefaultImports": true, + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true, + "incremental": true, + "composite": true, + "lib": ["esnext"], + "module": "CommonJS", + "moduleResolution": "node", + "noImplicitThis": true, + "outDir": "dist", + "skipLibCheck": true, + "strict": true, + "strictNullChecks": true, + "target": "es6" + }, + "files": [ + "src/index.ts", + "src/hardhat/index.ts" + ], + "include": [ + "hardhat.config.ts", + "src/types/contracts/Baal.ts", + "src/types/factories/contracts/Baal__factory.ts", + "src/types/contracts/BaalSummoner.ts", + "src/types/factories/contracts/BaalSummoner__factory.ts", + "src/types/factories/contracts/BaalSummoner__factory.ts", + "src/types/contracts/higherOrderFactories/BaalAdvTokenSummoner.ts", + "src/types/factories/contracts/higherOrderFactories/BaalAdvTokenSummoner__factory.ts", + "src/types/contracts/higherOrderFactories/BaalAndVaultSummoner.ts", + "src/types/factories/contracts/higherOrderFactories/BaalAndVaultSummoner__factory.ts", + "src/types/contracts/LootERC20.sol/Loot.ts", + "src/types/factories/contracts/LootERC20.sol/Loot__factory.ts", + "src/types/contracts/SharesERC20.sol/Shares.ts", + "src/types/factories/contracts/SharesERC20.sol/Shares__factory.ts", + "src/types/contracts/utils/Poster.ts", + "src/types/factories/contracts/utils/Poster__factory.ts", + "src/types/contracts/tools/TributeMinion.sol/TributeMinion.ts", + "src/types/factories/contracts/tools/TributeMinion.sol/TributeMinion__factory.ts", + "src/types/@gnosis.pm/safe-contracts/contracts/libraries/MultiSend.ts", + "src/types/factories/@gnosis.pm/safe-contracts/contracts/libraries/MultiSend__factory.ts", + "src/types/contracts/interfaces/IBaalToken.ts", + "src/types/contracts/interfaces/IBaal.ts", + "src/types/common.ts", + "src/**/*.ts", + "tasks/*.ts", + "test/utils/*.ts" + ] +} diff --git a/lib/Baal/tsconfig.deploy.json b/lib/Baal/tsconfig.deploy.json new file mode 100644 index 0000000..2c52702 --- /dev/null +++ b/lib/Baal/tsconfig.deploy.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "downlevelIteration": true, + "skipLibCheck": true, + "outDir": "export" + }, + "include": [ + "hardhat.config.ts", + "./deploy" + ], +} \ No newline at end of file diff --git a/lib/Baal/tsconfig.json b/lib/Baal/tsconfig.json new file mode 100644 index 0000000..9e8920a --- /dev/null +++ b/lib/Baal/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "types": [ + "chai", + "node" + ], + "target": "es2018", + "module": "commonjs", + "strict": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "outDir": "dist" + }, + "include": [ + "src/index.ts", + "src/types/**/*.ts", + "src/types/common.ts", + "src/addresses/*.ts", + "abi/**/*.json", + "hardhat.config.ts", + "./scripts", + "./deploy", + "./test", + "typechain/**/*" + ], +} diff --git a/lib/Baal/yarn.lock b/lib/Baal/yarn.lock new file mode 100644 index 0000000..687ef2d --- /dev/null +++ b/lib/Baal/yarn.lock @@ -0,0 +1,5477 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@aws-crypto/sha256-js@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-1.2.2.tgz#02acd1a1fda92896fc5a28ec7c6e164644ea32fc" + integrity sha512-Nr1QJIbW/afYYGzYvrF70LtaHrIRtd4TNAglX8BvlfxJLZ45SAmueIKYl5tWoNBPzp65ymXGFK0Bb1vZUpuc9g== + dependencies: + "@aws-crypto/util" "^1.2.2" + "@aws-sdk/types" "^3.1.0" + tslib "^1.11.1" + +"@aws-crypto/util@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/util/-/util-1.2.2.tgz#b28f7897730eb6538b21c18bd4de22d0ea09003c" + integrity sha512-H8PjG5WJ4wz0UXAFXeJjWCW1vkvIJ3qUUD+rGRwJ2/hj+xT58Qle2MTql/2MGzkU+1JLAFuR6aJpLAjHwhmwwg== + dependencies: + "@aws-sdk/types" "^3.1.0" + "@aws-sdk/util-utf8-browser" "^3.0.0" + tslib "^1.11.1" + +"@aws-sdk/types@^3.1.0": + version "3.485.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.485.0.tgz#9ffebb602bba4b6b75e2b037ee93a8735c06da3e" + integrity sha512-+QW32YQdvZRDOwrAQPo/qCyXoSjgXB6RwJwCwkd8ebJXRXw6tmGKIHaZqYHt/LtBymvnaBgBBADNa4+qFvlOFw== + dependencies: + "@smithy/types" "^2.8.0" + tslib "^2.5.0" + +"@aws-sdk/util-utf8-browser@^3.0.0": + version "3.259.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" + integrity sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw== + dependencies: + tslib "^2.3.1" + +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.5.0": + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.4.tgz#f6e01b6ed391a505932698ecc0d9e7a99ee60362" + integrity sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.6.1", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.6.1", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.6.1", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.6.1", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.6.1", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.6.0", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/networks@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.0.tgz#df72a392f1a63a57f87210515695a31a245845ad" + integrity sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.6.0", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.6.1", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0", "@ethersproject/wallet@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/web@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.0.tgz#40850c05260edad8b54827923bbad23d96aac0bc" + integrity sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@fastify/busboy@^2.0.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" + integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== + +"@gnosis.pm/mock-contract@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@gnosis.pm/mock-contract/-/mock-contract-4.0.0.tgz#eaf500fddcab81b5f6c22280a7b22ff891dd6f87" + integrity sha512-SkRq2KwPx6vo0LAjSc8JhgQstrQFXRyn2yqquIfub7r2WHi5nUbF8beeSSXsd36hvBcQxQfmOIYNYRpj9JOhrQ== + +"@gnosis.pm/safe-contracts@1.3.0", "@gnosis.pm/safe-contracts@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-contracts/-/safe-contracts-1.3.0.tgz#316741a7690d8751a1f701538cfc9ec80866eedc" + integrity sha512-1p+1HwGvxGUVzVkFjNzglwHrLNA67U/axP0Ct85FzzH8yhGJb4t9jDjPYocVMzLorDoWAfKicGy1akPY9jXRVw== + +"@gnosis.pm/zodiac@^3.3.7": + version "3.3.7" + resolved "https://registry.yarnpkg.com/@gnosis.pm/zodiac/-/zodiac-3.3.7.tgz#ad12a73ec7208376242596bd140c56ed370e0e66" + integrity sha512-Sgh5i1I2AyS5TxlYoosRHdj4cmJzK+3c5GTfrh0y7x4nKTpqNNuTYLbSEZ8EBcyWDfkDSnHYus6ZZqPSSqC0PQ== + dependencies: + "@gnosis.pm/mock-contract" "^4.0.0" + "@gnosis.pm/safe-contracts" "1.3.0" + "@openzeppelin/contracts" "^4.8.1" + "@openzeppelin/contracts-upgradeable" "^4.8.1" + ethers "^5.7.1" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@noble/hashes@1.1.2", "@noble/hashes@~1.1.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" + integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== + +"@noble/secp256k1@1.6.3", "@noble/secp256k1@~1.6.0": + version "1.6.3" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" + integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@nomicfoundation/edr-darwin-arm64@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.3.8.tgz#09de1f03c0336670fce959f376f0fe9137545836" + integrity sha512-eB0leCexS8sQEmfyD72cdvLj9djkBzQGP4wSQw6SNf2I4Sw4Cnzb3d45caG2FqFFjbvfqL0t+badUUIceqQuMw== + +"@nomicfoundation/edr-darwin-x64@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.3.8.tgz#c3ca237c74ed3b6fb800fd7f1de7174f4ad24f72" + integrity sha512-JksVCS1N5ClwVF14EvO25HCQ+Laljh/KRfHERMVAC9ZwPbTuAd/9BtKvToCBi29uCHWqsXMI4lxCApYQv2nznw== + +"@nomicfoundation/edr-linux-arm64-gnu@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.3.8.tgz#08bd367789e745f4e78a8a87368fc470eea8a7de" + integrity sha512-raCE+fOeNXhVBLUo87cgsHSGvYYRB6arih4eG6B9KGACWK5Veebtm9xtKeiD8YCsdUlUfat6F7ibpeNm91fpsA== + +"@nomicfoundation/edr-linux-arm64-musl@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.3.8.tgz#9cab5cbec0052cb5812c6c66c463d28a756cd916" + integrity sha512-PwiDp4wBZWMCIy29eKkv8moTKRrpiSDlrc+GQMSZLhOAm8T33JKKXPwD/2EbplbhCygJDGXZdtEKl9x9PaH66A== + +"@nomicfoundation/edr-linux-x64-gnu@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.3.8.tgz#d4a11b6ebcd1b29d7431d185c6df3e65a2cd4bde" + integrity sha512-6AcvA/XKoipGap5jJmQ9Y6yT7Uf39D9lu2hBcDCXnXbMcXaDGw4mn1/L4R63D+9VGZyu1PqlcJixCUZlGGIWlg== + +"@nomicfoundation/edr-linux-x64-musl@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.3.8.tgz#b8eef960d06380a365866ddd1e97ecb7fbf6bd70" + integrity sha512-cxb0sEmZjlwhYWO28sPsV64VDx31ekskhC1IsDXU1p9ntjHSJRmW4KEIqJ2O3QwJap/kLKfMS6TckvY10gjc6w== + +"@nomicfoundation/edr-win32-x64-msvc@0.3.8": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.3.8.tgz#ac7061aeb07cc847c429513080b76bb05297a869" + integrity sha512-yVuVPqRRNLZk7TbBMkKw7lzCvI8XO8fNTPTYxymGadjr9rEGRuNTU1yBXjfJ59I1jJU/X2TSkRk1OFX0P5tpZQ== + +"@nomicfoundation/edr@^0.3.5": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.3.8.tgz#28fe7ae4f462ae74a16cd1a714ff7b1cd9c22b4c" + integrity sha512-u2UJ5QpznSHVkZRh6ePWoeVb6kmPrrqh08gCnZ9FHlJV9CITqlrTQHJkacd+INH31jx88pTAJnxePE4XAiH5qg== + dependencies: + "@nomicfoundation/edr-darwin-arm64" "0.3.8" + "@nomicfoundation/edr-darwin-x64" "0.3.8" + "@nomicfoundation/edr-linux-arm64-gnu" "0.3.8" + "@nomicfoundation/edr-linux-arm64-musl" "0.3.8" + "@nomicfoundation/edr-linux-x64-gnu" "0.3.8" + "@nomicfoundation/edr-linux-x64-musl" "0.3.8" + "@nomicfoundation/edr-win32-x64-msvc" "0.3.8" + +"@nomicfoundation/ethereumjs-common@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" + integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.4" + +"@nomicfoundation/ethereumjs-rlp@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" + integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== + +"@nomicfoundation/ethereumjs-tx@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" + integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" + integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/hardhat-chai-matchers@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-1.0.6.tgz#72a2e312e1504ee5dd73fe302932736432ba96bc" + integrity sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@types/chai-as-promised" "^7.1.3" + chai-as-promised "^7.1.1" + deep-eql "^4.0.1" + ordinal "^1.0.3" + +"@nomicfoundation/hardhat-foundry@^1.1.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-foundry/-/hardhat-foundry-1.1.2.tgz#4f5aaa1803b8f5d974dcbc361beb72d49c815562" + integrity sha512-f5Vhj3m2qvKGpr6NAINYwNgILDsai8dVCsFb1rAVLkJxOmD2pAtfCmOH5SBVr9yUI5B1z9rbTwPBJVrqnb+PXQ== + dependencies: + chalk "^2.4.2" + +"@nomicfoundation/hardhat-network-helpers@^1.0.10": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.11.tgz#64096829661b960b88679bd5c4fbcb50654672d1" + integrity sha512-uGPL7QSKvxrHRU69dx8jzoBvuztlLCtyFsbgfXIwIjnO3dqZRz2GNMHJoO3C3dIiUNM6jdNF4AUnoQKDscdYrA== + dependencies: + ethereumjs-util "^7.1.4" + +"@nomicfoundation/hardhat-toolbox@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz#ec95f23b53cb4e71a1a7091380fa223aad18f156" + integrity sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg== + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" + +"@nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers": + version "0.3.0-beta.13" + resolved "https://registry.yarnpkg.com/hardhat-deploy-ethers/-/hardhat-deploy-ethers-0.3.0-beta.13.tgz#b96086ff768ddf69928984d5eb0a8d78cfca9366" + integrity sha512-PdWVcKB9coqWV1L7JTpfXRCI91Cgwsm7KLmBcwZ8f0COSm1xtABHZTyz3fvF6p42cTnz1VM0QnfDvMFlIRkSNw== + +"@nomiclabs/hardhat-etherscan@^3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz#72e3d5bd5d0ceb695e097a7f6f5ff6fcbf062b9a" + integrity sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + fs-extra "^7.0.1" + lodash "^4.17.11" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" + +"@opengsn/contracts@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@opengsn/contracts/-/contracts-2.2.5.tgz#24a61799649548d2b356efcfe0cb6d0c307cb516" + integrity sha512-o0z8b1A7D0cYMQ+gIxM1YKJ2uV25jcrfItu7ABeQBwbaeG0NBEhXHM6Z+rnsqLJvl3RJcKmHfxaFNCk3b3bzOQ== + dependencies: + "@openzeppelin/contracts" "^4.2.0" + +"@openzeppelin/contracts-upgradeable@4.8.3": + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f" + integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg== + +"@openzeppelin/contracts-upgradeable@^4.8.1": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz#ff17a80fb945f5102571f8efecb5ce5915cc4811" + integrity sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A== + +"@openzeppelin/contracts@4.8.3": + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a" + integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg== + +"@openzeppelin/contracts@^4.2.0": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e" + integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== + +"@openzeppelin/contracts@^4.8.1": + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" + integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== + +"@openzeppelin/defender-admin-client@^1.52.0": + version "1.54.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-admin-client/-/defender-admin-client-1.54.1.tgz#b877972992b95a0dc3787f2ade2f044586621357" + integrity sha512-kRpSUdTsnSqntp4FOXIm95t+6VKHc8CUY2Si71VDuxs0q7HSPZkdpRPSntcolwEzWy9L4a8NS/QMwDF5NJ4X1g== + dependencies: + "@openzeppelin/defender-base-client" "1.54.1" + axios "^1.4.0" + ethers "^5.7.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/defender-base-client@1.54.1", "@openzeppelin/defender-base-client@^1.52.0": + version "1.54.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-base-client/-/defender-base-client-1.54.1.tgz#ed777ae56908d5a920e1f72ac735c63694e65b30" + integrity sha512-DRGz/7KN3ZQwu28YWMOaojrC7jjPkz/uCwkC8/C8B11qwZhA5qIVvyhYHhhFOCl0J84+E3TNdvkPD2q3p2WaJw== + dependencies: + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^1.4.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/defender-sdk-base-client@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.8.0.tgz#2209a060ce61b4dfc44c7ac0c2b1d86e18b69f7d" + integrity sha512-XIJat6BW2CTM74AwG5IL0Q/aE6RXj8x7smnVKmBql4wMvmirVW+njfwzZCLhUTiBXg9AlHxIInEF14SabfIisg== + dependencies: + amazon-cognito-identity-js "^6.3.6" + async-retry "^1.3.3" + +"@openzeppelin/defender-sdk-deploy-client@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.8.0.tgz#1e186d2b3ff176c6a4c03e8207bad8022528975f" + integrity sha512-/tNS2EnHuA5l095wzMbIkGMDNHZLcZQ2eLUP8z+AeKaAUeR2z4qzZ1ul21kR3EJURAyoy8aULFZanLggoBWHrA== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.8.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/hardhat-upgrades@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-3.0.2.tgz#3f21415ec802e94443bb1c0fc83992c178be1026" + integrity sha512-Fk940cxwew++bfSZKWHEXVUCr3tRBiRZZBw1nl1wUVq29cq7BrlwDkZ6hTab/+p0IOnx0l6HJHLu3amDxxs3/w== + dependencies: + "@openzeppelin/defender-admin-client" "^1.52.0" + "@openzeppelin/defender-base-client" "^1.52.0" + "@openzeppelin/defender-sdk-base-client" "^1.8.0" + "@openzeppelin/defender-sdk-deploy-client" "^1.8.0" + "@openzeppelin/upgrades-core" "^1.32.0" + chalk "^4.1.0" + debug "^4.1.1" + ethereumjs-util "^7.1.5" + proper-lockfile "^4.1.1" + undici "^5.28.2" + +"@openzeppelin/upgrades-core@^1.32.0": + version "1.32.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.32.2.tgz#4313bd0a547090a350817cf798af60e0eb0728e8" + integrity sha512-EkXriOHZfn6u00Tbq0zUuhHDeTQB9WyAZKZo3UeYdqULb7E3vqxZgxgXmWJwEzAb6E77DvprzQ4gwCAjMV/S4Q== + dependencies: + cbor "^9.0.0" + chalk "^4.1.0" + compare-versions "^6.0.0" + debug "^4.1.1" + ethereumjs-util "^7.0.3" + minimist "^1.2.7" + proper-lockfile "^4.1.1" + solidity-ast "^0.4.51" + +"@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + +"@scure/bip32@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.0.tgz#dea45875e7fbc720c2b4560325f1cf5d2246d95b" + integrity sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q== + dependencies: + "@noble/hashes" "~1.1.1" + "@noble/secp256k1" "~1.6.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.0.tgz#92f11d095bae025f166bef3defcc5bf4945d419a" + integrity sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w== + dependencies: + "@noble/hashes" "~1.1.1" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@smithy/types@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@smithy/types/-/types-2.8.0.tgz#bdbaa0a54c9c3538d6c763c6f32d3e4f76fe0df9" + integrity sha512-h9sz24cFgt/W1Re22OlhQKmUZkNh244ApgRsUDYinqF8R+QgcsBIX344u2j61TPshsTz3CvL6HYU1DnQdsSrHA== + dependencies: + tslib "^2.5.0" + +"@solidity-parser/parser@^0.14.0": + version "0.14.3" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.3.tgz#0d627427b35a40d8521aaa933cc3df7d07bfa36f" + integrity sha512-29g2SZ29HtsqA58pLCtopI1P/cPy5/UAzlcAXO6T/CNJimG6yA8kx4NaseMyJULiC+TEs02Y9/yeHzClqoA0hw== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@solidity-parser/parser@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.18.0.tgz#8e77a02a09ecce957255a2f48c9a7178ec191908" + integrity sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA== + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + +"@typechain/ethers-v5@^10.2.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.0.tgz#68f5963efb5214cb2d881477228e4b5b315473e1" + integrity sha512-ikaq0N/w9fABM+G01OFmU3U3dNnyRwEahkdvi9mqy1a3XwKiPZaF/lu54OcNaEWnpvEYyhhS0N7buCtLQqC92w== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + +"@typechain/hardhat@^6.1.5": + version "6.1.5" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.5.tgz#caad58a1d3e9cd88061a584eb4f4fa763d5dcad1" + integrity sha512-lg7LW4qDZpxFMknp3Xool61Fg6Lays8F8TXdFGBG+MxyYcYU5795P1U2XdStuzGq9S2Dzdgh+1jGww9wvZ6r4Q== + dependencies: + fs-extra "^9.1.0" + +"@types/bn.js@^4.11.3": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + dependencies: + "@types/node" "*" + +"@types/chai-as-promised@^7.1.3": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.5.tgz#6e016811f6c7a64f2eed823191c3a6955094e255" + integrity sha512-jStwss93SITGBwt/niYrkf2C+/1KTeZCZl1LaeezTlqppAKeoQC7jxyqYuP72sxBGKCIbw7oHgbYssIRzT5FCQ== + dependencies: + "@types/chai" "*" + +"@types/chai@*": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.4.tgz#e913e8175db8307d78b4e8fa690408ba6b65dee4" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== + +"@types/chai@^4.2.18": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" + integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== + +"@types/concat-stream@^1.6.0": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@types/concat-stream/-/concat-stream-1.6.1.tgz#24bcfc101ecf68e886aaedce60dfd74b632a1b74" + integrity sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA== + dependencies: + "@types/node" "*" + +"@types/form-data@0.0.33": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-0.0.33.tgz#c9ac85b2a5fd18435b8c85d9ecb50e6d6c893ff8" + integrity sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw== + dependencies: + "@types/node" "*" + +"@types/glob@^7.1.1": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/minimatch@*": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== + +"@types/mocha@^8.2.2": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323" + integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw== + +"@types/node@*": + version "18.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.5.tgz#f1c1d4b7d8231c0278962347163656f9c36f3e83" + integrity sha512-NcKK6Ts+9LqdHJaW6HQmgr7dT/i3GOHG+pt6BiWv++5SnjtRd4NXeiuN2kA153SjhXPR/AhHIPHPbrsbpUVOww== + +"@types/node@^10.0.3": + version "10.17.60" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" + integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== + +"@types/node@^15.12.2": + version "15.14.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa" + integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A== + +"@types/node@^8.0.0": + version "8.10.66" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3" + integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw== + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + +"@types/prettier@^2.1.1": + version "2.6.4" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.4.tgz#ad899dad022bab6b5a9f0a0fe67c2f7a4a8950ed" + integrity sha512-fOwvpvQYStpb/zHMx0Cauwywu9yLDmzWiiQBC7gJyq5tYLUXFZvDG7VK1B7WBxxjBJNKFOZ0zLoOQn8vmATbhw== + +"@types/qs@^6.2.31", "@types/qs@^6.9.7": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/secp256k1@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + integrity sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q== + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.4.1: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.12.3: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.1: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" + integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +amazon-cognito-identity-js@^6.0.1, amazon-cognito-identity-js@^6.3.6: + version "6.3.7" + resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.3.7.tgz#65c3d7ee4e0c0a1ffea01927248989c5bd1d1868" + integrity sha512-tSjnM7KyAeOZ7UMah+oOZ6cW4Gf64FFcc7BE2l7MTcp7ekAPrXaCbpcW2xEpH1EiDS4cPcAouHzmCuc2tr72vQ== + dependencies: + "@aws-crypto/sha256-js" "1.2.2" + buffer "4.9.2" + fast-base64-decode "^1.0.0" + isomorphic-unfetch "^3.0.0" + js-cookie "^2.2.1" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg== + +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-colors@^4.1.0, ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== + +ansi-regex@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +anymatch@~3.1.1, anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array-uniq@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== + +array.prototype.findlast@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlast/-/array.prototype.findlast-1.2.3.tgz#4e4b375de5adf4897fed155e2d2771564865cc3b" + integrity sha512-kcBubumjciBg4JKp5KTKtI7ec7tRefPk88yjkWJwaVKYd9QfTaxcsOxoMNKd7iBr447zCfDV0z1kOF47umv42g== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.2.1" + +array.prototype.reduce@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.4.tgz#8167e80089f78bff70a99e20bd4201d4663b0a6f" + integrity sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-array-method-boxes-properly "^1.0.0" + is-string "^1.0.7" + +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + +asap@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== + +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + +async@1.x: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +axios@^1.4.0: + version "1.6.5" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8" + integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg== + dependencies: + follow-redirects "^1.15.4" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.0.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== + +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +boxen@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +buffer@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +call-bind@^1.0.4, call-bind@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" + integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== + dependencies: + function-bind "^1.1.2" + get-intrinsic "^1.2.1" + set-function-length "^1.1.1" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0, camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caseless@^0.12.0, caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + +cbor@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" + integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== + dependencies: + nofilter "^3.1.0" + +cbor@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-9.0.1.tgz#b16e393d4948d44758cd54ac6151379d443b37ae" + integrity sha512-/TQOWyamDxvVIv+DY9cOLNuABkoyz8K/F3QE56539pGVYohx0+MEA1f4lChFTX79dBTBS7R1PF6ovH7G+VtBfQ== + dependencies: + nofilter "^3.1.0" + +chai-as-promised@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" + integrity sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA== + dependencies: + check-error "^1.0.2" + +chai@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^4.1.2" + get-func-name "^2.0.0" + loupe "^2.3.1" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +"charenc@>= 0.0.1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + +chokidar@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" + integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.2.0" + optionalDependencies: + fsevents "~2.1.1" + +chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.2: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + +cli-table3@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== + dependencies: + object-assign "^4.1.0" + string-width "^2.1.1" + optionalDependencies: + colors "^1.1.2" + +cli-table3@^0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.2.tgz#aaf5df9d8b5bf12634dc8b3040806a0c07120d2a" + integrity sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colors@1.4.0, colors@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +compare-versions@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a" + integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concat-stream@^1.6.0, concat-stream@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +"crypt@>= 0.0.1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + +death@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" + integrity sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w== + +debug@3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +deep-eql@^4.0.1, deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + +deep-extend@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +define-data-property@^1.0.1, define-data-property@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +delete-empty@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/delete-empty/-/delete-empty-3.0.0.tgz#f8040f2669f26fa7060bc2304e9859c593b685e8" + integrity sha512-ZUyiwo76W+DYnKsL3Kim6M/UOavPdBJgDYWOmuQhYaZvJH0AXAHbUNyEDtRbBra8wqqr686+63/0azfEk1ebUQ== + dependencies: + ansi-colors "^4.1.0" + minimist "^1.2.0" + path-starts-with "^2.0.0" + rimraf "^2.6.2" + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +difflib@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/difflib/-/difflib-0.2.4.tgz#b5e30361a6db023176d562892db85940a718f47e" + integrity sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w== + dependencies: + heap ">= 0.2.0" + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +dotenv@^16.0.3: + version "16.0.3" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" + integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encode-utf8@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" + integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== + +enquirer@^2.3.0, enquirer@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +es-abstract@^1.19.0, es-abstract@^1.19.2, es-abstract@^1.19.5, es-abstract@^1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" + integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-weakref "^1.0.2" + object-inspect "^1.12.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + regexp.prototype.flags "^1.4.3" + string.prototype.trimend "^1.0.5" + string.prototype.trimstart "^1.0.5" + unbox-primitive "^1.0.2" + +es-abstract@^1.22.1: + version "1.22.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" + integrity sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.5" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.2" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.12" + is-weakref "^1.0.2" + object-inspect "^1.13.1" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.13" + +es-array-method-boxes-properly@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + +es-set-tostringtag@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz#11f7cc9f63376930a5f20be4915834f4bc74f9c9" + integrity sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q== + dependencies: + get-intrinsic "^1.2.2" + has-tostringtag "^1.0.0" + hasown "^2.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" + integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== + dependencies: + hasown "^2.0.0" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escodegen@1.8.x: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + integrity sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A== + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +esprima@2.7.x, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + integrity sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A== + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + integrity sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +eth-gas-reporter@^0.2.25: + version "0.2.25" + resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz#546dfa946c1acee93cb1a94c2a1162292d6ff566" + integrity sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ== + dependencies: + "@ethersproject/abi" "^5.0.0-beta.146" + "@solidity-parser/parser" "^0.14.0" + cli-table3 "^0.5.0" + colors "1.4.0" + ethereum-cryptography "^1.0.3" + ethers "^4.0.40" + fs-readdir-recursive "^1.1.0" + lodash "^4.17.14" + markdown-table "^1.1.3" + mocha "^7.1.1" + req-cwd "^2.0.0" + request "^2.88.0" + request-promise-native "^1.0.5" + sha1 "^1.1.1" + sync-request "^6.0.0" + +ethereum-bloom-filters@^1.0.6: + version "1.0.10" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz#3ca07f4aed698e75bd134584850260246a5fed8a" + integrity sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA== + dependencies: + js-sha3 "^0.8.0" + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.1.2.tgz#74f2ac0f0f5fe79f012c889b3b8446a9a6264e6d" + integrity sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ== + dependencies: + "@noble/hashes" "1.1.2" + "@noble/secp256k1" "1.6.3" + "@scure/bip32" "1.1.0" + "@scure/bip39" "1.1.0" + +ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + +ethers@^4.0.40: + version "4.0.49" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" + integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== + dependencies: + aes-js "3.0.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.4" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + +ethers@^5.7.0, ethers@^5.7.1, ethers@^5.7.2, ethers@~5.7.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + +fast-base64-decode@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" + integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.0.3: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +flat@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== + dependencies: + is-buffer "~2.0.3" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +fmix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" + integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w== + dependencies: + imul "^1.0.0" + +follow-redirects@^1.12.1: + version "1.15.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + +follow-redirects@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +follow-redirects@^1.15.4: + version "1.15.4" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" + integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== + +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + +form-data@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" + integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@^7.0.0, fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-readdir-recursive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + +functions-have-names@^1.2.2, functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" + integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" + integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== + dependencies: + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + +get-port@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" + integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + +ghost-testrpc@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz#c4de9557b1d1ae7b2d20bbe474a91378ca90ce92" + integrity sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ== + dependencies: + chalk "^2.4.2" + node-emoji "^1.10.0" + +glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA== + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.0, glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + +globby@^10.0.1: + version "10.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" + integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +handlebars@^4.0.1: + version "4.7.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +hardhat-abi-exporter@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/hardhat-abi-exporter/-/hardhat-abi-exporter-2.10.0.tgz#4498982bb8942178a3b6d9368b0def8d18b49cc8" + integrity sha512-ynYGUptkal3leyUNGP3aJ6GRYtSHed3lHcfMv6imawqEd7MERueEkeFy+X4kWH3Vf5w4k6xeeCJHJsegGBJUPA== + dependencies: + "@ethersproject/abi" "^5.5.0" + delete-empty "^3.0.0" + +hardhat-contract-sizer@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/hardhat-contract-sizer/-/hardhat-contract-sizer-2.10.0.tgz#72646f43bfe50e9a5702c9720c9bc3e77d93a2c9" + integrity sha512-QiinUgBD5MqJZJh1hl1jc9dNnpJg7eE/w4/4GEnrcmZJJTDbVFNe3+/3Ep24XqISSkYxRz36czcPHKHd/a0dwA== + dependencies: + chalk "^4.0.0" + cli-table3 "^0.6.0" + strip-ansi "^6.0.0" + +hardhat-deploy@^0.12.1: + version "0.12.4" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.12.4.tgz#5ebef37f1004f52a74987213b0465ad7c9433fb2" + integrity sha512-bYO8DIyeGxZWlhnMoCBon9HNZb6ji0jQn7ngP1t5UmGhC8rQYhji7B73qETMOFhzt5ECZPr+U52duj3nubsqdQ== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/providers" "^5.7.2" + "@ethersproject/solidity" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wallet" "^5.7.0" + "@types/qs" "^6.9.7" + axios "^0.21.1" + chalk "^4.1.2" + chokidar "^3.5.2" + debug "^4.3.2" + enquirer "^2.3.6" + ethers "^5.7.0" + form-data "^4.0.0" + fs-extra "^10.0.0" + match-all "^1.2.6" + murmur-128 "^0.2.1" + qs "^6.9.4" + zksync-ethers "^5.0.0" + +hardhat-gas-reporter@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz#9a2afb354bc3b6346aab55b1c02ca556d0e16450" + integrity sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg== + dependencies: + array-uniq "1.0.3" + eth-gas-reporter "^0.2.25" + sha1 "^1.1.1" + +hardhat@2.22.3: + version "2.22.3" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.3.tgz#50605daca6b29862397e446c42ec14c89430bec3" + integrity sha512-k8JV2ECWNchD6ahkg2BR5wKVxY0OiKot7fuxiIpRK0frRqyOljcR2vKwgWSLw6YIeDcNNA4xybj7Og7NSxr2hA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/edr" "^0.3.5" + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-tx" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + boxen "^5.1.2" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + dependencies: + function-bind "^1.1.2" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +"heap@>= 0.2.0": + version "0.2.7" + resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.7.tgz#1e6adf711d3f27ce35a81fe3b7bd576c2260a8fc" + integrity sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-basic@^8.1.1: + version "8.1.3" + resolved "https://registry.yarnpkg.com/http-basic/-/http-basic-8.1.3.tgz#a7cabee7526869b9b710136970805b1004261bbf" + integrity sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw== + dependencies: + caseless "^0.12.0" + concat-stream "^1.6.2" + http-response-object "^3.0.1" + parse-cache-control "^1.0.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +http-response-object@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/http-response-object/-/http-response-object-3.0.2.tgz#7f435bb210454e4360d074ef1f989d5ea8aa9810" + integrity sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA== + dependencies: + "@types/node" "^10.0.3" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.4: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +ignore@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +immutable@^4.0.0-rc.12: + version "4.1.0" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef" + integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ== + +imul@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" + integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.5: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +internal-slot@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.6.tgz#37e756098c4911c5e912b8edbf71ed3aa116f930" + integrity sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg== + dependencies: + get-intrinsic "^1.2.2" + hasown "^2.0.0" + side-channel "^1.0.4" + +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-buffer@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-callable@^1.1.3, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" + integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isomorphic-unfetch@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" + integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== + dependencies: + node-fetch "^2.6.1" + unfetch "^4.2.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + +js-sha3@0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-yaml@3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@3.x: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonschema@^1.2.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" + integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== + +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + +keccak@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" + integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +keccak@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== + optionalDependencies: + graceful-fs "^4.1.9" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== + dependencies: + chalk "^2.4.2" + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +loupe@^2.3.1: + version "2.3.4" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3" + integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== + dependencies: + get-func-name "^2.0.0" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +markdown-table@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" + integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== + +match-all@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" + integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +merge2@^1.2.3, merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +"minimatch@2 || 3", minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + +minimist@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp@0.5.5: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mkdirp@0.5.x: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" + integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +mocha@^10.2.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.4.0.tgz#ed03db96ee9cfc6d20c56f8e2af07b961dbae261" + integrity sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "8.1.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +mocha@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" + integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "3.0.0" + minimatch "3.0.4" + mkdirp "0.5.5" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +murmur-128@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" + integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== + dependencies: + encode-utf8 "^1.0.2" + fmix "^0.1.0" + imul "^1.0.0" + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +neo-async@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-emoji@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" + integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A== + dependencies: + lodash "^4.17.21" + +node-environment-flags@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" + integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-fetch@^2.6.0, node-fetch@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.2.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.5.0.tgz#7a64eefa0b21112f89f58379da128ac177f20e40" + integrity sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg== + +nofilter@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" + integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== + +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg== + dependencies: + abbrev "1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +object-inspect@^1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + +object-keys@^1.0.11, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.assign@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.getownpropertydescriptors@^2.0.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz#7965e6437a57278b587383831a9b829455a4bc37" + integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== + dependencies: + array.prototype.reduce "^1.0.4" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.1" + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +once@1.x, once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +ordinal@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ordinal/-/ordinal-1.0.3.tgz#1a3c7726a61728112f50944ad7c35c06ae3a0d4d" + integrity sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ== + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-cache-control@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-cache-control/-/parse-cache-control-1.0.1.tgz#8eeab3e54fa56920fe16ba38f77fa21aacc2d74e" + integrity sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg== + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-parse@^1.0.6, path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-starts-with@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-starts-with/-/path-starts-with-2.0.0.tgz#ffd6d51926cd497022b44d392196033d5451892f" + integrity sha512-3UHTHbJz5+NLkPafFR+2ycJOjoc4WV2e9qCZCnm71zHiWaFrm1XniLVTkZXvaRgxr1xFh9JsTdicpH2yM03nLA== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +prettier@^2.3.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +promise@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/promise/-/promise-8.1.0.tgz#697c25c3dfe7435dd79fcd58c38a135888eaf05e" + integrity sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q== + dependencies: + asap "~2.0.6" + +proper-lockfile@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" + integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== + dependencies: + graceful-fs "^4.2.4" + retry "^0.12.0" + signal-exit "^3.0.2" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +psl@^1.1.28: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@^6.4.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +qs@^6.9.4: + version "6.11.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f" + integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ== + dependencies: + side-channel "^1.0.4" + +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +raw-body@^2.4.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +readable-stream@^2.2.2: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" + integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== + dependencies: + picomatch "^2.0.4" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== + dependencies: + resolve "^1.1.6" + +recursive-readdir@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" + integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== + dependencies: + minimatch "3.0.4" + +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + +regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + +req-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-2.0.0.tgz#d4082b4d44598036640fb73ddea01ed53db49ebc" + integrity sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ== + dependencies: + req-from "^2.0.0" + +req-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/req-from/-/req-from-2.0.0.tgz#d74188e47f93796f4aa71df6ee35ae689f3e0e70" + integrity sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA== + dependencies: + resolve-from "^3.0.0" + +request-promise-core@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" + integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== + dependencies: + lodash "^4.17.19" + +request-promise-native@^1.0.5: + version "1.0.9" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" + integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== + dependencies: + request-promise-core "1.1.4" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.0, require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== + +resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.1.6: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^2.2.8, rimraf@^2.6.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.3, rlp@^2.2.4: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-array-concat@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + isarray "^2.0.5" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-deployments@^1.26.0: + version "1.26.0" + resolved "https://registry.yarnpkg.com/safe-deployments/-/safe-deployments-1.26.0.tgz#ac93849dfe187d5abe4f448a113ffac5ca2bd4b6" + integrity sha512-JuUfoN86/JPmmGAxxVj73Q0G7Pkon3tZMu7IgWWd4SSPk4bvoSJCaQBOHFKRu10x2+KQUtK+xz0JIua6QB6niA== + dependencies: + semver "^7.3.7" + +safe-regex-test@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.1.tgz#207369b445fd007e534864635b28b2ae7b105783" + integrity sha512-Y5NejJTTliTyY4H7sipGqY+RX5P87i3F7c4Rcepy72nq+mNLhIsD0W4c7kEmduMDQCSqtPsXPlSTsFhh2LQv+g== + dependencies: + call-bind "^1.0.5" + get-intrinsic "^1.2.2" + is-regex "^1.1.4" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sc-istanbul@^0.4.5: + version "0.4.6" + resolved "https://registry.yarnpkg.com/sc-istanbul/-/sc-istanbul-0.4.6.tgz#cf6784355ff2076f92d70d59047d71c13703e839" + integrity sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g== + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + +scrypt-js@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" + integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== + +scrypt-js@3.0.1, scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +semver@^5.5.0, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.4: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +semver@^7.3.7: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + +set-function-length@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" + integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== + dependencies: + define-data-property "^1.1.1" + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + +setimmediate@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" + integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +sha1@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848" + integrity sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA== + dependencies: + charenc ">= 0.0.1" + crypt ">= 0.0.1" + +shelljs@^0.8.3, shelljs@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +shx@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02" + integrity sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g== + dependencies: + minimist "^1.2.3" + shelljs "^0.8.5" + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solidity-ast@^0.4.51: + version "0.4.55" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.55.tgz#00b685e6eefb2e8dfb67df1fe0afbe3b3bfb4b28" + integrity sha512-qeEU/r/K+V5lrAw8iswf2/yfWAnSGs3WKPHI+zAFKFjX0dIBVXEU/swQ8eJQYHf6PJWUZFO2uWV4V1wEOkeQbA== + dependencies: + array.prototype.findlast "^1.2.2" + +solidity-coverage@^0.8.6: + version "0.8.12" + resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.8.12.tgz#c4fa2f64eff8ada7a1387b235d6b5b0e6c6985ed" + integrity sha512-8cOB1PtjnjFRqOgwFiD8DaUsYJtVJ6+YdXQtSZDrLGf8cdhhh8xzTtGzVTGeBf15kTv0v7lYPJlV/az7zLEPJw== + dependencies: + "@ethersproject/abi" "^5.0.9" + "@solidity-parser/parser" "^0.18.0" + chalk "^2.4.2" + death "^1.1.0" + difflib "^0.2.4" + fs-extra "^8.1.0" + ghost-testrpc "^0.0.2" + global-modules "^2.0.0" + globby "^10.0.1" + jsonschema "^1.2.4" + lodash "^4.17.21" + mocha "^10.2.0" + node-emoji "^1.10.0" + pify "^4.0.1" + recursive-readdir "^2.2.2" + sc-istanbul "^0.4.5" + semver "^7.3.4" + shelljs "^0.8.3" + web3-utils "^1.3.6" + +source-map-support@^0.5.13: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + integrity sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA== + dependencies: + amdefine ">=0.0.4" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +sshpk@^1.7.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== + +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + +"string-width@^1.0.2 || 2", string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +string.prototype.trimend@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" + integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +string.prototype.trimstart@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" + integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== + dependencies: + has-flag "^3.0.0" + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^3.1.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A== + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +sync-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/sync-request/-/sync-request-6.1.0.tgz#e96217565b5e50bbffe179868ba75532fb597e68" + integrity sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw== + dependencies: + http-response-object "^3.0.1" + sync-rpc "^1.2.1" + then-request "^6.0.0" + +sync-rpc@^1.2.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/sync-rpc/-/sync-rpc-1.3.6.tgz#b2e8b2550a12ccbc71df8644810529deb68665a7" + integrity sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw== + dependencies: + get-port "^3.1.0" + +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + +table@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" + integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + +then-request@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/then-request/-/then-request-6.0.2.tgz#ec18dd8b5ca43aaee5cb92f7e4c1630e950d4f0c" + integrity sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA== + dependencies: + "@types/concat-stream" "^1.6.0" + "@types/form-data" "0.0.33" + "@types/node" "^8.0.0" + "@types/qs" "^6.2.31" + caseless "~0.12.0" + concat-stream "^1.6.0" + form-data "^2.2.0" + http-basic "^8.1.1" + http-response-object "^3.0.1" + promise "^8.0.0" + qs "^6.4.0" + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +ts-command-line-args@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.3.1.tgz#b6188e42efc6cf7a8898e438a873fbb15505ddd6" + integrity sha512-FR3y7pLl/fuUNSmnPhfLArGqRrpojQgIEEOVzYx9DhTmfIN7C9RWSfpkJEF4J+Gk7aVx5pak8I7vWZsaN4N84g== + dependencies: + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" + +ts-essentials@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" + integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== + +ts-node@^10.0.0: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tslib@^1.11.1, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.3.1, tslib@^2.5.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +typechain@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.1.tgz#9c2e8012c2c4c586536fc18402dcd7034c4ff0bd" + integrity sha512-uF/sUvnXTOVF2FHKhQYnxHk4su4JjZR8vr4mA2mBaRwHTbwh0jIlqARz9XJr1tA0l7afJGvEa1dTSi4zt039LQ== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.3.1" + fs-extra "^7.0.0" + glob "7.1.7" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + +typescript@^4.3.2: + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== + +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + +uglify-js@^3.1.4: + version "3.16.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.3.tgz#94c7a63337ee31227a18d03b8a3041c210fd1f1d" + integrity sha512-uVbFqx9vvLhQg0iBaau9Z75AxWJ8tqM9AV890dIZCLApF4rTcyHwmAvLeEdYRs+BzYWu8Iw81F79ah0EfTXbaw== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +undici@^5.14.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.21.0.tgz#b00dfc381f202565ab7f52023222ab862bb2494f" + integrity sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA== + dependencies: + busboy "^1.6.0" + +undici@^5.28.2: + version "5.28.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91" + integrity sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w== + dependencies: + "@fastify/busboy" "^2.0.0" + +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +utf8@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" + integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +web3-utils@^1.3.6: + version "1.9.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.9.0.tgz#7c5775a47586cefb4ad488831be8f6627be9283d" + integrity sha512-p++69rCNNfu2jM9n5+VD/g26l+qkEOQ1m6cfRQCbH8ZRrtquTmrirJMgTmyOoax5a5XRYOuws14aypCOs51pdQ== + dependencies: + bn.js "^5.2.1" + ethereum-bloom-filters "^1.0.6" + ethereumjs-util "^7.1.0" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + +which-typed-array@^1.1.11, which-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.13.tgz#870cd5be06ddb616f504e7b039c4c24898184d36" + integrity sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.4" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + +which@1.3.1, which@^1.1.1, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== + +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xmlhttprequest@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" + integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== + +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" + integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== + dependencies: + flat "^4.1.0" + lodash "^4.17.15" + yargs "^13.3.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.2, yargs@^13.3.0: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zksync-ethers@^5.0.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-5.8.0.tgz#ff054345048f851c33cb6efcf2094f40d4da6063" + integrity sha512-/4qI5UElh0lspu0ew2IXBCO+O9kXEzZOM7JqvlfRWWGIUKZ+EDXnjIPgkH0y5/MnMT3FDq9koAAUCyZVWqHUJg== + dependencies: + ethers "~5.7.0" diff --git a/lib/v3-core/.gitattributes b/lib/v3-core/.gitattributes new file mode 100644 index 0000000..7cc88f0 --- /dev/null +++ b/lib/v3-core/.gitattributes @@ -0,0 +1 @@ +*.sol linguist-language=Solidity \ No newline at end of file diff --git a/lib/v3-core/.github/stale.yml b/lib/v3-core/.github/stale.yml new file mode 100644 index 0000000..c94c52d --- /dev/null +++ b/lib/v3-core/.github/stale.yml @@ -0,0 +1,25 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +issues: + # Number of days of inactivity before an Issue or Pull Request becomes stale + daysUntilStale: 7 + + # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. + # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. + daysUntilClose: 7 + + # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) + onlyLabels: + - question + - autoclose + + # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable + exemptLabels: + - p0 + - bug + + # Comment to post when marking as stale. Set to `false` to disable + markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. diff --git a/lib/v3-core/.github/workflows/fuzz-testing.yml b/lib/v3-core/.github/workflows/fuzz-testing.yml new file mode 100644 index 0000000..bf3892e --- /dev/null +++ b/lib/v3-core/.github/workflows/fuzz-testing.yml @@ -0,0 +1,60 @@ +name: Fuzz Testing + +on: + push: + branches: + - main + pull_request: + +jobs: + echidna: + name: Echidna + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + testName: + - TickBitmapEchidnaTest + - TickMathEchidnaTest + - SqrtPriceMathEchidnaTest + - SwapMathEchidnaTest + - TickEchidnaTest + - TickOverflowSafetyEchidnaTest + - OracleEchidnaTest + - BitMathEchidnaTest + - LowGasSafeMathEchidnaTest + - UnsafeMathEchidnaTest + - FullMathEchidnaTest + + steps: + - uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install node dependencies + run: yarn install --frozen-lockfile + + - name: Install pip3 + run: | + python -m pip install --upgrade pip + + - name: Install slither + run: | + pip3 install slither-analyzer + + - name: Install echidna + run: | + sudo wget -O /tmp/echidna-test.tar.gz https://github.com/crytic/echidna/releases/download/v1.6.0/echidna-test-v1.6.0-Ubuntu-18.04.tar.gz + sudo tar -xf /tmp/echidna-test.tar.gz -C /usr/bin + sudo chmod +x /usr/bin/echidna-test + + - name: Run ${{ matrix.testName }} + run: echidna-test . --contract ${{ matrix.testName }} --config echidna.config.yml diff --git a/lib/v3-core/.github/workflows/lint.yml b/lib/v3-core/.github/workflows/lint.yml new file mode 100644 index 0000000..942d420 --- /dev/null +++ b/lib/v3-core/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run linters + uses: wearerequired/lint-action@a8497ddb33fb1205941fd40452ca9fff07e0770d + with: + github_token: ${{ secrets.github_token }} + prettier: true + auto_fix: true + prettier_extensions: 'css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml,sol' diff --git a/lib/v3-core/.github/workflows/mythx.yml b/lib/v3-core/.github/workflows/mythx.yml new file mode 100644 index 0000000..ffe713f --- /dev/null +++ b/lib/v3-core/.github/workflows/mythx.yml @@ -0,0 +1,65 @@ +name: Mythx + +on: + workflow_dispatch: + +jobs: + mythx: + name: Submit to Mythx + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install node dependencies + run: yarn install --frozen-lockfile + + - name: Install pip3 + run: | + python -m pip install --upgrade pip + + - name: Install mythx CLI + run: | + pip3 install mythx-cli + + - name: Install solc-select + run: | + pip3 install solc-select + + - name: Install solc 0.7.6 + run: | + solc-select install 0.7.6 + solc-select use 0.7.6 + + - name: Submit code to Mythx + run: | + mythx --api-key ${{ secrets.MYTHX_API_KEY }} \ + --yes \ + analyze \ + --mode deep \ + --async \ + --create-group \ + --group-name "@uniswap/v3-core@${{ github.sha }}" \ + --solc-version 0.7.6 \ + --check-properties \ + contracts/test/TickBitmapEchidnaTest.sol --include TickBitmapEchidnaTest \ + contracts/test/TickMathEchidnaTest.sol --include TickMathEchidnaTest \ + contracts/test/SqrtPriceMathEchidnaTest.sol --include SqrtPriceMathEchidnaTest \ + contracts/test/SwapMathEchidnaTest.sol --include SwapMathEchidnaTest \ + contracts/test/TickEchidnaTest.sol --include TickEchidnaTest \ + contracts/test/TickOverflowSafetyEchidnaTest.sol --include TickOverflowSafetyEchidnaTest \ + contracts/test/OracleEchidnaTest.sol --include OracleEchidnaTest \ + contracts/test/BitMathEchidnaTest.sol --include BitMathEchidnaTest \ + contracts/test/LowGasSafeMathEchidnaTest.sol --include LowGasSafeMathEchidnaTest \ + contracts/test/UnsafeMathEchidnaTest.sol --include UnsafeMathEchidnaTest \ + contracts/test/FullMathEchidnaTest.sol --include FullMathEchidnaTest diff --git a/lib/v3-core/.github/workflows/tests.yml b/lib/v3-core/.github/workflows/tests.yml new file mode 100644 index 0000000..89567f9 --- /dev/null +++ b/lib/v3-core/.github/workflows/tests.yml @@ -0,0 +1,38 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + +jobs: + unit-tests: + name: Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + + - id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn- + + - name: Install dependencies + run: yarn install --frozen-lockfile + + # This is required separately from yarn test because it generates the typechain definitions + - name: Compile + run: yarn compile + + - name: Run unit tests + run: yarn test diff --git a/lib/v3-core/.gitignore b/lib/v3-core/.gitignore new file mode 100644 index 0000000..86e6f21 --- /dev/null +++ b/lib/v3-core/.gitignore @@ -0,0 +1,5 @@ +artifacts/ +cache/ +crytic-export/ +node_modules/ +typechain/ diff --git a/lib/v3-core/.prettierrc b/lib/v3-core/.prettierrc new file mode 100644 index 0000000..31ba22d --- /dev/null +++ b/lib/v3-core/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} diff --git a/lib/v3-core/.solhint.json b/lib/v3-core/.solhint.json new file mode 100644 index 0000000..11b3647 --- /dev/null +++ b/lib/v3-core/.solhint.json @@ -0,0 +1,6 @@ +{ + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/lib/v3-core/.yarnrc b/lib/v3-core/.yarnrc new file mode 100644 index 0000000..5455c6c --- /dev/null +++ b/lib/v3-core/.yarnrc @@ -0,0 +1 @@ +ignore-scripts true diff --git a/lib/v3-core/LICENSE b/lib/v3-core/LICENSE new file mode 100644 index 0000000..075a13a --- /dev/null +++ b/lib/v3-core/LICENSE @@ -0,0 +1,100 @@ +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: Uniswap Labs + +Licensed Work: Uniswap V3 Core + The Licensed Work is (c) 2021 Uniswap Labs + +Additional Use Grant: Any uses listed and defined at + v3-core-license-grants.uniswap.eth + +Change Date: The earlier of 2023-04-01 or a date specified at + v3-core-license-date.uniswap.eth + +Change License: GNU General Public License v2.0 or later + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark "Business Source License", +as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business +Source License" name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where "compatible" means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. + +----------------------------------------------------------------------------- + +Notice + +The Business Source License (this document, or the "License") is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. diff --git a/lib/v3-core/README.md b/lib/v3-core/README.md new file mode 100644 index 0000000..e4d12e4 --- /dev/null +++ b/lib/v3-core/README.md @@ -0,0 +1,66 @@ +# Uniswap V3 + +[![Lint](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/lint.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/lint.yml) +[![Tests](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/tests.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/tests.yml) +[![Fuzz Testing](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/fuzz-testing.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/fuzz-testing.yml) +[![Mythx](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/mythx.yml/badge.svg)](https://github.com/Uniswap/uniswap-v3-core/actions/workflows/mythx.yml) +[![npm version](https://img.shields.io/npm/v/@uniswap/v3-core/latest.svg)](https://www.npmjs.com/package/@uniswap/v3-core/v/latest) + +This repository contains the core smart contracts for the Uniswap V3 Protocol. +For higher level contracts, see the [uniswap-v3-periphery](https://github.com/Uniswap/uniswap-v3-periphery) +repository. + +## Bug bounty + +This repository is subject to the Uniswap V3 bug bounty program, per the terms defined [here](./bug-bounty.md). + +## Local deployment + +In order to deploy this code to a local testnet, you should install the npm package +`@uniswap/v3-core` +and import the factory bytecode located at +`@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json`. +For example: + +```typescript +import { + abi as FACTORY_ABI, + bytecode as FACTORY_BYTECODE, +} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json' + +// deploy the bytecode +``` + +This will ensure that you are testing against the same bytecode that is deployed to +mainnet and public testnets, and all Uniswap code will correctly interoperate with +your local deployment. + +## Using solidity interfaces + +The Uniswap v3 interfaces are available for import into solidity smart contracts +via the npm artifact `@uniswap/v3-core`, e.g.: + +```solidity +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +contract MyContract { + IUniswapV3Pool pool; + + function doSomethingWithPool() { + // pool.swap(...); + } +} + +``` + +## Licensing + +The primary license for Uniswap V3 Core is the Business Source License 1.1 (`BUSL-1.1`), see [`LICENSE`](./LICENSE). However, some files are dual licensed under `GPL-2.0-or-later`: + +- All files in `contracts/interfaces/` may also be licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers), see [`contracts/interfaces/LICENSE`](./contracts/interfaces/LICENSE) +- Several files in `contracts/libraries/` may also be licensed under `GPL-2.0-or-later` (as indicated in their SPDX headers), see [`contracts/libraries/LICENSE`](contracts/libraries/LICENSE) + +### Other Exceptions + +- `contracts/libraries/FullMath.sol` is licensed under `MIT` (as indicated in its SPDX header), see [`contracts/libraries/LICENSE_MIT`](contracts/libraries/LICENSE_MIT) +- All files in `contracts/test` remain unlicensed (as indicated in their SPDX headers). diff --git a/lib/v3-core/audits/abdk/audit.pdf b/lib/v3-core/audits/abdk/audit.pdf new file mode 100644 index 0000000..d851413 Binary files /dev/null and b/lib/v3-core/audits/abdk/audit.pdf differ diff --git a/lib/v3-core/audits/tob/README.md b/lib/v3-core/audits/tob/README.md new file mode 100644 index 0000000..5e4b55e --- /dev/null +++ b/lib/v3-core/audits/tob/README.md @@ -0,0 +1,166 @@ +The following contains the properties written by Trail of Bits. + +- [End to End testing with Echidna](#end-to-end-testing-with-echidna) +- [Verification with Manticore](#verification-with-manticore) + +# End to End testing with Echidna + +We've implemented end-to-end properties for the Uniswap V3 Core pool contract. + +## Installation + +In order to run this, you need to install [echidna 1.7.0](https://github.com/crytic/echidna/releases/tag/v1.7.0). + +## Run + +Assuming you're in the root of the repo + +``` +echidna-test contracts/crytic/echidna/E2E_swap.sol --config contracts/crytic/echidna/E2E_swap.config.yaml --contract E2E_swap + +echidna-test contracts/crytic/echidna/E2E_mint_burn.sol --config contracts/crytic/echidna/E2E_mint_burn.config.yaml --contract E2E_mint_burn + +echidna-test contracts/crytic/echidna/Other.sol --config contracts/crytic/echidna/Other.config.yaml --contract Other +``` + +## Random but valid pool initialisation, created positions, and priceLimits + +To help Echidna to get good coverage we've used multiple helper functions to: + +- create random but valid pool initialization params (fee, tickSpacing, initial price) before doing swaps or mint/burn [link](./E2E_mint_burn.sol#L303-L337) [link](./E2E_swap.sol#L196-L230) +- create a random number of random but valid positions before testing swaps [link](./E2E_swap.sol#L233-L283) +- create a random but valid priceLimit when doing swap [link](./E2E_swap.sol#L68-L80) +- create random but valid position params when doing mint [link](./E2E_mint_burn.sol#L102-L130) + +By doing the above Echidna will be able to test the actual properties we want to test instead of bashing it's head against using an invalid priceLimit or invalid position params. The above also allows the creation of a dynamic number of random positions before executing swaps instead of using a static list. + +To achieve the above random but valid outcomes we use the `uint128 _amount` of swap/mint/burn as a seed to create randomness in the helper functions. This also means that retrieving the exact used params is not very straightforward. However, through a combination of hardhat `console.sol` and writing a small js unit test it's possible to retrieve the exact used params of every (list of) call(s). + +## Adjust hardhat.config.ts + +The Echidna contracts cost too much gas to deploy due to all the calls inside the constructor. + +Adjust the `hardhat.config.ts` to: + +```json +hardhat: { + allowUnlimitedContractSize: true, + gas: 950000000, + blockGasLimit: 950000000, + gasPrice: 1, +}, +``` + +### E2E_swap: retrieving the pool initialisation params and created positions + +The pool initialisation and created positions is deterministic and there is a `view` function that will return whatever a specific `_amount` (used as `_seed`) will create. + +Write a js unit test: + +```js +console.log(await E2E_swap.viewRandomInit('')) +``` + +### E2E_swap: retrieving the used priceLimit of a swap + +The priceLimit depends on the state of the pool contract, it is therefore easiest to retrieve by using hardhat's `console.sol`. + +Uncomment the following lines: + +- at the top of `E2E_swap.sol`: `// import 'hardhat/console.sol';` +- inside the swap functions: `// console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); ` + +Instead of just one swap call, imagine Echidna reports two swap calls, and the second one causes an assertion failure. + +```js +// to get pool params + created positions +console.log(await E2E_swap.viewRandomInit('')) + +// execute the swap, which will create the above and log the used priceLimit to the console +await E2E_swap.test_swap_exactOut_oneForZero('') + +// execute the swap, logs the used priceLimit to the console +await E2E_swap.test_swap_exactIn_oneForZero('') +``` + +### E2E_mint_burn: retrieving the pool initialisation params + +The pool initialisation params creation is deterministic and there is a `view` function that will return whatever a specific `_amount` (used as `_seed`) will create. + +Write a js unit test: + +```js +console.log(await E2E_mint_burn.viewInitRandomPoolParams('')) +``` + +### E2E_mint_burn: retrieving a mint's created random position + +```js +const poolInitParams = await E2E_mint_burn.viewInitRandomPoolParams('') + +const positionParams = await E2E_mint_burn.viewMintRandomNewPosition( + '', + poolInitParams.tickSpacing, + poolInitParams.tickCount, + poolInitParams.maxTick +) + +console.log(positionParams) +``` + +### E2E_mint_burn: retrieving a burn's used position + +Uncomment the following lines: + +- at the top of `E2E_mint_burn.sol`: `// import 'hardhat/console.sol';` +- inside the particular burn function: `// console.log('burn posIdx = %s', posIdx);` +- if this is a partial burn, also want to see the burned amount. inside the `test_burn_partial` function: `// console.log('burn amount = %s', burnAmount);` + +Then execute the burn in a js test. + +```js +// show pool init params +const poolInitParams = await E2E_mint_burn.viewInitRandomPoolParams('') +console.log(positionParams) + +// show pool mint position params +const positionParams = await E2E_mint_burn.viewMintRandomNewPosition( + '', + poolInitParams.tickSpacing, + poolInitParams.tickCount, + poolInitParams.maxTick +) +console.log(positionParams) + +// execute the first mint +await E2E_mint_burn.test_mint('') + +// execute the burn +await E2E_mint_burn.test_burn_partial('') +// this should log the index of the position that was burned to the console +// as well as the amount that was burned. +// together with the above output this should make it clear which exact position +// was burned and how much +``` + +# Verification with Manticore + +The verification was performed with the experimental branch [dev-evm-experiments](https://github.com/trailofbits/manticore/tree/dev-evm-experiments), which contains new optimizations and is a work in progress. Trail of Bits will ensure that the following properties hold once the branch has stabilized and been included in a Manticore release. + +For conveniance, we followed the pattern "if there is reacheable path, there is a bug". + +To verify a property, run: + +``` +manticore . --contract CONTRACT_NAME --txlimit 1 --smt.solver all --quick-mode --lazy-evaluation --core.procs 1 +``` + +> The command might change once `dev-evm-experiments` has stabilized + +Manticore will create a `mcore_X` directory. If no `X.tx` file is generated, it means that Manticore did not find a path violating the property. + +| ID | Description | Contract | Status | +| --- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------- | +| 01 | `BitMath.mostSignificantBit returns a value in x >= 2**msb && (msb == 255 or x < 2**(msb+1)).` | [`VerifyBitMathMsb`](./contracts/crytic/manticore/001.sol) | Verified | +| 02 | `BitMath.leastSignificantBit returns a value in ((x & 2** lsb) != 0) && ((x & (2**(lsb -1))) == 0).` | [`VerifyBitMathLsb`](./contracts/crytic/manticore/002.sol) | Verified | +| 03 | `If LiquidityMath.addDelta returns, the value will be equal to x + uint128(y).` | [`VerifyLiquidityMathAddDelta`](./contracts/crytic/manticore/003.sol) | Verified | diff --git a/lib/v3-core/audits/tob/audit.pdf b/lib/v3-core/audits/tob/audit.pdf new file mode 100644 index 0000000..7a7f0dc Binary files /dev/null and b/lib/v3-core/audits/tob/audit.pdf differ diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml new file mode 100644 index 0000000..37472eb --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml @@ -0,0 +1,16 @@ +checkAsserts: true +coverage: true +codeSize: 0x60000 +corpusDir: echidna_e2e_mint_burn_corpus +seqLen: 10 +testLimit: 100000 +timeout: 600 # 10 minutes + +# blacklist +filterFunctions: + [ + 'E2E_mint_burn.viewInitRandomPoolParams(uint128)', + 'E2E_mint_burn.viewMintRandomNewPosition(uint128,int24,uint24,int24)', + 'E2E_mint_burn.viewBurnRandomPositionIdx(uint128,uint128)', + 'E2E_mint_burn.viewBurnRandomPositionBurnAmount(uint128,uint128)', + ] diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol new file mode 100644 index 0000000..4cd3b03 --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol @@ -0,0 +1,503 @@ +pragma solidity =0.7.6; +pragma abicoder v2; + +import './Setup.sol'; +import '../../../../../contracts/test/TestERC20.sol'; +import '../../../../../contracts/libraries/TickMath.sol'; +import '../../../../../contracts/UniswapV3Pool.sol'; +import '../../../../../contracts/libraries/Position.sol'; + +// import 'hardhat/console.sol'; + +contract E2E_mint_burn { + SetupTokens tokens; + SetupUniswap uniswap; + + UniswapV3Pool pool; + + TestERC20 token0; + TestERC20 token1; + + UniswapMinter minter; + UniswapSwapper swapper; + + int24[] usedTicks; + bool inited; + + PoolPosition[] positions; + + struct PoolPosition { + int24 tickLower; + int24 tickUpper; + uint128 amount; + bytes32 key; + } + + struct PoolParams { + uint24 fee; + int24 tickSpacing; + int24 minTick; + int24 maxTick; + uint24 tickCount; + uint160 startPrice; + int24 startTick; + } + + PoolParams poolParams; + + constructor() public { + tokens = new SetupTokens(); + token0 = tokens.token0(); + token1 = tokens.token1(); + + uniswap = new SetupUniswap(token0, token1); + + minter = new UniswapMinter(token0, token1); + swapper = new UniswapSwapper(token0, token1); + + tokens.mintTo(0, address(minter), 1e10 ether); + tokens.mintTo(1, address(minter), 1e10 ether); + } + + // + // + // Helpers + // + // + + function _getRandomPositionIdx(uint128 _seed, uint256 _positionsCount) internal view returns (uint128 positionIdx) { + positionIdx = _seed % uint128(_positionsCount); + } + + function _getRandomBurnAmount(uint128 _seed, uint128 _positionAmount) internal view returns (uint128 burnAmount) { + burnAmount = _seed % _positionAmount; + require(burnAmount < _positionAmount); + require(burnAmount > 0); + } + + function _getRandomPositionIdxAndBurnAmount(uint128 _seed) + internal + view + returns (uint128 positionIdx, uint128 burnAmount) + { + positionIdx = _getRandomPositionIdx(_seed, positions.length); + burnAmount = _getRandomBurnAmount(_seed, positions[positionIdx].amount); + } + + // adds all lower and upper ticks to an array such that the liquidity(Net) invariants + // can loop over them + function storeUsedTicks(int24 _tL, int24 _tU) internal { + bool lowerAlreadyUsed = false; + bool upperAlreadyUsed = false; + for (uint8 j = 0; j < usedTicks.length; j++) { + if (usedTicks[j] == _tL) lowerAlreadyUsed = true; + else if (usedTicks[j] == _tU) upperAlreadyUsed = true; + } + if (!lowerAlreadyUsed) usedTicks.push(_tL); + if (!upperAlreadyUsed) usedTicks.push(_tU); + } + + function removePosition(uint256 _posIdx) internal { + positions[_posIdx] = positions[positions.length - 1]; + positions.pop(); + } + + // use the _amount as _seed to create a random but valid position + function forgePosition( + uint128 _seed, + int24 _poolTickSpacing, + uint24 _poolTickCount, + int24 _poolMaxTick + ) internal view returns (int24 tickLower, int24 tickUpper) { + int24 randomTick1 = int24((_seed % uint128(_poolTickCount)) * uint128(_poolTickSpacing)); + + if (_seed % 2 == 0) { + // make tickLower positive + tickLower = randomTick1; + + // tickUpper is somewhere above tickLower + uint24 poolTickCountLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); + int24 randomTick2 = int24((_seed % uint128(poolTickCountLeft)) * uint128(_poolTickSpacing)); + tickUpper = tickLower + randomTick2; + } else { + // make tickLower negative or zero + tickLower = randomTick1 == 0 ? 0 : -randomTick1; + + uint24 poolTickCountNegativeLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); + uint24 poolTickCountTotalLeft = poolTickCountNegativeLeft + _poolTickCount; + + uint24 randomIncrement = uint24((_seed % uint128(poolTickCountTotalLeft)) * uint128(_poolTickSpacing)); + + if (randomIncrement <= uint24(tickLower)) { + // tickUpper will also be negative + tickUpper = tickLower + int24(randomIncrement); + } else { + // tickUpper is positive + randomIncrement -= uint24(-tickLower); + tickUpper = tickLower + int24(randomIncrement); + } + } + } + + // + // + // Invariants + // + // + + function check_liquidityNet_invariant() internal { + int128 liquidityNet = 0; + for (uint256 i = 0; i < usedTicks.length; i++) { + (, int128 tickLiquidityNet, , ) = pool.ticks(usedTicks[i]); + int128 result = liquidityNet + tickLiquidityNet; + assert( + (tickLiquidityNet >= 0 && result >= liquidityNet) || (tickLiquidityNet < 0 && result < liquidityNet) + ); + liquidityNet = result; + } + + // prop #20 + assert(liquidityNet == 0); + } + + function check_liquidity_invariant() internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + + int128 liquidity = 0; + for (uint256 i = 0; i < usedTicks.length; i++) { + int24 tick = usedTicks[i]; + + if (tick <= currentTick) { + (, int128 tickLiquidityNet, , ) = pool.ticks(tick); + + int128 result = liquidity + tickLiquidityNet; + assert((tickLiquidityNet >= 0 && result >= liquidity) || (tickLiquidityNet < 0 && result < liquidity)); + liquidity = result; + } + } + + // prop #21 + assert(uint128(liquidity) == pool.liquidity()); + assert(liquidity >= 0); + } + + function check_tick_feegrowth_invariant() internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + + if (currentTick == poolParams.maxTick || currentTick == poolParams.minTick) return; + + int24 tickBelow = currentTick - poolParams.tickSpacing; + int24 tickAbove = currentTick + poolParams.tickSpacing; + + (, , uint256 tB_feeGrowthOutside0X128, uint256 tB_feeGrowthOutside1X128) = pool.ticks(tickBelow); + (, , uint256 tA_feeGrowthOutside0X128, uint256 tA_feeGrowthOutside1X128) = pool.ticks(tickAbove); + + // prop #22 + assert(tB_feeGrowthOutside0X128 + tA_feeGrowthOutside0X128 <= pool.feeGrowthGlobal0X128()); + + // prop #23 + assert(tB_feeGrowthOutside1X128 + tA_feeGrowthOutside1X128 <= pool.feeGrowthGlobal1X128()); + } + + function check_mint_invariants( + int24 _tickLower, + int24 _tickUpper, + UniswapMinter.MinterStats memory bfre, + UniswapMinter.MinterStats memory aftr + ) internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + + // prop #1 + if (currentTick >= _tickLower && currentTick < _tickUpper) { + assert(aftr.liq > bfre.liq); + } else { + assert(aftr.liq == bfre.liq); + } + + // prop #2 + assert(aftr.tL_liqGross > bfre.tL_liqGross); + + // prop #3 + assert(aftr.tU_liqGross > bfre.tU_liqGross); + + // prop #4 + assert(aftr.tL_liqNet > bfre.tL_liqNet); + + // prop #5 + assert(aftr.tU_liqNet < bfre.tU_liqNet); + } + + function check_burn_invariants( + uint128 _burnAmount, + int24 _tickLower, + int24 _tickUpper, + uint128 _newPosAmount, + UniswapMinter.MinterStats memory bfre, + UniswapMinter.MinterStats memory aftr + ) internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + + if (_burnAmount > 0) { + // prop #7 + if (currentTick >= _tickLower && currentTick < _tickUpper) { + assert(aftr.liq < bfre.liq); + } else { + assert(aftr.liq == bfre.liq); + } + } else { + // prop #29 + assert(aftr.liq == bfre.liq); + } + + // prop #8 + assert(aftr.tL_liqGross <= bfre.tL_liqGross); + + // prop #9 + assert(aftr.tU_liqGross <= bfre.tU_liqGross); + + // prop #10 + assert(aftr.tL_liqNet <= bfre.tL_liqNet); + + // prop #11 + assert(aftr.tU_liqNet >= bfre.tU_liqNet); + + bytes32 positionKey = keccak256(abi.encodePacked(address(minter), _tickLower, _tickUpper)); + (uint128 positionLiquidity, , , , ) = pool.positions(positionKey); + + // prop #27 + assert(positionLiquidity == _newPosAmount); + } + + // + // + // Helper to reconstruct the "random" init setup of the pool + // + // + + function viewInitRandomPoolParams(uint128 _seed) public view returns (PoolParams memory _poolParams) { + _poolParams = forgePoolParams(_seed); + } + + function viewMintRandomNewPosition( + uint128 _seed, + int24 _poolTickSpacing, + uint24 _poolTickCount, + int24 _poolMaxTick + ) + public + view + returns ( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) + { + (tickLower, tickUpper) = forgePosition(_seed, _poolTickSpacing, _poolTickCount, _poolMaxTick); + amount = _seed; + } + + function viewBurnRandomPositionIdx(uint128 _seed, uint128 _positionsCount) + public + view + returns (uint128 positionIdx) + { + positionIdx = _getRandomPositionIdx(_seed, _positionsCount); + } + + function viewBurnRandomPositionBurnAmount(uint128 _seed, uint128 _positionAmount) + public + view + returns (uint128 burnAmount) + { + burnAmount = _getRandomBurnAmount(_seed, _positionAmount); + } + + // + // + // Setup functions + // + // + + function forgePoolParams(uint128 _seed) internal view returns (PoolParams memory _poolParams) { + // + // decide on one of the three fees, and corresponding tickSpacing + // + if (_seed % 3 == 0) { + _poolParams.fee = uint24(500); + _poolParams.tickSpacing = int24(10); + } else if (_seed % 3 == 1) { + _poolParams.fee = uint24(3000); + _poolParams.tickSpacing = int24(60); + } else if (_seed % 3 == 2) { + _poolParams.fee = uint24(10000); + _poolParams.tickSpacing = int24(2000); + } + + _poolParams.maxTick = (int24(887272) / _poolParams.tickSpacing) * _poolParams.tickSpacing; + _poolParams.minTick = -_poolParams.maxTick; + _poolParams.tickCount = uint24(_poolParams.maxTick / _poolParams.tickSpacing); + + // + // set the initial price + // + _poolParams.startTick = int24((_seed % uint128(_poolParams.tickCount)) * uint128(_poolParams.tickSpacing)); + if (_seed % 3 == 0) { + // set below 0 + _poolParams.startPrice = TickMath.getSqrtRatioAtTick(-_poolParams.startTick); + } else if (_seed % 3 == 1) { + // set at 0 + _poolParams.startPrice = TickMath.getSqrtRatioAtTick(0); + _poolParams.startTick = 0; + } else if (_seed % 3 == 2) { + // set above 0 + _poolParams.startPrice = TickMath.getSqrtRatioAtTick(_poolParams.startTick); + } + } + + function _init(uint128 _seed) internal { + // + // generate random pool params + // + poolParams = forgePoolParams(_seed); + + // + // deploy the pool + // + uniswap.createPool(poolParams.fee, poolParams.startPrice); + pool = uniswap.pool(); + + // + // set the pool inside the minter and swapper contracts + // + minter.setPool(pool); + + inited = true; + } + + // + // + // Functions to fuzz + // + // + + function test_mint(uint128 _amount) public { + if (!inited) _init(_amount); + (int24 _tL, int24 _tU) = + forgePosition(_amount, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); + + (UniswapMinter.MinterStats memory bfre, UniswapMinter.MinterStats memory aftr) = + minter.doMint(_tL, _tU, _amount); + storeUsedTicks(_tL, _tU); + + check_mint_invariants(_tL, _tU, bfre, aftr); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + + bytes32 positionKey = keccak256(abi.encodePacked(address(minter), _tL, _tU)); + + bool mintingToExistingPos = false; + for (uint256 i = 0; i < positions.length; i++) { + if (positions[i].key == positionKey) { + // minting to an existing position + positions[i].amount += _amount; + mintingToExistingPos = true; + break; + } + } + + if (!mintingToExistingPos) { + positions.push(PoolPosition(_tL, _tU, _amount, positionKey)); + } + } + + function test_burn_partial(uint128 _amount) public { + require(positions.length > 0); + + (uint128 posIdx, uint128 burnAmount) = _getRandomPositionIdxAndBurnAmount(_amount); + // console.log('burn posIdx = %s', posIdx); + // console.log('burn amount = %s', burnAmount); + PoolPosition storage pos = positions[posIdx]; + + UniswapMinter.MinterStats memory bfre; + UniswapMinter.MinterStats memory aftr; + + try minter.doBurn(pos.tickLower, pos.tickUpper, burnAmount) returns ( + UniswapMinter.MinterStats memory bfre_burn, + UniswapMinter.MinterStats memory aftr_burn + ) { + bfre = bfre_burn; + aftr = aftr_burn; + } catch { + // prop #28 + assert(false); + } + + check_burn_invariants(burnAmount, pos.tickLower, pos.tickUpper, pos.amount - burnAmount, bfre, aftr); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + + pos.amount = pos.amount - burnAmount; + } + + function test_burn_full(uint128 _amount) public { + require(positions.length > 0); + + uint128 posIdx = _getRandomPositionIdx(_amount, positions.length); + // console.log('burn posIdx = %s', posIdx); + PoolPosition storage pos = positions[posIdx]; + + UniswapMinter.MinterStats memory bfre; + UniswapMinter.MinterStats memory aftr; + + try minter.doBurn(pos.tickLower, pos.tickUpper, pos.amount) returns ( + UniswapMinter.MinterStats memory bfre_burn, + UniswapMinter.MinterStats memory aftr_burn + ) { + bfre = bfre_burn; + aftr = aftr_burn; + } catch { + // prop #25 + assert(false); + } + + check_burn_invariants(pos.amount, pos.tickLower, pos.tickUpper, 0, bfre, aftr); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + + removePosition(posIdx); + } + + function test_burn_zero(uint128 _amount) public { + require(positions.length > 0); + + uint128 posIdx = _getRandomPositionIdx(_amount, positions.length); + // console.log('burn posIdx = %s', posIdx); + PoolPosition storage pos = positions[posIdx]; + + UniswapMinter.MinterStats memory bfre; + UniswapMinter.MinterStats memory aftr; + + try minter.doBurn(pos.tickLower, pos.tickUpper, 0) returns ( + UniswapMinter.MinterStats memory bfre_burn, + UniswapMinter.MinterStats memory aftr_burn + ) { + bfre = bfre_burn; + aftr = aftr_burn; + } catch { + // prop #26 + assert(false); + } + + check_burn_invariants(0, pos.tickLower, pos.tickUpper, pos.amount, bfre, aftr); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml new file mode 100644 index 0000000..b2c5c6d --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml @@ -0,0 +1,10 @@ +checkAsserts: true +coverage: true +codeSize: 0x60000 +corpusDir: echidna_e2e_swap_corpus +seqLen: 10 +testLimit: 100000 +timeout: 3600 # 1 hour + +# blacklist +filterFunctions: ['E2E_swap.viewRandomInit(uint128)'] diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol new file mode 100644 index 0000000..289ccb9 --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.sol @@ -0,0 +1,487 @@ +pragma solidity =0.7.6; +pragma abicoder v2; + +import './Setup.sol'; +import '../../../../../contracts/test/TestERC20.sol'; +import '../../../../../contracts/libraries/TickMath.sol'; +import '../../../../../contracts/UniswapV3Pool.sol'; + +// import 'hardhat/console.sol'; + +contract E2E_swap { + SetupTokens tokens; + SetupUniswap uniswap; + + UniswapV3Pool pool; + + TestERC20 token0; + TestERC20 token1; + + UniswapMinter minter; + UniswapSwapper swapper; + + int24[] usedTicks; + bool inited; + + struct PoolParams { + uint24 fee; + int24 tickSpacing; + int24 minTick; + int24 maxTick; + uint24 tickCount; + uint160 startPrice; + int24 startTick; + } + + struct PoolPositions { + int24[] tickLowers; + int24[] tickUppers; + uint128[] amounts; + } + + PoolParams poolParams; + PoolPositions poolPositions; + + constructor() public { + tokens = new SetupTokens(); + token0 = tokens.token0(); + token1 = tokens.token1(); + + uniswap = new SetupUniswap(token0, token1); + + minter = new UniswapMinter(token0, token1); + swapper = new UniswapSwapper(token0, token1); + + tokens.mintTo(0, address(swapper), 1e9 ether); + tokens.mintTo(1, address(swapper), 1e9 ether); + + tokens.mintTo(0, address(minter), 1e10 ether); + tokens.mintTo(1, address(minter), 1e10 ether); + } + + // + // + // Helpers + // + // + + function get_random_zeroForOne_priceLimit(int256 _amountSpecified) + internal + view + returns (uint160 sqrtPriceLimitX96) + { + // help echidna a bit by calculating a valid sqrtPriceLimitX96 using the amount as random seed + (uint160 currentPrice, , , , , , ) = pool.slot0(); + uint160 minimumPrice = TickMath.MIN_SQRT_RATIO; + sqrtPriceLimitX96 = + minimumPrice + + uint160( + (uint256(_amountSpecified > 0 ? _amountSpecified : -_amountSpecified) % (currentPrice - minimumPrice)) + ); + } + + function get_random_oneForZero_priceLimit(int256 _amountSpecified) + internal + view + returns (uint160 sqrtPriceLimitX96) + { + // help echidna a bit by calculating a valid sqrtPriceLimitX96 using the amount as random seed + (uint160 currentPrice, , , , , , ) = pool.slot0(); + uint160 maximumPrice = TickMath.MAX_SQRT_RATIO; + sqrtPriceLimitX96 = + currentPrice + + uint160( + (uint256(_amountSpecified > 0 ? _amountSpecified : -_amountSpecified) % (maximumPrice - currentPrice)) + ); + } + + // + // + // Invariants + // + // + + function check_liquidityNet_invariant() internal { + int128 liquidityNet = 0; + for (uint256 i = 0; i < usedTicks.length; i++) { + (, int128 tickLiquidityNet, , ) = pool.ticks(usedTicks[i]); + int128 result = liquidityNet + tickLiquidityNet; + assert( + (tickLiquidityNet >= 0 && result >= liquidityNet) || (tickLiquidityNet < 0 && result < liquidityNet) + ); + liquidityNet = result; + } + + // prop #20 + assert(liquidityNet == 0); + } + + function check_liquidity_invariant() internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + int128 liquidity = 0; + for (uint256 i = 0; i < usedTicks.length; i++) { + int24 tick = usedTicks[i]; + if (tick <= currentTick) { + (, int128 tickLiquidityNet, , ) = pool.ticks(tick); + int128 result = liquidity + tickLiquidityNet; + assert((tickLiquidityNet >= 0 && result >= liquidity) || (tickLiquidityNet < 0 && result < liquidity)); + liquidity = result; + } + } + + // prop #21 + assert(uint128(liquidity) == pool.liquidity()); + assert(liquidity >= 0); + } + + function check_tick_feegrowth_invariant() internal { + (, int24 currentTick, , , , , ) = pool.slot0(); + + if (currentTick == poolParams.maxTick || currentTick == poolParams.minTick) return; + + int24 tickBelow = currentTick - poolParams.tickSpacing; + int24 tickAbove = currentTick + poolParams.tickSpacing; + + (, , uint256 tB_feeGrowthOutside0X128, uint256 tB_feeGrowthOutside1X128) = pool.ticks(tickBelow); + (, , uint256 tA_feeGrowthOutside0X128, uint256 tA_feeGrowthOutside1X128) = pool.ticks(tickAbove); + + // prop #22 + assert(tB_feeGrowthOutside0X128 + tA_feeGrowthOutside0X128 <= pool.feeGrowthGlobal0X128()); + + // prop #23 + assert(tB_feeGrowthOutside1X128 + tA_feeGrowthOutside1X128 <= pool.feeGrowthGlobal1X128()); + } + + function check_swap_invariants( + int24 tick_bfre, + int24 tick_aftr, + uint128 liq_bfre, + uint128 liq_aftr, + uint256 bal_sell_bfre, + uint256 bal_sell_aftr, + uint256 bal_buy_bfre, + uint256 bal_buy_aftr, + uint256 feegrowth_sell_bfre, + uint256 feegrowth_sell_aftr, + uint256 feegrowth_buy_bfre, + uint256 feegrowth_buy_aftr + ) internal { + // prop #17 + if (tick_bfre == tick_aftr) { + assert(liq_bfre == liq_aftr); + } + + // prop #13 + #15 + assert(feegrowth_sell_bfre <= feegrowth_sell_aftr); + + // prop #14 + #16 + assert(feegrowth_buy_bfre == feegrowth_buy_aftr); + + // prop #18 + #19 + if (bal_sell_bfre == bal_sell_aftr) { + assert(bal_buy_bfre == bal_buy_aftr); + } + } + + // + // + // Helper to reconstruct the "random" init setup of the pool + // + // + + function viewRandomInit(uint128 _seed) + public + view + returns (PoolParams memory poolParams, PoolPositions memory poolPositions) + { + poolParams = forgePoolParams(_seed); + poolPositions = forgePoolPositions(_seed, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); + } + + // + // + // Setup functions + // + // + + function forgePoolParams(uint128 _seed) internal view returns (PoolParams memory poolParams) { + // + // decide on one of the three fees, and corresponding tickSpacing + // + if (_seed % 3 == 0) { + poolParams.fee = uint24(500); + poolParams.tickSpacing = int24(10); + } else if (_seed % 3 == 1) { + poolParams.fee = uint24(3000); + poolParams.tickSpacing = int24(60); + } else if (_seed % 3 == 2) { + poolParams.fee = uint24(10000); + poolParams.tickSpacing = int24(2000); + } + + poolParams.maxTick = (int24(887272) / poolParams.tickSpacing) * poolParams.tickSpacing; + poolParams.minTick = -poolParams.maxTick; + poolParams.tickCount = uint24(poolParams.maxTick / poolParams.tickSpacing); + + // + // set the initial price + // + poolParams.startTick = int24((_seed % uint128(poolParams.tickCount)) * uint128(poolParams.tickSpacing)); + if (_seed % 3 == 0) { + // set below 0 + poolParams.startPrice = TickMath.getSqrtRatioAtTick(-poolParams.startTick); + } else if (_seed % 3 == 1) { + // set at 0 + poolParams.startPrice = TickMath.getSqrtRatioAtTick(0); + poolParams.startTick = 0; + } else if (_seed % 3 == 2) { + // set above 0 + poolParams.startPrice = TickMath.getSqrtRatioAtTick(poolParams.startTick); + } + } + + function forgePoolPositions( + uint128 _seed, + int24 _poolTickSpacing, + uint24 _poolTickCount, + int24 _poolMaxTick + ) internal view returns (PoolPositions memory poolPositions_) { + // between 1 and 10 (inclusive) positions + uint8 positionsCount = uint8(_seed % 10) + 1; + + poolPositions_.tickLowers = new int24[](positionsCount); + poolPositions_.tickUppers = new int24[](positionsCount); + poolPositions_.amounts = new uint128[](positionsCount); + + for (uint8 i = 0; i < positionsCount; i++) { + int24 tickLower; + int24 tickUpper; + uint128 amount; + + int24 randomTick1 = int24((_seed % uint128(_poolTickCount)) * uint128(_poolTickSpacing)); + + if (_seed % 2 == 0) { + // make tickLower positive + tickLower = randomTick1; + + // tickUpper is somewhere above tickLower + uint24 poolTickCountLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); + int24 randomTick2 = int24((_seed % uint128(poolTickCountLeft)) * uint128(_poolTickSpacing)); + tickUpper = tickLower + randomTick2; + } else { + // make tickLower negative or zero + tickLower = randomTick1 == 0 ? 0 : -randomTick1; + + uint24 poolTickCountNegativeLeft = uint24((_poolMaxTick - randomTick1) / _poolTickSpacing); + uint24 poolTickCountTotalLeft = poolTickCountNegativeLeft + _poolTickCount; + + uint24 randomIncrement = uint24((_seed % uint128(poolTickCountTotalLeft)) * uint128(_poolTickSpacing)); + + if (randomIncrement <= uint24(tickLower)) { + // tickUpper will also be negative + tickUpper = tickLower + int24(randomIncrement); + } else { + // tickUpper is positive + randomIncrement -= uint24(-tickLower); + tickUpper = tickLower + int24(randomIncrement); + } + } + + amount = uint128(1e8 ether); + + poolPositions_.tickLowers[i] = tickLower; + poolPositions_.tickUppers[i] = tickUpper; + poolPositions_.amounts[i] = amount; + + _seed += uint128(tickLower); + } + } + + function _init(uint128 _seed) internal { + // + // generate random pool params + // + poolParams = forgePoolParams(_seed); + + // + // deploy the pool + // + uniswap.createPool(poolParams.fee, poolParams.startPrice); + pool = uniswap.pool(); + + // + // set the pool inside the minter and swapper contracts + // + minter.setPool(pool); + swapper.setPool(pool); + + // + // generate random positions + // + poolPositions = forgePoolPositions(_seed, poolParams.tickSpacing, poolParams.tickCount, poolParams.maxTick); + + // + // create the positions + // + for (uint8 i = 0; i < poolPositions.tickLowers.length; i++) { + int24 tickLower = poolPositions.tickLowers[i]; + int24 tickUpper = poolPositions.tickUppers[i]; + uint128 amount = poolPositions.amounts[i]; + + minter.doMint(tickLower, tickUpper, amount); + + bool lowerAlreadyUsed = false; + bool upperAlreadyUsed = false; + for (uint8 j = 0; j < usedTicks.length; j++) { + if (usedTicks[j] == tickLower) lowerAlreadyUsed = true; + else if (usedTicks[j] == tickUpper) upperAlreadyUsed = true; + } + if (!lowerAlreadyUsed) usedTicks.push(tickLower); + if (!upperAlreadyUsed) usedTicks.push(tickUpper); + } + + inited = true; + } + + // + // + // Functions to fuzz + // + // + + function test_swap_exactIn_zeroForOne(uint128 _amount) public { + require(_amount != 0); + + if (!inited) _init(_amount); + + require(token0.balanceOf(address(swapper)) >= uint256(_amount)); + int256 _amountSpecified = int256(_amount); + + uint160 sqrtPriceLimitX96 = get_random_zeroForOne_priceLimit(_amount); + // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); + + (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = + swapper.doSwap(true, _amountSpecified, sqrtPriceLimitX96); + + check_swap_invariants( + bfre.tick, + aftr.tick, + bfre.liq, + aftr.liq, + bfre.bal0, + aftr.bal0, + bfre.bal1, + aftr.bal1, + bfre.feeGrowthGlobal0X128, + aftr.feeGrowthGlobal0X128, + bfre.feeGrowthGlobal1X128, + aftr.feeGrowthGlobal1X128 + ); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + } + + function test_swap_exactIn_oneForZero(uint128 _amount) public { + require(_amount != 0); + + if (!inited) _init(_amount); + + require(token1.balanceOf(address(swapper)) >= uint256(_amount)); + int256 _amountSpecified = int256(_amount); + + uint160 sqrtPriceLimitX96 = get_random_oneForZero_priceLimit(_amount); + // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); + + (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = + swapper.doSwap(false, _amountSpecified, sqrtPriceLimitX96); + + check_swap_invariants( + bfre.tick, + aftr.tick, + bfre.liq, + aftr.liq, + bfre.bal1, + aftr.bal1, + bfre.bal0, + aftr.bal0, + bfre.feeGrowthGlobal1X128, + aftr.feeGrowthGlobal1X128, + bfre.feeGrowthGlobal0X128, + aftr.feeGrowthGlobal0X128 + ); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + } + + function test_swap_exactOut_zeroForOne(uint128 _amount) public { + require(_amount != 0); + + if (!inited) _init(_amount); + + require(token0.balanceOf(address(swapper)) > 0); + int256 _amountSpecified = -int256(_amount); + + uint160 sqrtPriceLimitX96 = get_random_zeroForOne_priceLimit(_amount); + // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); + + (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = + swapper.doSwap(true, _amountSpecified, sqrtPriceLimitX96); + + check_swap_invariants( + bfre.tick, + aftr.tick, + bfre.liq, + aftr.liq, + bfre.bal0, + aftr.bal0, + bfre.bal1, + aftr.bal1, + bfre.feeGrowthGlobal0X128, + aftr.feeGrowthGlobal0X128, + bfre.feeGrowthGlobal1X128, + aftr.feeGrowthGlobal1X128 + ); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + } + + function test_swap_exactOut_oneForZero(uint128 _amount) public { + require(_amount != 0); + + if (!inited) _init(_amount); + + require(token0.balanceOf(address(swapper)) > 0); + int256 _amountSpecified = -int256(_amount); + + uint160 sqrtPriceLimitX96 = get_random_oneForZero_priceLimit(_amount); + // console.log('sqrtPriceLimitX96 = %s', sqrtPriceLimitX96); + + (UniswapSwapper.SwapperStats memory bfre, UniswapSwapper.SwapperStats memory aftr) = + swapper.doSwap(false, _amountSpecified, sqrtPriceLimitX96); + + check_swap_invariants( + bfre.tick, + aftr.tick, + bfre.liq, + aftr.liq, + bfre.bal1, + aftr.bal1, + bfre.bal0, + aftr.bal0, + bfre.feeGrowthGlobal1X128, + aftr.feeGrowthGlobal1X128, + bfre.feeGrowthGlobal0X128, + aftr.feeGrowthGlobal0X128 + ); + + check_liquidityNet_invariant(); + check_liquidity_invariant(); + check_tick_feegrowth_invariant(); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml b/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml new file mode 100644 index 0000000..0bad147 --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml @@ -0,0 +1,7 @@ +checkAsserts: true +coverage: true +codeSize: 0x60000 +corpusDir: echidna_other_corpus +seqLen: 1000 +testLimit: 100000 +timeout: 3600 # 1 hour diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol b/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol new file mode 100644 index 0000000..5832e8b --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/Other.sol @@ -0,0 +1,21 @@ +pragma solidity =0.7.6; + +import '../../../../../contracts/libraries/SqrtPriceMath.sol'; +import '../../../../../contracts/libraries/TickMath.sol'; + +contract Other { + // prop #30 + function test_getNextSqrtPriceFromInAndOutput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) public { + require(sqrtPX96 >= TickMath.MIN_SQRT_RATIO && sqrtPX96 < TickMath.MAX_SQRT_RATIO); + require(liquidity < 3121856577256316178563069792952001939); // max liquidity per tick + uint256 next_sqrt = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtPX96, liquidity, amount, add); + assert(next_sqrt >= TickMath.MIN_SQRT_RATIO && next_sqrt < TickMath.MAX_SQRT_RATIO); + next_sqrt = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtPX96, liquidity, amount, add); + assert(next_sqrt >= TickMath.MIN_SQRT_RATIO && next_sqrt < TickMath.MAX_SQRT_RATIO); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol b/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol new file mode 100644 index 0000000..922838c --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/echidna/Setup.sol @@ -0,0 +1,205 @@ +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../../../../../contracts/test/TestERC20.sol'; +import '../../../../../contracts/UniswapV3Pool.sol'; +import '../../../../../contracts/UniswapV3Factory.sol'; + +contract SetupToken { + TestERC20 public token; + + constructor() public { + // this contract will receive the total supply of 100 tokens + token = new TestERC20(1e12 ether); + } + + function mintTo(address _recipient, uint256 _amount) public { + token.transfer(_recipient, _amount); + } +} + +contract SetupTokens { + SetupToken tokenSetup0; + SetupToken tokenSetup1; + + TestERC20 public token0; + TestERC20 public token1; + + constructor() public { + // create the token wrappers + tokenSetup0 = new SetupToken(); + tokenSetup1 = new SetupToken(); + + // switch them around so that token0's address is lower than token1's + // since this is what the uniswap factory will do when you create the pool + if (address(tokenSetup0.token()) > address(tokenSetup1.token())) { + (tokenSetup0, tokenSetup1) = (tokenSetup1, tokenSetup0); + } + + // save the erc20 tokens + token0 = tokenSetup0.token(); + token1 = tokenSetup1.token(); + } + + // mint either token0 or token1 to a chosen account + function mintTo( + uint256 _tokenIdx, + address _recipient, + uint256 _amount + ) public { + require(_tokenIdx == 0 || _tokenIdx == 1, 'invalid token idx'); + if (_tokenIdx == 0) tokenSetup0.mintTo(_recipient, _amount); + if (_tokenIdx == 1) tokenSetup1.mintTo(_recipient, _amount); + } +} + +contract SetupUniswap { + UniswapV3Pool public pool; + TestERC20 token0; + TestERC20 token1; + + // will create the following enabled fees and corresponding tickSpacing + // fee 500 + tickSpacing 10 + // fee 3000 + tickSpacing 60 + // fee 10000 + tickSpacing 200 + UniswapV3Factory factory; + + constructor(TestERC20 _token0, TestERC20 _token1) public { + factory = new UniswapV3Factory(); + token0 = _token0; + token1 = _token1; + } + + function createPool(uint24 _fee, uint160 _startPrice) public { + pool = UniswapV3Pool(factory.createPool(address(token0), address(token1), _fee)); + pool.initialize(_startPrice); + } +} + +contract UniswapMinter { + UniswapV3Pool pool; + TestERC20 token0; + TestERC20 token1; + + struct MinterStats { + uint128 liq; + uint128 tL_liqGross; + int128 tL_liqNet; + uint128 tU_liqGross; + int128 tU_liqNet; + } + + constructor(TestERC20 _token0, TestERC20 _token1) public { + token0 = _token0; + token1 = _token1; + } + + function setPool(UniswapV3Pool _pool) public { + pool = _pool; + } + + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external { + if (amount0Owed > 0) token0.transfer(address(pool), amount0Owed); + if (amount1Owed > 0) token1.transfer(address(pool), amount1Owed); + } + + function getTickLiquidityVars(int24 _tickLower, int24 _tickUpper) + internal + view + returns ( + uint128, + int128, + uint128, + int128 + ) + { + (uint128 tL_liqGross, int128 tL_liqNet, , ) = pool.ticks(_tickLower); + (uint128 tU_liqGross, int128 tU_liqNet, , ) = pool.ticks(_tickUpper); + return (tL_liqGross, tL_liqNet, tU_liqGross, tU_liqNet); + } + + function getStats(int24 _tickLower, int24 _tickUpper) internal view returns (MinterStats memory stats) { + (uint128 tL_lg, int128 tL_ln, uint128 tU_lg, int128 tU_ln) = getTickLiquidityVars(_tickLower, _tickUpper); + return MinterStats(pool.liquidity(), tL_lg, tL_ln, tU_lg, tU_ln); + } + + function doMint( + int24 _tickLower, + int24 _tickUpper, + uint128 _amount + ) public returns (MinterStats memory bfre, MinterStats memory aftr) { + bfre = getStats(_tickLower, _tickUpper); + pool.mint(address(this), _tickLower, _tickUpper, _amount, new bytes(0)); + aftr = getStats(_tickLower, _tickUpper); + } + + function doBurn( + int24 _tickLower, + int24 _tickUpper, + uint128 _amount + ) public returns (MinterStats memory bfre, MinterStats memory aftr) { + bfre = getStats(_tickLower, _tickUpper); + pool.burn(_tickLower, _tickUpper, _amount); + aftr = getStats(_tickLower, _tickUpper); + } +} + +contract UniswapSwapper { + UniswapV3Pool pool; + TestERC20 token0; + TestERC20 token1; + + struct SwapperStats { + uint128 liq; + uint256 feeGrowthGlobal0X128; + uint256 feeGrowthGlobal1X128; + uint256 bal0; + uint256 bal1; + int24 tick; + } + + constructor(TestERC20 _token0, TestERC20 _token1) public { + token0 = _token0; + token1 = _token1; + } + + function setPool(UniswapV3Pool _pool) public { + pool = _pool; + } + + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external { + if (amount0Delta > 0) token0.transfer(address(pool), uint256(amount0Delta)); + if (amount1Delta > 0) token1.transfer(address(pool), uint256(amount1Delta)); + } + + function getStats() internal view returns (SwapperStats memory stats) { + (, int24 currentTick, , , , , ) = pool.slot0(); + return + SwapperStats( + pool.liquidity(), + pool.feeGrowthGlobal0X128(), + pool.feeGrowthGlobal1X128(), + token0.balanceOf(address(this)), + token1.balanceOf(address(this)), + currentTick + ); + } + + function doSwap( + bool _zeroForOne, + int256 _amountSpecified, + uint160 _sqrtPriceLimitX96 + ) public returns (SwapperStats memory bfre, SwapperStats memory aftr) { + bfre = getStats(); + pool.swap(address(this), _zeroForOne, _amountSpecified, _sqrtPriceLimitX96, new bytes(0)); + aftr = getStats(); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol b/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol new file mode 100644 index 0000000..dada7c4 --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/manticore/001.sol @@ -0,0 +1,11 @@ +import '../../../../../contracts/libraries/BitMath.sol'; + +contract VerifyBitMathMsb { + function verify(uint256 x) external { + uint256 msb = BitMath.mostSignificantBit(x); + + bool property = x >= 2**msb && (msb == 255 || x < 2**(msb + 1)); + + require(!property); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol b/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol new file mode 100644 index 0000000..055bc92 --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/manticore/002.sol @@ -0,0 +1,12 @@ +import '../../../../../contracts/libraries/BitMath.sol'; + +contract VerifyBitMathLsb { + function verify(uint256 x) external { + uint256 lsb = BitMath.leastSignificantBit(x); + + // (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) + bool property = ((x & (2**lsb)) != 0) && ((x & (2**(lsb - 1))) == 0); + + require(!property); + } +} diff --git a/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol b/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol new file mode 100644 index 0000000..99cee9f --- /dev/null +++ b/lib/v3-core/audits/tob/contracts/crytic/manticore/003.sol @@ -0,0 +1,9 @@ +import '../../../../../contracts/libraries/LiquidityMath.sol'; + +contract VerifyLiquidityMathAddDelta { + function verify(uint128 x, int128 y) external { + uint256 z = LiquidityMath.addDelta(x, y); + + require(z != x + uint128(y)); + } +} diff --git a/lib/v3-core/bug-bounty.md b/lib/v3-core/bug-bounty.md new file mode 100644 index 0000000..f01c4c6 --- /dev/null +++ b/lib/v3-core/bug-bounty.md @@ -0,0 +1,76 @@ +# Uniswap V3 Bug Bounty + +## Overview + +Starting on March 23rd, 2021, the [uniswap-v3-core](https://github.com/Uniswap/uniswap-v3-core) repository is subject to the Uniswap V3 Bug Bounty (the “Program”) to incentivize responsible bug disclosure. + +We are limiting the scope of the Program to critical and high severity bugs, and are offering a reward of up to $500,000. Happy hunting! + +## Scope + +The scope of the Program is limited to bugs that result in the draining of contract funds. + +The following are not within the scope of the Program: + +- Any contract located under [contracts/test](./contracts/test). +- Bugs in any third party contract or platform that interacts with Uniswap V3. +- Vulnerabilities already reported and/or discovered in contracts built by third parties on Uniswap V3. +- Any already-reported bugs. + +Vulnerabilities contingent upon the occurrence of any of the following also are outside the scope of this Program: + +- Frontend bugs +- DDOS attacks +- Spamming +- Phishing +- Automated tools (Github Actions, AWS, etc.) +- Compromise or misuse of third party systems or services + +## Assumptions + +Uniswap V3 was developed with the following assumptions, and thus any bug must also adhere to the following assumptions +to be eligible for the bug bounty: + +- The total supply of any token does not exceed 2128 - 1, i.e. `type(uint128).max`. +- The `transfer` and `transferFrom` methods of any token strictly decrease the balance of the token sender by the transfer amount and increases the balance of token recipient by the transfer amount, i.e. fee on transfer tokens are excluded. +- The token balance of an address can only change due to a call to `transfer` by the sender or `transferFrom` by an approved address, i.e. rebase tokens and interest bearing tokens are excluded. + +## Rewards + +Rewards will be allocated based on the severity of the bug disclosed and will be evaluated and rewarded at the discretion of the Uniswap Labs team. For critical bugs that lead to any loss of LP funds, rewards of up to $500,000 will be granted. Lower severity bugs will be rewarded at the discretion of the team. In addition, all vulnerabilities disclosed prior to the mainnet launch date will be subject to receive higher rewards. + +## Disclosure + +Any vulnerability or bug discovered must be reported only to the following email: [security@uniswap.org](mailto:security@uniswap.org). + +The vulnerability must not be disclosed publicly or to any other person, entity or email address before Uniswap Labs has been notified, has fixed the issue, and has granted permission for public disclosure. In addition, disclosure must be made within 24 hours following discovery of the vulnerability. + +A detailed report of a vulnerability increases the likelihood of a reward and may increase the reward amount. Please provide as much information about the vulnerability as possible, including: + +- The conditions on which reproducing the bug is contingent. +- The steps needed to reproduce the bug or, preferably, a proof of concept. +- The potential implications of the vulnerability being abused. + +Anyone who reports a unique, previously-unreported vulnerability that results in a change to the code or a configuration change and who keeps such vulnerability confidential until it has been resolved by our engineers will be recognized publicly for their contribution if they so choose. + +## Eligibility + +To be eligible for a reward under this Program, you must: + +- Discover a previously unreported, non-public vulnerability that would result in a loss of and/or lock on any ERC-20 token on Uniswap V3 (but not on any third party platform interacting with Uniswap V3) and that is within the scope of this Program. Vulnerabilities must be distinct from the issues covered in the Trail of Bits or ABDK audits. +- Be the first to disclose the unique vulnerability to [security@uniswap.org](mailto:security@uniswap.org), in compliance with the disclosure requirements above. If similar vulnerabilities are reported within the same 24 hour period, rewards will be split at the discretion of Uniswap Labs. +- Provide sufficient information to enable our engineers to reproduce and fix the vulnerability. +- Not engage in any unlawful conduct when disclosing the bug, including through threats, demands, or any other coercive tactics. +- Not exploit the vulnerability in any way, including through making it public or by obtaining a profit (other than a reward under this Program). +- Make a good faith effort to avoid privacy violations, destruction of data, interruption or degradation of Uniswap V3. +- Submit only one vulnerability per submission, unless you need to chain vulnerabilities to provide impact regarding any of the vulnerabilities. +- Not submit a vulnerability caused by an underlying issue that is the same as an issue on which a reward has been paid under this Program. +- Not be one of our current or former employees, vendors, or contractors or an employee of any of those vendors or contractors. +- Not be subject to US sanctions or reside in a US-embargoed country. +- Be at least 18 years of age or, if younger, submit your vulnerability with the consent of your parent or guardian. + +## Other Terms + +By submitting your report, you grant Uniswap Labs any and all rights, including intellectual property rights, needed to validate, mitigate, and disclose the vulnerability. All reward decisions, including eligibility for and amounts of the rewards and the manner in which such rewards will be paid, are made at our sole discretion. + +The terms and conditions of this Program may be altered at any time. diff --git a/lib/v3-core/contracts/NoDelegateCall.sol b/lib/v3-core/contracts/NoDelegateCall.sol new file mode 100644 index 0000000..5411979 --- /dev/null +++ b/lib/v3-core/contracts/NoDelegateCall.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.7.6; + +/// @title Prevents delegatecall to a contract +/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract +abstract contract NoDelegateCall { + /// @dev The original address of this contract + address private immutable original; + + constructor() { + // Immutables are computed in the init code of the contract, and then inlined into the deployed bytecode. + // In other words, this variable won't change when it's checked at runtime. + original = address(this); + } + + /// @dev Private method is used instead of inlining into modifier because modifiers are copied into each method, + /// and the use of immutable means the address bytes are copied in every place the modifier is used. + function checkNotDelegateCall() private view { + require(address(this) == original); + } + + /// @notice Prevents delegatecall into the modified method + modifier noDelegateCall() { + checkNotDelegateCall(); + _; + } +} diff --git a/lib/v3-core/contracts/UniswapV3Factory.sol b/lib/v3-core/contracts/UniswapV3Factory.sol new file mode 100644 index 0000000..3553ce5 --- /dev/null +++ b/lib/v3-core/contracts/UniswapV3Factory.sol @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.7.6; + +import './interfaces/IUniswapV3Factory.sol'; + +import './UniswapV3PoolDeployer.sol'; +import './NoDelegateCall.sol'; + +import './UniswapV3Pool.sol'; + +/// @title Canonical Uniswap V3 factory +/// @notice Deploys Uniswap V3 pools and manages ownership and control over pool protocol fees +contract UniswapV3Factory is IUniswapV3Factory, UniswapV3PoolDeployer, NoDelegateCall { + /// @inheritdoc IUniswapV3Factory + address public override owner; + + /// @inheritdoc IUniswapV3Factory + mapping(uint24 => int24) public override feeAmountTickSpacing; + /// @inheritdoc IUniswapV3Factory + mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; + + constructor() { + owner = msg.sender; + emit OwnerChanged(address(0), msg.sender); + + feeAmountTickSpacing[500] = 10; + emit FeeAmountEnabled(500, 10); + feeAmountTickSpacing[3000] = 60; + emit FeeAmountEnabled(3000, 60); + feeAmountTickSpacing[10000] = 200; + emit FeeAmountEnabled(10000, 200); + } + + /// @inheritdoc IUniswapV3Factory + function createPool( + address tokenA, + address tokenB, + uint24 fee + ) external override noDelegateCall returns (address pool) { + require(tokenA != tokenB); + (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); + require(token0 != address(0)); + int24 tickSpacing = feeAmountTickSpacing[fee]; + require(tickSpacing != 0); + require(getPool[token0][token1][fee] == address(0)); + pool = deploy(address(this), token0, token1, fee, tickSpacing); + getPool[token0][token1][fee] = pool; + // populate mapping in the reverse direction, deliberate choice to avoid the cost of comparing addresses + getPool[token1][token0][fee] = pool; + emit PoolCreated(token0, token1, fee, tickSpacing, pool); + } + + /// @inheritdoc IUniswapV3Factory + function setOwner(address _owner) external override { + require(msg.sender == owner); + emit OwnerChanged(owner, _owner); + owner = _owner; + } + + /// @inheritdoc IUniswapV3Factory + function enableFeeAmount(uint24 fee, int24 tickSpacing) public override { + require(msg.sender == owner); + require(fee < 1000000); + // tick spacing is capped at 16384 to prevent the situation where tickSpacing is so large that + // TickBitmap#nextInitializedTickWithinOneWord overflows int24 container from a valid tick + // 16384 ticks represents a >5x price change with ticks of 1 bips + require(tickSpacing > 0 && tickSpacing < 16384); + require(feeAmountTickSpacing[fee] == 0); + + feeAmountTickSpacing[fee] = tickSpacing; + emit FeeAmountEnabled(fee, tickSpacing); + } +} diff --git a/lib/v3-core/contracts/UniswapV3Pool.sol b/lib/v3-core/contracts/UniswapV3Pool.sol new file mode 100644 index 0000000..9e09821 --- /dev/null +++ b/lib/v3-core/contracts/UniswapV3Pool.sol @@ -0,0 +1,869 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.7.6; + +import './interfaces/IUniswapV3Pool.sol'; + +import './NoDelegateCall.sol'; + +import './libraries/LowGasSafeMath.sol'; +import './libraries/SafeCast.sol'; +import './libraries/Tick.sol'; +import './libraries/TickBitmap.sol'; +import './libraries/Position.sol'; +import './libraries/Oracle.sol'; + +import './libraries/FullMath.sol'; +import './libraries/FixedPoint128.sol'; +import './libraries/TransferHelper.sol'; +import './libraries/TickMath.sol'; +import './libraries/LiquidityMath.sol'; +import './libraries/SqrtPriceMath.sol'; +import './libraries/SwapMath.sol'; + +import './interfaces/IUniswapV3PoolDeployer.sol'; +import './interfaces/IUniswapV3Factory.sol'; +import './interfaces/IERC20Minimal.sol'; +import './interfaces/callback/IUniswapV3MintCallback.sol'; +import './interfaces/callback/IUniswapV3SwapCallback.sol'; +import './interfaces/callback/IUniswapV3FlashCallback.sol'; + +contract UniswapV3Pool is IUniswapV3Pool, NoDelegateCall { + using LowGasSafeMath for uint256; + using LowGasSafeMath for int256; + using SafeCast for uint256; + using SafeCast for int256; + using Tick for mapping(int24 => Tick.Info); + using TickBitmap for mapping(int16 => uint256); + using Position for mapping(bytes32 => Position.Info); + using Position for Position.Info; + using Oracle for Oracle.Observation[65535]; + + /// @inheritdoc IUniswapV3PoolImmutables + address public immutable override factory; + /// @inheritdoc IUniswapV3PoolImmutables + address public immutable override token0; + /// @inheritdoc IUniswapV3PoolImmutables + address public immutable override token1; + /// @inheritdoc IUniswapV3PoolImmutables + uint24 public immutable override fee; + + /// @inheritdoc IUniswapV3PoolImmutables + int24 public immutable override tickSpacing; + + /// @inheritdoc IUniswapV3PoolImmutables + uint128 public immutable override maxLiquidityPerTick; + + struct Slot0 { + // the current price + uint160 sqrtPriceX96; + // the current tick + int24 tick; + // the most-recently updated index of the observations array + uint16 observationIndex; + // the current maximum number of observations that are being stored + uint16 observationCardinality; + // the next maximum number of observations to store, triggered in observations.write + uint16 observationCardinalityNext; + // the current protocol fee as a percentage of the swap fee taken on withdrawal + // represented as an integer denominator (1/x)% + uint8 feeProtocol; + // whether the pool is locked + bool unlocked; + } + /// @inheritdoc IUniswapV3PoolState + Slot0 public override slot0; + + /// @inheritdoc IUniswapV3PoolState + uint256 public override feeGrowthGlobal0X128; + /// @inheritdoc IUniswapV3PoolState + uint256 public override feeGrowthGlobal1X128; + + // accumulated protocol fees in token0/token1 units + struct ProtocolFees { + uint128 token0; + uint128 token1; + } + /// @inheritdoc IUniswapV3PoolState + ProtocolFees public override protocolFees; + + /// @inheritdoc IUniswapV3PoolState + uint128 public override liquidity; + + /// @inheritdoc IUniswapV3PoolState + mapping(int24 => Tick.Info) public override ticks; + /// @inheritdoc IUniswapV3PoolState + mapping(int16 => uint256) public override tickBitmap; + /// @inheritdoc IUniswapV3PoolState + mapping(bytes32 => Position.Info) public override positions; + /// @inheritdoc IUniswapV3PoolState + Oracle.Observation[65535] public override observations; + + /// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance + /// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because + /// we use balance checks to determine the payment status of interactions such as mint, swap and flash. + modifier lock() { + require(slot0.unlocked, 'LOK'); + slot0.unlocked = false; + _; + slot0.unlocked = true; + } + + /// @dev Prevents calling a function from anyone except the address returned by IUniswapV3Factory#owner() + modifier onlyFactoryOwner() { + require(msg.sender == IUniswapV3Factory(factory).owner()); + _; + } + + constructor() { + int24 _tickSpacing; + (factory, token0, token1, fee, _tickSpacing) = IUniswapV3PoolDeployer(msg.sender).parameters(); + tickSpacing = _tickSpacing; + + maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(_tickSpacing); + } + + /// @dev Common checks for valid tick inputs. + function checkTicks(int24 tickLower, int24 tickUpper) private pure { + require(tickLower < tickUpper, 'TLU'); + require(tickLower >= TickMath.MIN_TICK, 'TLM'); + require(tickUpper <= TickMath.MAX_TICK, 'TUM'); + } + + /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests. + function _blockTimestamp() internal view virtual returns (uint32) { + return uint32(block.timestamp); // truncation is desired + } + + /// @dev Get the pool's balance of token0 + /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize + /// check + function balance0() private view returns (uint256) { + (bool success, bytes memory data) = + token0.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this))); + require(success && data.length >= 32); + return abi.decode(data, (uint256)); + } + + /// @dev Get the pool's balance of token1 + /// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize + /// check + function balance1() private view returns (uint256) { + (bool success, bytes memory data) = + token1.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this))); + require(success && data.length >= 32); + return abi.decode(data, (uint256)); + } + + /// @inheritdoc IUniswapV3PoolDerivedState + function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) + external + view + override + noDelegateCall + returns ( + int56 tickCumulativeInside, + uint160 secondsPerLiquidityInsideX128, + uint32 secondsInside + ) + { + checkTicks(tickLower, tickUpper); + + int56 tickCumulativeLower; + int56 tickCumulativeUpper; + uint160 secondsPerLiquidityOutsideLowerX128; + uint160 secondsPerLiquidityOutsideUpperX128; + uint32 secondsOutsideLower; + uint32 secondsOutsideUpper; + + { + Tick.Info storage lower = ticks[tickLower]; + Tick.Info storage upper = ticks[tickUpper]; + bool initializedLower; + (tickCumulativeLower, secondsPerLiquidityOutsideLowerX128, secondsOutsideLower, initializedLower) = ( + lower.tickCumulativeOutside, + lower.secondsPerLiquidityOutsideX128, + lower.secondsOutside, + lower.initialized + ); + require(initializedLower); + + bool initializedUpper; + (tickCumulativeUpper, secondsPerLiquidityOutsideUpperX128, secondsOutsideUpper, initializedUpper) = ( + upper.tickCumulativeOutside, + upper.secondsPerLiquidityOutsideX128, + upper.secondsOutside, + upper.initialized + ); + require(initializedUpper); + } + + Slot0 memory _slot0 = slot0; + + if (_slot0.tick < tickLower) { + return ( + tickCumulativeLower - tickCumulativeUpper, + secondsPerLiquidityOutsideLowerX128 - secondsPerLiquidityOutsideUpperX128, + secondsOutsideLower - secondsOutsideUpper + ); + } else if (_slot0.tick < tickUpper) { + uint32 time = _blockTimestamp(); + (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = + observations.observeSingle( + time, + 0, + _slot0.tick, + _slot0.observationIndex, + liquidity, + _slot0.observationCardinality + ); + return ( + tickCumulative - tickCumulativeLower - tickCumulativeUpper, + secondsPerLiquidityCumulativeX128 - + secondsPerLiquidityOutsideLowerX128 - + secondsPerLiquidityOutsideUpperX128, + time - secondsOutsideLower - secondsOutsideUpper + ); + } else { + return ( + tickCumulativeUpper - tickCumulativeLower, + secondsPerLiquidityOutsideUpperX128 - secondsPerLiquidityOutsideLowerX128, + secondsOutsideUpper - secondsOutsideLower + ); + } + } + + /// @inheritdoc IUniswapV3PoolDerivedState + function observe(uint32[] calldata secondsAgos) + external + view + override + noDelegateCall + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) + { + return + observations.observe( + _blockTimestamp(), + secondsAgos, + slot0.tick, + slot0.observationIndex, + liquidity, + slot0.observationCardinality + ); + } + + /// @inheritdoc IUniswapV3PoolActions + function increaseObservationCardinalityNext(uint16 observationCardinalityNext) + external + override + lock + noDelegateCall + { + uint16 observationCardinalityNextOld = slot0.observationCardinalityNext; // for the event + uint16 observationCardinalityNextNew = + observations.grow(observationCardinalityNextOld, observationCardinalityNext); + slot0.observationCardinalityNext = observationCardinalityNextNew; + if (observationCardinalityNextOld != observationCardinalityNextNew) + emit IncreaseObservationCardinalityNext(observationCardinalityNextOld, observationCardinalityNextNew); + } + + /// @inheritdoc IUniswapV3PoolActions + /// @dev not locked because it initializes unlocked + function initialize(uint160 sqrtPriceX96) external override { + require(slot0.sqrtPriceX96 == 0, 'AI'); + + int24 tick = TickMath.getTickAtSqrtRatio(sqrtPriceX96); + + (uint16 cardinality, uint16 cardinalityNext) = observations.initialize(_blockTimestamp()); + + slot0 = Slot0({ + sqrtPriceX96: sqrtPriceX96, + tick: tick, + observationIndex: 0, + observationCardinality: cardinality, + observationCardinalityNext: cardinalityNext, + feeProtocol: 0, + unlocked: true + }); + + emit Initialize(sqrtPriceX96, tick); + } + + struct ModifyPositionParams { + // the address that owns the position + address owner; + // the lower and upper tick of the position + int24 tickLower; + int24 tickUpper; + // any change in liquidity + int128 liquidityDelta; + } + + /// @dev Effect some changes to a position + /// @param params the position details and the change to the position's liquidity to effect + /// @return position a storage pointer referencing the position with the given owner and tick range + /// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient + /// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient + function _modifyPosition(ModifyPositionParams memory params) + private + noDelegateCall + returns ( + Position.Info storage position, + int256 amount0, + int256 amount1 + ) + { + checkTicks(params.tickLower, params.tickUpper); + + Slot0 memory _slot0 = slot0; // SLOAD for gas optimization + + position = _updatePosition( + params.owner, + params.tickLower, + params.tickUpper, + params.liquidityDelta, + _slot0.tick + ); + + if (params.liquidityDelta != 0) { + if (_slot0.tick < params.tickLower) { + // current tick is below the passed range; liquidity can only become in range by crossing from left to + // right, when we'll need _more_ token0 (it's becoming more valuable) so user must provide it + amount0 = SqrtPriceMath.getAmount0Delta( + TickMath.getSqrtRatioAtTick(params.tickLower), + TickMath.getSqrtRatioAtTick(params.tickUpper), + params.liquidityDelta + ); + } else if (_slot0.tick < params.tickUpper) { + // current tick is inside the passed range + uint128 liquidityBefore = liquidity; // SLOAD for gas optimization + + // write an oracle entry + (slot0.observationIndex, slot0.observationCardinality) = observations.write( + _slot0.observationIndex, + _blockTimestamp(), + _slot0.tick, + liquidityBefore, + _slot0.observationCardinality, + _slot0.observationCardinalityNext + ); + + amount0 = SqrtPriceMath.getAmount0Delta( + _slot0.sqrtPriceX96, + TickMath.getSqrtRatioAtTick(params.tickUpper), + params.liquidityDelta + ); + amount1 = SqrtPriceMath.getAmount1Delta( + TickMath.getSqrtRatioAtTick(params.tickLower), + _slot0.sqrtPriceX96, + params.liquidityDelta + ); + + liquidity = LiquidityMath.addDelta(liquidityBefore, params.liquidityDelta); + } else { + // current tick is above the passed range; liquidity can only become in range by crossing from right to + // left, when we'll need _more_ token1 (it's becoming more valuable) so user must provide it + amount1 = SqrtPriceMath.getAmount1Delta( + TickMath.getSqrtRatioAtTick(params.tickLower), + TickMath.getSqrtRatioAtTick(params.tickUpper), + params.liquidityDelta + ); + } + } + } + + /// @dev Gets and updates a position with the given liquidity delta + /// @param owner the owner of the position + /// @param tickLower the lower tick of the position's tick range + /// @param tickUpper the upper tick of the position's tick range + /// @param tick the current tick, passed to avoid sloads + function _updatePosition( + address owner, + int24 tickLower, + int24 tickUpper, + int128 liquidityDelta, + int24 tick + ) private returns (Position.Info storage position) { + position = positions.get(owner, tickLower, tickUpper); + + uint256 _feeGrowthGlobal0X128 = feeGrowthGlobal0X128; // SLOAD for gas optimization + uint256 _feeGrowthGlobal1X128 = feeGrowthGlobal1X128; // SLOAD for gas optimization + + // if we need to update the ticks, do it + bool flippedLower; + bool flippedUpper; + if (liquidityDelta != 0) { + uint32 time = _blockTimestamp(); + (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) = + observations.observeSingle( + time, + 0, + slot0.tick, + slot0.observationIndex, + liquidity, + slot0.observationCardinality + ); + + flippedLower = ticks.update( + tickLower, + tick, + liquidityDelta, + _feeGrowthGlobal0X128, + _feeGrowthGlobal1X128, + secondsPerLiquidityCumulativeX128, + tickCumulative, + time, + false, + maxLiquidityPerTick + ); + flippedUpper = ticks.update( + tickUpper, + tick, + liquidityDelta, + _feeGrowthGlobal0X128, + _feeGrowthGlobal1X128, + secondsPerLiquidityCumulativeX128, + tickCumulative, + time, + true, + maxLiquidityPerTick + ); + + if (flippedLower) { + tickBitmap.flipTick(tickLower, tickSpacing); + } + if (flippedUpper) { + tickBitmap.flipTick(tickUpper, tickSpacing); + } + } + + (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = + ticks.getFeeGrowthInside(tickLower, tickUpper, tick, _feeGrowthGlobal0X128, _feeGrowthGlobal1X128); + + position.update(liquidityDelta, feeGrowthInside0X128, feeGrowthInside1X128); + + // clear any tick data that is no longer needed + if (liquidityDelta < 0) { + if (flippedLower) { + ticks.clear(tickLower); + } + if (flippedUpper) { + ticks.clear(tickUpper); + } + } + } + + /// @inheritdoc IUniswapV3PoolActions + /// @dev noDelegateCall is applied indirectly via _modifyPosition + function mint( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount, + bytes calldata data + ) external override lock returns (uint256 amount0, uint256 amount1) { + require(amount > 0); + (, int256 amount0Int, int256 amount1Int) = + _modifyPosition( + ModifyPositionParams({ + owner: recipient, + tickLower: tickLower, + tickUpper: tickUpper, + liquidityDelta: int256(amount).toInt128() + }) + ); + + amount0 = uint256(amount0Int); + amount1 = uint256(amount1Int); + + uint256 balance0Before; + uint256 balance1Before; + if (amount0 > 0) balance0Before = balance0(); + if (amount1 > 0) balance1Before = balance1(); + IUniswapV3MintCallback(msg.sender).uniswapV3MintCallback(amount0, amount1, data); + if (amount0 > 0) require(balance0Before.add(amount0) <= balance0(), 'M0'); + if (amount1 > 0) require(balance1Before.add(amount1) <= balance1(), 'M1'); + + emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1); + } + + /// @inheritdoc IUniswapV3PoolActions + function collect( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount0Requested, + uint128 amount1Requested + ) external override lock returns (uint128 amount0, uint128 amount1) { + // we don't need to checkTicks here, because invalid positions will never have non-zero tokensOwed{0,1} + Position.Info storage position = positions.get(msg.sender, tickLower, tickUpper); + + amount0 = amount0Requested > position.tokensOwed0 ? position.tokensOwed0 : amount0Requested; + amount1 = amount1Requested > position.tokensOwed1 ? position.tokensOwed1 : amount1Requested; + + if (amount0 > 0) { + position.tokensOwed0 -= amount0; + TransferHelper.safeTransfer(token0, recipient, amount0); + } + if (amount1 > 0) { + position.tokensOwed1 -= amount1; + TransferHelper.safeTransfer(token1, recipient, amount1); + } + + emit Collect(msg.sender, recipient, tickLower, tickUpper, amount0, amount1); + } + + /// @inheritdoc IUniswapV3PoolActions + /// @dev noDelegateCall is applied indirectly via _modifyPosition + function burn( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external override lock returns (uint256 amount0, uint256 amount1) { + (Position.Info storage position, int256 amount0Int, int256 amount1Int) = + _modifyPosition( + ModifyPositionParams({ + owner: msg.sender, + tickLower: tickLower, + tickUpper: tickUpper, + liquidityDelta: -int256(amount).toInt128() + }) + ); + + amount0 = uint256(-amount0Int); + amount1 = uint256(-amount1Int); + + if (amount0 > 0 || amount1 > 0) { + (position.tokensOwed0, position.tokensOwed1) = ( + position.tokensOwed0 + uint128(amount0), + position.tokensOwed1 + uint128(amount1) + ); + } + + emit Burn(msg.sender, tickLower, tickUpper, amount, amount0, amount1); + } + + struct SwapCache { + // the protocol fee for the input token + uint8 feeProtocol; + // liquidity at the beginning of the swap + uint128 liquidityStart; + // the timestamp of the current block + uint32 blockTimestamp; + // the current value of the tick accumulator, computed only if we cross an initialized tick + int56 tickCumulative; + // the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick + uint160 secondsPerLiquidityCumulativeX128; + // whether we've computed and cached the above two accumulators + bool computedLatestObservation; + } + + // the top level state of the swap, the results of which are recorded in storage at the end + struct SwapState { + // the amount remaining to be swapped in/out of the input/output asset + int256 amountSpecifiedRemaining; + // the amount already swapped out/in of the output/input asset + int256 amountCalculated; + // current sqrt(price) + uint160 sqrtPriceX96; + // the tick associated with the current price + int24 tick; + // the global fee growth of the input token + uint256 feeGrowthGlobalX128; + // amount of input token paid as protocol fee + uint128 protocolFee; + // the current liquidity in range + uint128 liquidity; + } + + struct StepComputations { + // the price at the beginning of the step + uint160 sqrtPriceStartX96; + // the next tick to swap to from the current tick in the swap direction + int24 tickNext; + // whether tickNext is initialized or not + bool initialized; + // sqrt(price) for the next tick (1/0) + uint160 sqrtPriceNextX96; + // how much is being swapped in in this step + uint256 amountIn; + // how much is being swapped out + uint256 amountOut; + // how much fee is being paid in + uint256 feeAmount; + } + + /// @inheritdoc IUniswapV3PoolActions + function swap( + address recipient, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96, + bytes calldata data + ) external override noDelegateCall returns (int256 amount0, int256 amount1) { + require(amountSpecified != 0, 'AS'); + + Slot0 memory slot0Start = slot0; + + require(slot0Start.unlocked, 'LOK'); + require( + zeroForOne + ? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO + : sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, + 'SPL' + ); + + slot0.unlocked = false; + + SwapCache memory cache = + SwapCache({ + liquidityStart: liquidity, + blockTimestamp: _blockTimestamp(), + feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4), + secondsPerLiquidityCumulativeX128: 0, + tickCumulative: 0, + computedLatestObservation: false + }); + + bool exactInput = amountSpecified > 0; + + SwapState memory state = + SwapState({ + amountSpecifiedRemaining: amountSpecified, + amountCalculated: 0, + sqrtPriceX96: slot0Start.sqrtPriceX96, + tick: slot0Start.tick, + feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128, + protocolFee: 0, + liquidity: cache.liquidityStart + }); + + // continue swapping as long as we haven't used the entire input/output and haven't reached the price limit + while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) { + StepComputations memory step; + + step.sqrtPriceStartX96 = state.sqrtPriceX96; + + (step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord( + state.tick, + tickSpacing, + zeroForOne + ); + + // ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds + if (step.tickNext < TickMath.MIN_TICK) { + step.tickNext = TickMath.MIN_TICK; + } else if (step.tickNext > TickMath.MAX_TICK) { + step.tickNext = TickMath.MAX_TICK; + } + + // get the price for the next tick + step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); + + // compute values to swap to the target tick, price limit, or point where input/output amount is exhausted + (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep( + state.sqrtPriceX96, + (zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96) + ? sqrtPriceLimitX96 + : step.sqrtPriceNextX96, + state.liquidity, + state.amountSpecifiedRemaining, + fee + ); + + if (exactInput) { + state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); + state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256()); + } else { + state.amountSpecifiedRemaining += step.amountOut.toInt256(); + state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256()); + } + + // if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee + if (cache.feeProtocol > 0) { + uint256 delta = step.feeAmount / cache.feeProtocol; + step.feeAmount -= delta; + state.protocolFee += uint128(delta); + } + + // update global fee tracker + if (state.liquidity > 0) + state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity); + + // shift tick if we reached the next price + if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { + // if the tick is initialized, run the tick transition + if (step.initialized) { + // check for the placeholder value, which we replace with the actual value the first time the swap + // crosses an initialized tick + if (!cache.computedLatestObservation) { + (cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle( + cache.blockTimestamp, + 0, + slot0Start.tick, + slot0Start.observationIndex, + cache.liquidityStart, + slot0Start.observationCardinality + ); + cache.computedLatestObservation = true; + } + int128 liquidityNet = + ticks.cross( + step.tickNext, + (zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128), + (zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128), + cache.secondsPerLiquidityCumulativeX128, + cache.tickCumulative, + cache.blockTimestamp + ); + // if we're moving leftward, we interpret liquidityNet as the opposite sign + // safe because liquidityNet cannot be type(int128).min + if (zeroForOne) liquidityNet = -liquidityNet; + + state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet); + } + + state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; + } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { + // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved + state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); + } + } + + // update tick and write an oracle entry if the tick change + if (state.tick != slot0Start.tick) { + (uint16 observationIndex, uint16 observationCardinality) = + observations.write( + slot0Start.observationIndex, + cache.blockTimestamp, + slot0Start.tick, + cache.liquidityStart, + slot0Start.observationCardinality, + slot0Start.observationCardinalityNext + ); + (slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = ( + state.sqrtPriceX96, + state.tick, + observationIndex, + observationCardinality + ); + } else { + // otherwise just update the price + slot0.sqrtPriceX96 = state.sqrtPriceX96; + } + + // update liquidity if it changed + if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity; + + // update fee growth global and, if necessary, protocol fees + // overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees + if (zeroForOne) { + feeGrowthGlobal0X128 = state.feeGrowthGlobalX128; + if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee; + } else { + feeGrowthGlobal1X128 = state.feeGrowthGlobalX128; + if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee; + } + + (amount0, amount1) = zeroForOne == exactInput + ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated) + : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining); + + // do the transfers and collect payment + if (zeroForOne) { + if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1)); + + uint256 balance0Before = balance0(); + IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); + require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA'); + } else { + if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0)); + + uint256 balance1Before = balance1(); + IUniswapV3SwapCallback(msg.sender).uniswapV3SwapCallback(amount0, amount1, data); + require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA'); + } + + emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick); + slot0.unlocked = true; + } + + /// @inheritdoc IUniswapV3PoolActions + function flash( + address recipient, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external override lock noDelegateCall { + uint128 _liquidity = liquidity; + require(_liquidity > 0, 'L'); + + uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6); + uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6); + uint256 balance0Before = balance0(); + uint256 balance1Before = balance1(); + + if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0); + if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1); + + IUniswapV3FlashCallback(msg.sender).uniswapV3FlashCallback(fee0, fee1, data); + + uint256 balance0After = balance0(); + uint256 balance1After = balance1(); + + require(balance0Before.add(fee0) <= balance0After, 'F0'); + require(balance1Before.add(fee1) <= balance1After, 'F1'); + + // sub is safe because we know balanceAfter is gt balanceBefore by at least fee + uint256 paid0 = balance0After - balance0Before; + uint256 paid1 = balance1After - balance1Before; + + if (paid0 > 0) { + uint8 feeProtocol0 = slot0.feeProtocol % 16; + uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0; + if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0); + feeGrowthGlobal0X128 += FullMath.mulDiv(paid0 - fees0, FixedPoint128.Q128, _liquidity); + } + if (paid1 > 0) { + uint8 feeProtocol1 = slot0.feeProtocol >> 4; + uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1; + if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1); + feeGrowthGlobal1X128 += FullMath.mulDiv(paid1 - fees1, FixedPoint128.Q128, _liquidity); + } + + emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1); + } + + /// @inheritdoc IUniswapV3PoolOwnerActions + function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner { + require( + (feeProtocol0 == 0 || (feeProtocol0 >= 4 && feeProtocol0 <= 10)) && + (feeProtocol1 == 0 || (feeProtocol1 >= 4 && feeProtocol1 <= 10)) + ); + uint8 feeProtocolOld = slot0.feeProtocol; + slot0.feeProtocol = feeProtocol0 + (feeProtocol1 << 4); + emit SetFeeProtocol(feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1); + } + + /// @inheritdoc IUniswapV3PoolOwnerActions + function collectProtocol( + address recipient, + uint128 amount0Requested, + uint128 amount1Requested + ) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) { + amount0 = amount0Requested > protocolFees.token0 ? protocolFees.token0 : amount0Requested; + amount1 = amount1Requested > protocolFees.token1 ? protocolFees.token1 : amount1Requested; + + if (amount0 > 0) { + if (amount0 == protocolFees.token0) amount0--; // ensure that the slot is not cleared, for gas savings + protocolFees.token0 -= amount0; + TransferHelper.safeTransfer(token0, recipient, amount0); + } + if (amount1 > 0) { + if (amount1 == protocolFees.token1) amount1--; // ensure that the slot is not cleared, for gas savings + protocolFees.token1 -= amount1; + TransferHelper.safeTransfer(token1, recipient, amount1); + } + + emit CollectProtocol(msg.sender, recipient, amount0, amount1); + } +} diff --git a/lib/v3-core/contracts/UniswapV3PoolDeployer.sol b/lib/v3-core/contracts/UniswapV3PoolDeployer.sol new file mode 100644 index 0000000..02bfd53 --- /dev/null +++ b/lib/v3-core/contracts/UniswapV3PoolDeployer.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity =0.7.6; + +import './interfaces/IUniswapV3PoolDeployer.sol'; + +import './UniswapV3Pool.sol'; + +contract UniswapV3PoolDeployer is IUniswapV3PoolDeployer { + struct Parameters { + address factory; + address token0; + address token1; + uint24 fee; + int24 tickSpacing; + } + + /// @inheritdoc IUniswapV3PoolDeployer + Parameters public override parameters; + + /// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then + /// clearing it after deploying the pool. + /// @param factory The contract address of the Uniswap V3 factory + /// @param token0 The first token of the pool by address sort order + /// @param token1 The second token of the pool by address sort order + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @param tickSpacing The spacing between usable ticks + function deploy( + address factory, + address token0, + address token1, + uint24 fee, + int24 tickSpacing + ) internal returns (address pool) { + parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing}); + pool = address(new UniswapV3Pool{salt: keccak256(abi.encode(token0, token1, fee))}()); + delete parameters; + } +} diff --git a/lib/v3-core/contracts/interfaces/IERC20Minimal.sol b/lib/v3-core/contracts/interfaces/IERC20Minimal.sol new file mode 100644 index 0000000..c303265 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/IERC20Minimal.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Minimal ERC20 interface for Uniswap +/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3 +interface IERC20Minimal { + /// @notice Returns the balance of a token + /// @param account The account for which to look up the number of tokens it has, i.e. its balance + /// @return The number of tokens held by the account + function balanceOf(address account) external view returns (uint256); + + /// @notice Transfers the amount of token from the `msg.sender` to the recipient + /// @param recipient The account that will receive the amount transferred + /// @param amount The number of tokens to send from the sender to the recipient + /// @return Returns true for a successful transfer, false for an unsuccessful transfer + function transfer(address recipient, uint256 amount) external returns (bool); + + /// @notice Returns the current allowance given to a spender by an owner + /// @param owner The account of the token owner + /// @param spender The account of the token spender + /// @return The current allowance granted by `owner` to `spender` + function allowance(address owner, address spender) external view returns (uint256); + + /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount` + /// @param spender The account which will be allowed to spend a given amount of the owners tokens + /// @param amount The amount of tokens allowed to be used by `spender` + /// @return Returns true for a successful approval, false for unsuccessful + function approve(address spender, uint256 amount) external returns (bool); + + /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender` + /// @param sender The account from which the transfer will be initiated + /// @param recipient The recipient of the transfer + /// @param amount The amount of the transfer + /// @return Returns true for a successful transfer, false for unsuccessful + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); + + /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`. + /// @param from The account from which the tokens were sent, i.e. the balance decreased + /// @param to The account to which the tokens were sent, i.e. the balance increased + /// @param value The amount of tokens that were transferred + event Transfer(address indexed from, address indexed to, uint256 value); + + /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes. + /// @param owner The account that approved spending of its tokens + /// @param spender The account for which the spending allowance was modified + /// @param value The new allowance from the owner to the spender + event Approval(address indexed owner, address indexed spender, uint256 value); +} diff --git a/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol b/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol new file mode 100644 index 0000000..540cfdc --- /dev/null +++ b/lib/v3-core/contracts/interfaces/IUniswapV3Factory.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title The interface for the Uniswap V3 Factory +/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees +interface IUniswapV3Factory { + /// @notice Emitted when the owner of the factory is changed + /// @param oldOwner The owner before the owner was changed + /// @param newOwner The owner after the owner was changed + event OwnerChanged(address indexed oldOwner, address indexed newOwner); + + /// @notice Emitted when a pool is created + /// @param token0 The first token of the pool by address sort order + /// @param token1 The second token of the pool by address sort order + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks + /// @param pool The address of the created pool + event PoolCreated( + address indexed token0, + address indexed token1, + uint24 indexed fee, + int24 tickSpacing, + address pool + ); + + /// @notice Emitted when a new fee amount is enabled for pool creation via the factory + /// @param fee The enabled fee, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee + event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); + + /// @notice Returns the current owner of the factory + /// @dev Can be changed by the current owner via setOwner + /// @return The address of the factory owner + function owner() external view returns (address); + + /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled + /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context + /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee + /// @return The tick spacing + function feeAmountTickSpacing(uint24 fee) external view returns (int24); + + /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist + /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order + /// @param tokenA The contract address of either token0 or token1 + /// @param tokenB The contract address of the other token + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @return pool The pool address + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) external view returns (address pool); + + /// @notice Creates a pool for the given two tokens and fee + /// @param tokenA One of the two tokens in the desired pool + /// @param tokenB The other of the two tokens in the desired pool + /// @param fee The desired fee for the pool + /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved + /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments + /// are invalid. + /// @return pool The address of the newly created pool + function createPool( + address tokenA, + address tokenB, + uint24 fee + ) external returns (address pool); + + /// @notice Updates the owner of the factory + /// @dev Must be called by the current owner + /// @param _owner The new owner of the factory + function setOwner(address _owner) external; + + /// @notice Enables a fee amount with the given tickSpacing + /// @dev Fee amounts may never be removed once enabled + /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) + /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount + function enableFeeAmount(uint24 fee, int24 tickSpacing) external; +} diff --git a/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol b/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol new file mode 100644 index 0000000..56df050 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/IUniswapV3Pool.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import './pool/IUniswapV3PoolImmutables.sol'; +import './pool/IUniswapV3PoolState.sol'; +import './pool/IUniswapV3PoolDerivedState.sol'; +import './pool/IUniswapV3PoolActions.sol'; +import './pool/IUniswapV3PoolOwnerActions.sol'; +import './pool/IUniswapV3PoolEvents.sol'; + +/// @title The interface for a Uniswap V3 Pool +/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform +/// to the ERC20 specification +/// @dev The pool interface is broken up into many smaller pieces +interface IUniswapV3Pool is + IUniswapV3PoolImmutables, + IUniswapV3PoolState, + IUniswapV3PoolDerivedState, + IUniswapV3PoolActions, + IUniswapV3PoolOwnerActions, + IUniswapV3PoolEvents +{ + +} diff --git a/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol b/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol new file mode 100644 index 0000000..72096c1 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title An interface for a contract that is capable of deploying Uniswap V3 Pools +/// @notice A contract that constructs a pool must implement this to pass arguments to the pool +/// @dev This is used to avoid having constructor arguments in the pool contract, which results in the init code hash +/// of the pool being constant allowing the CREATE2 address of the pool to be cheaply computed on-chain +interface IUniswapV3PoolDeployer { + /// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation. + /// @dev Called by the pool constructor to fetch the parameters of the pool + /// Returns factory The factory address + /// Returns token0 The first token of the pool by address sort order + /// Returns token1 The second token of the pool by address sort order + /// Returns fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// Returns tickSpacing The minimum number of ticks between initialized ticks + function parameters() + external + view + returns ( + address factory, + address token0, + address token1, + uint24 fee, + int24 tickSpacing + ); +} diff --git a/lib/v3-core/contracts/interfaces/LICENSE b/lib/v3-core/contracts/interfaces/LICENSE new file mode 100644 index 0000000..7f6aca7 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/LICENSE @@ -0,0 +1,445 @@ +This software is available under your choice of the GNU General Public +License, version 2 or later, or the Business Source License, as set +forth below. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + + +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: Uniswap Labs + +Licensed Work: Uniswap V3 Core + The Licensed Work is (c) 2021 Uniswap Labs + +Additional Use Grant: Any uses listed and defined at + v3-core-license-grants.uniswap.eth + +Change Date: The earlier of 2023-04-01 or a date specified at + v3-core-license-date.uniswap.eth + +Change License: GNU General Public License v2.0 or later + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark "Business Source License", +as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business +Source License" name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where "compatible" means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. + +----------------------------------------------------------------------------- + +Notice + +The Business Source License (this document, or the "License") is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. diff --git a/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol b/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol new file mode 100644 index 0000000..18e54c4 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Callback for IUniswapV3PoolActions#flash +/// @notice Any contract that calls IUniswapV3PoolActions#flash must implement this interface +interface IUniswapV3FlashCallback { + /// @notice Called to `msg.sender` after transferring to the recipient from IUniswapV3Pool#flash. + /// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts. + /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. + /// @param fee0 The fee amount in token0 due to the pool by the end of the flash + /// @param fee1 The fee amount in token1 due to the pool by the end of the flash + /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#flash call + function uniswapV3FlashCallback( + uint256 fee0, + uint256 fee1, + bytes calldata data + ) external; +} diff --git a/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol b/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol new file mode 100644 index 0000000..85447e8 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Callback for IUniswapV3PoolActions#mint +/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface +interface IUniswapV3MintCallback { + /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint. + /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity. + /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. + /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity + /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity + /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external; +} diff --git a/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol b/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol new file mode 100644 index 0000000..9f183b2 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Callback for IUniswapV3PoolActions#swap +/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface +interface IUniswapV3SwapCallback { + /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. + /// @dev In the implementation you must pay the pool tokens owed for the swap. + /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. + /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. + /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by + /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. + /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by + /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. + /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external; +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol new file mode 100644 index 0000000..44fb61c --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Permissionless pool actions +/// @notice Contains pool methods that can be called by anyone +interface IUniswapV3PoolActions { + /// @notice Sets the initial price for the pool + /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value + /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 + function initialize(uint160 sqrtPriceX96) external; + + /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position + /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback + /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends + /// on tickLower, tickUpper, the amount of liquidity, and the current price. + /// @param recipient The address for which the liquidity will be created + /// @param tickLower The lower tick of the position in which to add liquidity + /// @param tickUpper The upper tick of the position in which to add liquidity + /// @param amount The amount of liquidity to mint + /// @param data Any data that should be passed through to the callback + /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback + /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback + function mint( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount, + bytes calldata data + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Collects tokens owed to a position + /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. + /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or + /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the + /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. + /// @param recipient The address which should receive the fees collected + /// @param tickLower The lower tick of the position for which to collect fees + /// @param tickUpper The upper tick of the position for which to collect fees + /// @param amount0Requested How much token0 should be withdrawn from the fees owed + /// @param amount1Requested How much token1 should be withdrawn from the fees owed + /// @return amount0 The amount of fees collected in token0 + /// @return amount1 The amount of fees collected in token1 + function collect( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); + + /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position + /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 + /// @dev Fees must be collected separately via a call to #collect + /// @param tickLower The lower tick of the position for which to burn liquidity + /// @param tickUpper The upper tick of the position for which to burn liquidity + /// @param amount How much liquidity to burn + /// @return amount0 The amount of token0 sent to the recipient + /// @return amount1 The amount of token1 sent to the recipient + function burn( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Swap token0 for token1, or token1 for token0 + /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback + /// @param recipient The address to receive the output of the swap + /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 + /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) + /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this + /// value after the swap. If one for zero, the price cannot be greater than this value after the swap + /// @param data Any data to be passed through to the callback + /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive + /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive + function swap( + address recipient, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96, + bytes calldata data + ) external returns (int256 amount0, int256 amount1); + + /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback + /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback + /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling + /// with 0 amount{0,1} and sending the donation amount(s) from the callback + /// @param recipient The address which will receive the token0 and token1 amounts + /// @param amount0 The amount of token0 to send + /// @param amount1 The amount of token1 to send + /// @param data Any data to be passed through to the callback + function flash( + address recipient, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external; + + /// @notice Increase the maximum number of price and liquidity observations that this pool will store + /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to + /// the input observationCardinalityNext. + /// @param observationCardinalityNext The desired minimum number of observations for the pool to store + function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol new file mode 100644 index 0000000..eda3a00 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that is not stored +/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the +/// blockchain. The functions here may have variable gas costs. +interface IUniswapV3PoolDerivedState { + /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp + /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing + /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, + /// you must call it with secondsAgos = [3600, 0]. + /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in + /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. + /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned + /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp + /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block + /// timestamp + function observe(uint32[] calldata secondsAgos) + external + view + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); + + /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range + /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. + /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first + /// snapshot is taken and the second snapshot is taken. + /// @param tickLower The lower tick of the range + /// @param tickUpper The upper tick of the range + /// @return tickCumulativeInside The snapshot of the tick accumulator for the range + /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range + /// @return secondsInside The snapshot of seconds per liquidity for the range + function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) + external + view + returns ( + int56 tickCumulativeInside, + uint160 secondsPerLiquidityInsideX128, + uint32 secondsInside + ); +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol new file mode 100644 index 0000000..9d915dd --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Events emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolEvents { + /// @notice Emitted exactly once by a pool when #initialize is first called on the pool + /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize + /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 + /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool + event Initialize(uint160 sqrtPriceX96, int24 tick); + + /// @notice Emitted when liquidity is minted for a given position + /// @param sender The address that minted the liquidity + /// @param owner The owner of the position and recipient of any minted liquidity + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity minted to the position range + /// @param amount0 How much token0 was required for the minted liquidity + /// @param amount1 How much token1 was required for the minted liquidity + event Mint( + address sender, + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted when fees are collected by the owner of a position + /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees + /// @param owner The owner of the position for which fees are collected + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount0 The amount of token0 fees collected + /// @param amount1 The amount of token1 fees collected + event Collect( + address indexed owner, + address recipient, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount0, + uint128 amount1 + ); + + /// @notice Emitted when a position's liquidity is removed + /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect + /// @param owner The owner of the position for which liquidity is removed + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity to remove + /// @param amount0 The amount of token0 withdrawn + /// @param amount1 The amount of token1 withdrawn + event Burn( + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted by the pool for any swaps between token0 and token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the output of the swap + /// @param amount0 The delta of the token0 balance of the pool + /// @param amount1 The delta of the token1 balance of the pool + /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 + /// @param liquidity The liquidity of the pool after the swap + /// @param tick The log base 1.0001 of price of the pool after the swap + event Swap( + address indexed sender, + address indexed recipient, + int256 amount0, + int256 amount1, + uint160 sqrtPriceX96, + uint128 liquidity, + int24 tick + ); + + /// @notice Emitted by the pool for any flashes of token0/token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the tokens from flash + /// @param amount0 The amount of token0 that was flashed + /// @param amount1 The amount of token1 that was flashed + /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee + /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee + event Flash( + address indexed sender, + address indexed recipient, + uint256 amount0, + uint256 amount1, + uint256 paid0, + uint256 paid1 + ); + + /// @notice Emitted by the pool for increases to the number of observations that can be stored + /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index + /// just before a mint/swap/burn. + /// @param observationCardinalityNextOld The previous value of the next observation cardinality + /// @param observationCardinalityNextNew The updated value of the next observation cardinality + event IncreaseObservationCardinalityNext( + uint16 observationCardinalityNextOld, + uint16 observationCardinalityNextNew + ); + + /// @notice Emitted when the protocol fee is changed by the pool + /// @param feeProtocol0Old The previous value of the token0 protocol fee + /// @param feeProtocol1Old The previous value of the token1 protocol fee + /// @param feeProtocol0New The updated value of the token0 protocol fee + /// @param feeProtocol1New The updated value of the token1 protocol fee + event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); + + /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner + /// @param sender The address that collects the protocol fees + /// @param recipient The address that receives the collected protocol fees + /// @param amount0 The amount of token0 protocol fees that is withdrawn + /// @param amount0 The amount of token1 protocol fees that is withdrawn + event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol new file mode 100644 index 0000000..c9beb15 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that never changes +/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values +interface IUniswapV3PoolImmutables { + /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface + /// @return The contract address + function factory() external view returns (address); + + /// @notice The first of the two tokens of the pool, sorted by address + /// @return The token contract address + function token0() external view returns (address); + + /// @notice The second of the two tokens of the pool, sorted by address + /// @return The token contract address + function token1() external view returns (address); + + /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 + /// @return The fee + function fee() external view returns (uint24); + + /// @notice The pool tick spacing + /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive + /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... + /// This value is an int24 to avoid casting even though it is always positive. + /// @return The tick spacing + function tickSpacing() external view returns (int24); + + /// @notice The maximum amount of position liquidity that can use any tick in the range + /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and + /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool + /// @return The max amount of liquidity per tick + function maxLiquidityPerTick() external view returns (uint128); +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol new file mode 100644 index 0000000..2395ed3 --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Permissioned pool actions +/// @notice Contains pool methods that may only be called by the factory owner +interface IUniswapV3PoolOwnerActions { + /// @notice Set the denominator of the protocol's % share of the fees + /// @param feeProtocol0 new protocol fee for token0 of the pool + /// @param feeProtocol1 new protocol fee for token1 of the pool + function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; + + /// @notice Collect the protocol fee accrued to the pool + /// @param recipient The address to which collected protocol fees should be sent + /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 + /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 + /// @return amount0 The protocol fee collected in token0 + /// @return amount1 The protocol fee collected in token1 + function collectProtocol( + address recipient, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); +} diff --git a/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol new file mode 100644 index 0000000..620256c --- /dev/null +++ b/lib/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that can change +/// @notice These methods compose the pool's state, and can change with any frequency including multiple times +/// per transaction +interface IUniswapV3PoolState { + /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas + /// when accessed externally. + /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value + /// tick The current tick of the pool, i.e. according to the last tick transition that was run. + /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick + /// boundary. + /// observationIndex The index of the last oracle observation that was written, + /// observationCardinality The current maximum number of observations stored in the pool, + /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. + /// feeProtocol The protocol fee for both tokens of the pool. + /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 + /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. + /// unlocked Whether the pool is currently locked to reentrancy + function slot0() + external + view + returns ( + uint160 sqrtPriceX96, + int24 tick, + uint16 observationIndex, + uint16 observationCardinality, + uint16 observationCardinalityNext, + uint8 feeProtocol, + bool unlocked + ); + + /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal0X128() external view returns (uint256); + + /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal1X128() external view returns (uint256); + + /// @notice The amounts of token0 and token1 that are owed to the protocol + /// @dev Protocol fees will never exceed uint128 max in either token + function protocolFees() external view returns (uint128 token0, uint128 token1); + + /// @notice The currently in range liquidity available to the pool + /// @dev This value has no relationship to the total liquidity across all ticks + function liquidity() external view returns (uint128); + + /// @notice Look up information about a specific tick in the pool + /// @param tick The tick to look up + /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or + /// tick upper, + /// liquidityNet how much liquidity changes when the pool price crosses the tick, + /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, + /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, + /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick + /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, + /// secondsOutside the seconds spent on the other side of the tick from the current tick, + /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. + /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. + /// In addition, these values are only relative and must be used only in comparison to previous snapshots for + /// a specific position. + function ticks(int24 tick) + external + view + returns ( + uint128 liquidityGross, + int128 liquidityNet, + uint256 feeGrowthOutside0X128, + uint256 feeGrowthOutside1X128, + int56 tickCumulativeOutside, + uint160 secondsPerLiquidityOutsideX128, + uint32 secondsOutside, + bool initialized + ); + + /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information + function tickBitmap(int16 wordPosition) external view returns (uint256); + + /// @notice Returns the information about a position by the position's key + /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper + /// @return _liquidity The amount of liquidity in the position, + /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, + /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, + /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, + /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke + function positions(bytes32 key) + external + view + returns ( + uint128 _liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ); + + /// @notice Returns data about a specific observation index + /// @param index The element of the observations array to fetch + /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time + /// ago, rather than at a specific index in the array. + /// @return blockTimestamp The timestamp of the observation, + /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, + /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, + /// Returns initialized whether the observation has been initialized and the values are safe to use + function observations(uint256 index) + external + view + returns ( + uint32 blockTimestamp, + int56 tickCumulative, + uint160 secondsPerLiquidityCumulativeX128, + bool initialized + ); +} diff --git a/lib/v3-core/contracts/libraries/BitMath.sol b/lib/v3-core/contracts/libraries/BitMath.sol new file mode 100644 index 0000000..3a7216c --- /dev/null +++ b/lib/v3-core/contracts/libraries/BitMath.sol @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title BitMath +/// @dev This library provides functionality for computing bit properties of an unsigned integer +library BitMath { + /// @notice Returns the index of the most significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) + /// @param x the value for which to compute the most significant bit, must be greater than 0 + /// @return r the index of the most significant bit + function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + if (x >= 0x100000000000000000000000000000000) { + x >>= 128; + r += 128; + } + if (x >= 0x10000000000000000) { + x >>= 64; + r += 64; + } + if (x >= 0x100000000) { + x >>= 32; + r += 32; + } + if (x >= 0x10000) { + x >>= 16; + r += 16; + } + if (x >= 0x100) { + x >>= 8; + r += 8; + } + if (x >= 0x10) { + x >>= 4; + r += 4; + } + if (x >= 0x4) { + x >>= 2; + r += 2; + } + if (x >= 0x2) r += 1; + } + + /// @notice Returns the index of the least significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) + /// @param x the value for which to compute the least significant bit, must be greater than 0 + /// @return r the index of the least significant bit + function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + r = 255; + if (x & type(uint128).max > 0) { + r -= 128; + } else { + x >>= 128; + } + if (x & type(uint64).max > 0) { + r -= 64; + } else { + x >>= 64; + } + if (x & type(uint32).max > 0) { + r -= 32; + } else { + x >>= 32; + } + if (x & type(uint16).max > 0) { + r -= 16; + } else { + x >>= 16; + } + if (x & type(uint8).max > 0) { + r -= 8; + } else { + x >>= 8; + } + if (x & 0xf > 0) { + r -= 4; + } else { + x >>= 4; + } + if (x & 0x3 > 0) { + r -= 2; + } else { + x >>= 2; + } + if (x & 0x1 > 0) r -= 1; + } +} diff --git a/lib/v3-core/contracts/libraries/FixedPoint128.sol b/lib/v3-core/contracts/libraries/FixedPoint128.sol new file mode 100644 index 0000000..6d6948b --- /dev/null +++ b/lib/v3-core/contracts/libraries/FixedPoint128.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.4.0; + +/// @title FixedPoint128 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +library FixedPoint128 { + uint256 internal constant Q128 = 0x100000000000000000000000000000000; +} diff --git a/lib/v3-core/contracts/libraries/FixedPoint96.sol b/lib/v3-core/contracts/libraries/FixedPoint96.sol new file mode 100644 index 0000000..63b42c2 --- /dev/null +++ b/lib/v3-core/contracts/libraries/FixedPoint96.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.4.0; + +/// @title FixedPoint96 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +/// @dev Used in SqrtPriceMath.sol +library FixedPoint96 { + uint8 internal constant RESOLUTION = 96; + uint256 internal constant Q96 = 0x1000000000000000000000000; +} diff --git a/lib/v3-core/contracts/libraries/FullMath.sol b/lib/v3-core/contracts/libraries/FullMath.sol new file mode 100644 index 0000000..9985059 --- /dev/null +++ b/lib/v3-core/contracts/libraries/FullMath.sol @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.0 <0.8.0; + +/// @title Contains 512-bit math functions +/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision +/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits +library FullMath { + /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv + function mulDiv( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + // 512-bit multiply [prod1 prod0] = a * b + // Compute the product mod 2**256 and mod 2**256 - 1 + // then use the Chinese Remainder Theorem to reconstruct + // the 512 bit result. The result is stored in two 256 + // variables such that product = prod1 * 2**256 + prod0 + uint256 prod0; // Least significant 256 bits of the product + uint256 prod1; // Most significant 256 bits of the product + assembly { + let mm := mulmod(a, b, not(0)) + prod0 := mul(a, b) + prod1 := sub(sub(mm, prod0), lt(mm, prod0)) + } + + // Handle non-overflow cases, 256 by 256 division + if (prod1 == 0) { + require(denominator > 0); + assembly { + result := div(prod0, denominator) + } + return result; + } + + // Make sure the result is less than 2**256. + // Also prevents denominator == 0 + require(denominator > prod1); + + /////////////////////////////////////////////// + // 512 by 256 division. + /////////////////////////////////////////////// + + // Make division exact by subtracting the remainder from [prod1 prod0] + // Compute remainder using mulmod + uint256 remainder; + assembly { + remainder := mulmod(a, b, denominator) + } + // Subtract 256 bit number from 512 bit number + assembly { + prod1 := sub(prod1, gt(remainder, prod0)) + prod0 := sub(prod0, remainder) + } + + // Factor powers of two out of denominator + // Compute largest power of two divisor of denominator. + // Always >= 1. + uint256 twos = -denominator & denominator; + // Divide denominator by power of two + assembly { + denominator := div(denominator, twos) + } + + // Divide [prod1 prod0] by the factors of two + assembly { + prod0 := div(prod0, twos) + } + // Shift in bits from prod1 into prod0. For this we need + // to flip `twos` such that it is 2**256 / twos. + // If twos is zero, then it becomes one + assembly { + twos := add(div(sub(0, twos), twos), 1) + } + prod0 |= prod1 * twos; + + // Invert denominator mod 2**256 + // Now that denominator is an odd number, it has an inverse + // modulo 2**256 such that denominator * inv = 1 mod 2**256. + // Compute the inverse by starting with a seed that is correct + // correct for four bits. That is, denominator * inv = 1 mod 2**4 + uint256 inv = (3 * denominator) ^ 2; + // Now use Newton-Raphson iteration to improve the precision. + // Thanks to Hensel's lifting lemma, this also works in modular + // arithmetic, doubling the correct bits in each step. + inv *= 2 - denominator * inv; // inverse mod 2**8 + inv *= 2 - denominator * inv; // inverse mod 2**16 + inv *= 2 - denominator * inv; // inverse mod 2**32 + inv *= 2 - denominator * inv; // inverse mod 2**64 + inv *= 2 - denominator * inv; // inverse mod 2**128 + inv *= 2 - denominator * inv; // inverse mod 2**256 + + // Because the division is now exact we can divide by multiplying + // with the modular inverse of denominator. This will give us the + // correct result modulo 2**256. Since the precoditions guarantee + // that the outcome is less than 2**256, this is the final result. + // We don't need to compute the high bits of the result and prod1 + // is no longer required. + result = prod0 * inv; + return result; + } + + /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + function mulDivRoundingUp( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + result = mulDiv(a, b, denominator); + if (mulmod(a, b, denominator) > 0) { + require(result < type(uint256).max); + result++; + } + } +} diff --git a/lib/v3-core/contracts/libraries/LICENSE b/lib/v3-core/contracts/libraries/LICENSE new file mode 100644 index 0000000..7f6aca7 --- /dev/null +++ b/lib/v3-core/contracts/libraries/LICENSE @@ -0,0 +1,445 @@ +This software is available under your choice of the GNU General Public +License, version 2 or later, or the Business Source License, as set +forth below. + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + + +Business Source License 1.1 + +License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. +"Business Source License" is a trademark of MariaDB Corporation Ab. + +----------------------------------------------------------------------------- + +Parameters + +Licensor: Uniswap Labs + +Licensed Work: Uniswap V3 Core + The Licensed Work is (c) 2021 Uniswap Labs + +Additional Use Grant: Any uses listed and defined at + v3-core-license-grants.uniswap.eth + +Change Date: The earlier of 2023-04-01 or a date specified at + v3-core-license-date.uniswap.eth + +Change License: GNU General Public License v2.0 or later + +----------------------------------------------------------------------------- + +Terms + +The Licensor hereby grants you the right to copy, modify, create derivative +works, redistribute, and make non-production use of the Licensed Work. The +Licensor may make an Additional Use Grant, above, permitting limited +production use. + +Effective on the Change Date, or the fourth anniversary of the first publicly +available distribution of a specific version of the Licensed Work under this +License, whichever comes first, the Licensor hereby grants you rights under +the terms of the Change License, and the rights granted in the paragraph +above terminate. + +If your use of the Licensed Work does not comply with the requirements +currently in effect as described in this License, you must purchase a +commercial license from the Licensor, its affiliated entities, or authorized +resellers, or you must refrain from using the Licensed Work. + +All copies of the original and modified Licensed Work, and derivative works +of the Licensed Work, are subject to this License. This License applies +separately for each version of the Licensed Work and the Change Date may vary +for each version of the Licensed Work released by Licensor. + +You must conspicuously display this License on each original or modified copy +of the Licensed Work. If you receive the Licensed Work in original or +modified form from a third party, the terms and conditions set forth in this +License apply to your use of that work. + +Any use of the Licensed Work in violation of this License will automatically +terminate your rights under this License for the current and all other +versions of the Licensed Work. + +This License does not grant you any right in any trademark or logo of +Licensor or its affiliates (provided that you may use a trademark or logo of +Licensor as expressly required by this License). + +TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +TITLE. + +MariaDB hereby grants you permission to use this License’s text to license +your works, and to refer to it using the trademark "Business Source License", +as long as you comply with the Covenants of Licensor below. + +----------------------------------------------------------------------------- + +Covenants of Licensor + +In consideration of the right to use this License’s text and the "Business +Source License" name and trademark, Licensor covenants to MariaDB, and to all +other recipients of the licensed work to be provided by Licensor: + +1. To specify as the Change License the GPL Version 2.0 or any later version, + or a license that is compatible with GPL Version 2.0 or a later version, + where "compatible" means that software provided under the Change License can + be included in a program with software provided under GPL Version 2.0 or a + later version. Licensor may specify additional Change Licenses without + limitation. + +2. To either: (a) specify an additional grant of rights to use that does not + impose any additional restriction on the right granted in this License, as + the Additional Use Grant; or (b) insert the text "None". + +3. To specify a Change Date. + +4. Not to modify this License in any other way. + +----------------------------------------------------------------------------- + +Notice + +The Business Source License (this document, or the "License") is not an Open +Source license. However, the Licensed Work will eventually be made available +under an Open Source License, as stated in this License. diff --git a/lib/v3-core/contracts/libraries/LICENSE_MIT b/lib/v3-core/contracts/libraries/LICENSE_MIT new file mode 100644 index 0000000..bf4f90a --- /dev/null +++ b/lib/v3-core/contracts/libraries/LICENSE_MIT @@ -0,0 +1,20 @@ +Copyright (c) 2021 Remco Bloemen + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/v3-core/contracts/libraries/LiquidityMath.sol b/lib/v3-core/contracts/libraries/LiquidityMath.sol new file mode 100644 index 0000000..d5e2303 --- /dev/null +++ b/lib/v3-core/contracts/libraries/LiquidityMath.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Math library for liquidity +library LiquidityMath { + /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows + /// @param x The liquidity before change + /// @param y The delta by which liquidity should be changed + /// @return z The liquidity delta + function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { + if (y < 0) { + require((z = x - uint128(-y)) < x, 'LS'); + } else { + require((z = x + uint128(y)) >= x, 'LA'); + } + } +} diff --git a/lib/v3-core/contracts/libraries/LowGasSafeMath.sol b/lib/v3-core/contracts/libraries/LowGasSafeMath.sol new file mode 100644 index 0000000..dbc817c --- /dev/null +++ b/lib/v3-core/contracts/libraries/LowGasSafeMath.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.0; + +/// @title Optimized overflow and underflow safe math operations +/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost +library LowGasSafeMath { + /// @notice Returns x + y, reverts if sum overflows uint256 + /// @param x The augend + /// @param y The addend + /// @return z The sum of x and y + function add(uint256 x, uint256 y) internal pure returns (uint256 z) { + require((z = x + y) >= x); + } + + /// @notice Returns x - y, reverts if underflows + /// @param x The minuend + /// @param y The subtrahend + /// @return z The difference of x and y + function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { + require((z = x - y) <= x); + } + + /// @notice Returns x * y, reverts if overflows + /// @param x The multiplicand + /// @param y The multiplier + /// @return z The product of x and y + function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { + require(x == 0 || (z = x * y) / x == y); + } + + /// @notice Returns x + y, reverts if overflows or underflows + /// @param x The augend + /// @param y The addend + /// @return z The sum of x and y + function add(int256 x, int256 y) internal pure returns (int256 z) { + require((z = x + y) >= x == (y >= 0)); + } + + /// @notice Returns x - y, reverts if overflows or underflows + /// @param x The minuend + /// @param y The subtrahend + /// @return z The difference of x and y + function sub(int256 x, int256 y) internal pure returns (int256 z) { + require((z = x - y) <= x == (y >= 0)); + } +} diff --git a/lib/v3-core/contracts/libraries/Oracle.sol b/lib/v3-core/contracts/libraries/Oracle.sol new file mode 100644 index 0000000..d386328 --- /dev/null +++ b/lib/v3-core/contracts/libraries/Oracle.sol @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0 <0.8.0; + +/// @title Oracle +/// @notice Provides price and liquidity data useful for a wide variety of system designs +/// @dev Instances of stored oracle data, "observations", are collected in the oracle array +/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the +/// maximum length of the oracle array. New slots will be added when the array is fully populated. +/// Observations are overwritten when the full length of the oracle array is populated. +/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe() +library Oracle { + struct Observation { + // the block timestamp of the observation + uint32 blockTimestamp; + // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized + int56 tickCumulative; + // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized + uint160 secondsPerLiquidityCumulativeX128; + // whether or not the observation is initialized + bool initialized; + } + + /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values + /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows + /// @param last The specified observation to be transformed + /// @param blockTimestamp The timestamp of the new observation + /// @param tick The active tick at the time of the new observation + /// @param liquidity The total in-range liquidity at the time of the new observation + /// @return Observation The newly populated observation + function transform( + Observation memory last, + uint32 blockTimestamp, + int24 tick, + uint128 liquidity + ) private pure returns (Observation memory) { + uint32 delta = blockTimestamp - last.blockTimestamp; + return + Observation({ + blockTimestamp: blockTimestamp, + tickCumulative: last.tickCumulative + int56(tick) * delta, + secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 + + ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)), + initialized: true + }); + } + + /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array + /// @param self The stored oracle array + /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32 + /// @return cardinality The number of populated elements in the oracle array + /// @return cardinalityNext The new length of the oracle array, independent of population + function initialize(Observation[65535] storage self, uint32 time) + internal + returns (uint16 cardinality, uint16 cardinalityNext) + { + self[0] = Observation({ + blockTimestamp: time, + tickCumulative: 0, + secondsPerLiquidityCumulativeX128: 0, + initialized: true + }); + return (1, 1); + } + + /// @notice Writes an oracle observation to the array + /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally. + /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality + /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering. + /// @param self The stored oracle array + /// @param index The index of the observation that was most recently written to the observations array + /// @param blockTimestamp The timestamp of the new observation + /// @param tick The active tick at the time of the new observation + /// @param liquidity The total in-range liquidity at the time of the new observation + /// @param cardinality The number of populated elements in the oracle array + /// @param cardinalityNext The new length of the oracle array, independent of population + /// @return indexUpdated The new index of the most recently written element in the oracle array + /// @return cardinalityUpdated The new cardinality of the oracle array + function write( + Observation[65535] storage self, + uint16 index, + uint32 blockTimestamp, + int24 tick, + uint128 liquidity, + uint16 cardinality, + uint16 cardinalityNext + ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) { + Observation memory last = self[index]; + + // early return if we've already written an observation this block + if (last.blockTimestamp == blockTimestamp) return (index, cardinality); + + // if the conditions are right, we can bump the cardinality + if (cardinalityNext > cardinality && index == (cardinality - 1)) { + cardinalityUpdated = cardinalityNext; + } else { + cardinalityUpdated = cardinality; + } + + indexUpdated = (index + 1) % cardinalityUpdated; + self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity); + } + + /// @notice Prepares the oracle array to store up to `next` observations + /// @param self The stored oracle array + /// @param current The current next cardinality of the oracle array + /// @param next The proposed next cardinality which will be populated in the oracle array + /// @return next The next cardinality which will be populated in the oracle array + function grow( + Observation[65535] storage self, + uint16 current, + uint16 next + ) internal returns (uint16) { + require(current > 0, 'I'); + // no-op if the passed next value isn't greater than the current next value + if (next <= current) return current; + // store in each slot to prevent fresh SSTOREs in swaps + // this data will not be used because the initialized boolean is still false + for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1; + return next; + } + + /// @notice comparator for 32-bit timestamps + /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time + /// @param time A timestamp truncated to 32 bits + /// @param a A comparison timestamp from which to determine the relative position of `time` + /// @param b From which to determine the relative position of `time` + /// @return bool Whether `a` is chronologically <= `b` + function lte( + uint32 time, + uint32 a, + uint32 b + ) private pure returns (bool) { + // if there hasn't been overflow, no need to adjust + if (a <= time && b <= time) return a <= b; + + uint256 aAdjusted = a > time ? a : a + 2**32; + uint256 bAdjusted = b > time ? b : b + 2**32; + + return aAdjusted <= bAdjusted; + } + + /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied. + /// The result may be the same observation, or adjacent observations. + /// @dev The answer must be contained in the array, used when the target is located within the stored observation + /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation + /// @param self The stored oracle array + /// @param time The current block.timestamp + /// @param target The timestamp at which the reserved observation should be for + /// @param index The index of the observation that was most recently written to the observations array + /// @param cardinality The number of populated elements in the oracle array + /// @return beforeOrAt The observation recorded before, or at, the target + /// @return atOrAfter The observation recorded at, or after, the target + function binarySearch( + Observation[65535] storage self, + uint32 time, + uint32 target, + uint16 index, + uint16 cardinality + ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { + uint256 l = (index + 1) % cardinality; // oldest observation + uint256 r = l + cardinality - 1; // newest observation + uint256 i; + while (true) { + i = (l + r) / 2; + + beforeOrAt = self[i % cardinality]; + + // we've landed on an uninitialized tick, keep searching higher (more recently) + if (!beforeOrAt.initialized) { + l = i + 1; + continue; + } + + atOrAfter = self[(i + 1) % cardinality]; + + bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target); + + // check if we've found the answer! + if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break; + + if (!targetAtOrAfter) r = i - 1; + else l = i + 1; + } + } + + /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied + /// @dev Assumes there is at least 1 initialized observation. + /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp. + /// @param self The stored oracle array + /// @param time The current block.timestamp + /// @param target The timestamp at which the reserved observation should be for + /// @param tick The active tick at the time of the returned or simulated observation + /// @param index The index of the observation that was most recently written to the observations array + /// @param liquidity The total pool liquidity at the time of the call + /// @param cardinality The number of populated elements in the oracle array + /// @return beforeOrAt The observation which occurred at, or before, the given timestamp + /// @return atOrAfter The observation which occurred at, or after, the given timestamp + function getSurroundingObservations( + Observation[65535] storage self, + uint32 time, + uint32 target, + int24 tick, + uint16 index, + uint128 liquidity, + uint16 cardinality + ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) { + // optimistically set before to the newest observation + beforeOrAt = self[index]; + + // if the target is chronologically at or after the newest observation, we can early return + if (lte(time, beforeOrAt.blockTimestamp, target)) { + if (beforeOrAt.blockTimestamp == target) { + // if newest observation equals target, we're in the same block, so we can ignore atOrAfter + return (beforeOrAt, atOrAfter); + } else { + // otherwise, we need to transform + return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity)); + } + } + + // now, set before to the oldest observation + beforeOrAt = self[(index + 1) % cardinality]; + if (!beforeOrAt.initialized) beforeOrAt = self[0]; + + // ensure that the target is chronologically at or after the oldest observation + require(lte(time, beforeOrAt.blockTimestamp, target), 'OLD'); + + // if we've reached this point, we have to binary search + return binarySearch(self, time, target, index, cardinality); + } + + /// @dev Reverts if an observation at or before the desired observation timestamp does not exist. + /// 0 may be passed as `secondsAgo' to return the current cumulative values. + /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values + /// at exactly the timestamp between the two observations. + /// @param self The stored oracle array + /// @param time The current block timestamp + /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation + /// @param tick The current tick + /// @param index The index of the observation that was most recently written to the observations array + /// @param liquidity The current in-range pool liquidity + /// @param cardinality The number of populated elements in the oracle array + /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo` + /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo` + function observeSingle( + Observation[65535] storage self, + uint32 time, + uint32 secondsAgo, + int24 tick, + uint16 index, + uint128 liquidity, + uint16 cardinality + ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) { + if (secondsAgo == 0) { + Observation memory last = self[index]; + if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity); + return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128); + } + + uint32 target = time - secondsAgo; + + (Observation memory beforeOrAt, Observation memory atOrAfter) = + getSurroundingObservations(self, time, target, tick, index, liquidity, cardinality); + + if (target == beforeOrAt.blockTimestamp) { + // we're at the left boundary + return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128); + } else if (target == atOrAfter.blockTimestamp) { + // we're at the right boundary + return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128); + } else { + // we're in the middle + uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp; + uint32 targetDelta = target - beforeOrAt.blockTimestamp; + return ( + beforeOrAt.tickCumulative + + ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta) * + targetDelta, + beforeOrAt.secondsPerLiquidityCumulativeX128 + + uint160( + (uint256( + atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128 + ) * targetDelta) / observationTimeDelta + ) + ); + } + } + + /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos` + /// @dev Reverts if `secondsAgos` > oldest observation + /// @param self The stored oracle array + /// @param time The current block.timestamp + /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation + /// @param tick The current tick + /// @param index The index of the observation that was most recently written to the observations array + /// @param liquidity The current in-range pool liquidity + /// @param cardinality The number of populated elements in the oracle array + /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo` + /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo` + function observe( + Observation[65535] storage self, + uint32 time, + uint32[] memory secondsAgos, + int24 tick, + uint16 index, + uint128 liquidity, + uint16 cardinality + ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) { + require(cardinality > 0, 'I'); + + tickCumulatives = new int56[](secondsAgos.length); + secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length); + for (uint256 i = 0; i < secondsAgos.length; i++) { + (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle( + self, + time, + secondsAgos[i], + tick, + index, + liquidity, + cardinality + ); + } + } +} diff --git a/lib/v3-core/contracts/libraries/Position.sol b/lib/v3-core/contracts/libraries/Position.sol new file mode 100644 index 0000000..41829b0 --- /dev/null +++ b/lib/v3-core/contracts/libraries/Position.sol @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0 <0.8.0; + +import './FullMath.sol'; +import './FixedPoint128.sol'; +import './LiquidityMath.sol'; + +/// @title Position +/// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary +/// @dev Positions store additional state for tracking fees owed to the position +library Position { + // info stored for each user's position + struct Info { + // the amount of liquidity owned by this position + uint128 liquidity; + // fee growth per unit of liquidity as of the last update to liquidity or fees owed + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + // the fees owed to the position owner in token0/token1 + uint128 tokensOwed0; + uint128 tokensOwed1; + } + + /// @notice Returns the Info struct of a position, given an owner and position boundaries + /// @param self The mapping containing all user positions + /// @param owner The address of the position owner + /// @param tickLower The lower tick boundary of the position + /// @param tickUpper The upper tick boundary of the position + /// @return position The position info struct of the given owners' position + function get( + mapping(bytes32 => Info) storage self, + address owner, + int24 tickLower, + int24 tickUpper + ) internal view returns (Position.Info storage position) { + position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))]; + } + + /// @notice Credits accumulated fees to a user's position + /// @param self The individual position to update + /// @param liquidityDelta The change in pool liquidity as a result of the position update + /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries + /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries + function update( + Info storage self, + int128 liquidityDelta, + uint256 feeGrowthInside0X128, + uint256 feeGrowthInside1X128 + ) internal { + Info memory _self = self; + + uint128 liquidityNext; + if (liquidityDelta == 0) { + require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions + liquidityNext = _self.liquidity; + } else { + liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta); + } + + // calculate accumulated fees + uint128 tokensOwed0 = + uint128( + FullMath.mulDiv( + feeGrowthInside0X128 - _self.feeGrowthInside0LastX128, + _self.liquidity, + FixedPoint128.Q128 + ) + ); + uint128 tokensOwed1 = + uint128( + FullMath.mulDiv( + feeGrowthInside1X128 - _self.feeGrowthInside1LastX128, + _self.liquidity, + FixedPoint128.Q128 + ) + ); + + // update the position + if (liquidityDelta != 0) self.liquidity = liquidityNext; + self.feeGrowthInside0LastX128 = feeGrowthInside0X128; + self.feeGrowthInside1LastX128 = feeGrowthInside1X128; + if (tokensOwed0 > 0 || tokensOwed1 > 0) { + // overflow is acceptable, have to withdraw before you hit type(uint128).max fees + self.tokensOwed0 += tokensOwed0; + self.tokensOwed1 += tokensOwed1; + } + } +} diff --git a/lib/v3-core/contracts/libraries/SafeCast.sol b/lib/v3-core/contracts/libraries/SafeCast.sol new file mode 100644 index 0000000..a8ea229 --- /dev/null +++ b/lib/v3-core/contracts/libraries/SafeCast.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Safe casting methods +/// @notice Contains methods for safely casting between types +library SafeCast { + /// @notice Cast a uint256 to a uint160, revert on overflow + /// @param y The uint256 to be downcasted + /// @return z The downcasted integer, now type uint160 + function toUint160(uint256 y) internal pure returns (uint160 z) { + require((z = uint160(y)) == y); + } + + /// @notice Cast a int256 to a int128, revert on overflow or underflow + /// @param y The int256 to be downcasted + /// @return z The downcasted integer, now type int128 + function toInt128(int256 y) internal pure returns (int128 z) { + require((z = int128(y)) == y); + } + + /// @notice Cast a uint256 to a int256, revert on overflow + /// @param y The uint256 to be casted + /// @return z The casted integer, now type int256 + function toInt256(uint256 y) internal pure returns (int256 z) { + require(y < 2**255); + z = int256(y); + } +} diff --git a/lib/v3-core/contracts/libraries/SqrtPriceMath.sol b/lib/v3-core/contracts/libraries/SqrtPriceMath.sol new file mode 100644 index 0000000..685f485 --- /dev/null +++ b/lib/v3-core/contracts/libraries/SqrtPriceMath.sol @@ -0,0 +1,227 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0; + +import './LowGasSafeMath.sol'; +import './SafeCast.sol'; + +import './FullMath.sol'; +import './UnsafeMath.sol'; +import './FixedPoint96.sol'; + +/// @title Functions based on Q64.96 sqrt price and liquidity +/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas +library SqrtPriceMath { + using LowGasSafeMath for uint256; + using SafeCast for uint256; + + /// @notice Gets the next sqrt price given a delta of token0 + /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the + /// price less in order to not send too much output. + /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), + /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). + /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token0 to add or remove from virtual reserves + /// @param add Whether to add or remove the amount of token0 + /// @return The price after adding or removing amount, depending on add + function getNextSqrtPriceFromAmount0RoundingUp( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price + if (amount == 0) return sqrtPX96; + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + + if (add) { + uint256 product; + if ((product = amount * sqrtPX96) / amount == sqrtPX96) { + uint256 denominator = numerator1 + product; + if (denominator >= numerator1) + // always fits in 160 bits + return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator)); + } + + return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount))); + } else { + uint256 product; + // if the product overflows, we know the denominator underflows + // in addition, we must check that the denominator does not underflow + require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product); + uint256 denominator = numerator1 - product; + return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160(); + } + } + + /// @notice Gets the next sqrt price given a delta of token1 + /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the + /// price less in order to not send too much output. + /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity + /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token1 to add, or remove, from virtual reserves + /// @param add Whether to add, or remove, the amount of token1 + /// @return The price after adding or removing `amount` + function getNextSqrtPriceFromAmount1RoundingDown( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // if we're adding (subtracting), rounding down requires rounding the quotient down (up) + // in both cases, avoid a mulDiv for most inputs + if (add) { + uint256 quotient = + ( + amount <= type(uint160).max + ? (amount << FixedPoint96.RESOLUTION) / liquidity + : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) + ); + + return uint256(sqrtPX96).add(quotient).toUint160(); + } else { + uint256 quotient = + ( + amount <= type(uint160).max + ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity) + : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity) + ); + + require(sqrtPX96 > quotient); + // always fits 160 bits + return uint160(sqrtPX96 - quotient); + } + } + + /// @notice Gets the next sqrt price given an input amount of token0 or token1 + /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds + /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount + /// @param liquidity The amount of usable liquidity + /// @param amountIn How much of token0, or token1, is being swapped in + /// @param zeroForOne Whether the amount in is token0 or token1 + /// @return sqrtQX96 The price after adding the input amount to token0 or token1 + function getNextSqrtPriceFromInput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we don't pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true) + : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true); + } + + /// @notice Gets the next sqrt price given an output amount of token0 or token1 + /// @dev Throws if price or liquidity are 0 or the next price is out of bounds + /// @param sqrtPX96 The starting price before accounting for the output amount + /// @param liquidity The amount of usable liquidity + /// @param amountOut How much of token0, or token1, is being swapped out + /// @param zeroForOne Whether the amount out is token0 or token1 + /// @return sqrtQX96 The price after removing the output amount of token0 or token1 + function getNextSqrtPriceFromOutput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false) + : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false); + } + + /// @notice Gets the amount0 delta between two prices + /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), + /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up or down + /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; + + require(sqrtRatioAX96 > 0); + + return + roundUp + ? UnsafeMath.divRoundingUp( + FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), + sqrtRatioAX96 + ) + : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96; + } + + /// @notice Gets the amount1 delta between two prices + /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up, or down + /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + roundUp + ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96) + : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); + } + + /// @notice Helper that gets signed token0 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount0 delta + /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount0) { + return + liquidity < 0 + ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() + : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); + } + + /// @notice Helper that gets signed token1 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount1 delta + /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount1) { + return + liquidity < 0 + ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256() + : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256(); + } +} diff --git a/lib/v3-core/contracts/libraries/SwapMath.sol b/lib/v3-core/contracts/libraries/SwapMath.sol new file mode 100644 index 0000000..ee176fb --- /dev/null +++ b/lib/v3-core/contracts/libraries/SwapMath.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0; + +import './FullMath.sol'; +import './SqrtPriceMath.sol'; + +/// @title Computes the result of a swap within ticks +/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. +library SwapMath { + /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap + /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive + /// @param sqrtRatioCurrentX96 The current sqrt price of the pool + /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred + /// @param liquidity The usable liquidity + /// @param amountRemaining How much input or output amount is remaining to be swapped in/out + /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip + /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target + /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap + /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap + /// @return feeAmount The amount of input that will be taken as a fee + function computeSwapStep( + uint160 sqrtRatioCurrentX96, + uint160 sqrtRatioTargetX96, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) + internal + pure + returns ( + uint160 sqrtRatioNextX96, + uint256 amountIn, + uint256 amountOut, + uint256 feeAmount + ) + { + bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; + bool exactIn = amountRemaining >= 0; + + if (exactIn) { + uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6); + amountIn = zeroForOne + ? SqrtPriceMath.getAmount0Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, true) + : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, true); + if (amountRemainingLessFee >= amountIn) sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( + sqrtRatioCurrentX96, + liquidity, + amountRemainingLessFee, + zeroForOne + ); + } else { + amountOut = zeroForOne + ? SqrtPriceMath.getAmount1Delta(sqrtRatioTargetX96, sqrtRatioCurrentX96, liquidity, false) + : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioTargetX96, liquidity, false); + if (uint256(-amountRemaining) >= amountOut) sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( + sqrtRatioCurrentX96, + liquidity, + uint256(-amountRemaining), + zeroForOne + ); + } + + bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; + + // get the input/output amounts + if (zeroForOne) { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount0Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, true); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount1Delta(sqrtRatioNextX96, sqrtRatioCurrentX96, liquidity, false); + } else { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount1Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, true); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount0Delta(sqrtRatioCurrentX96, sqrtRatioNextX96, liquidity, false); + } + + // cap the output amount to not exceed the remaining output amount + if (!exactIn && amountOut > uint256(-amountRemaining)) { + amountOut = uint256(-amountRemaining); + } + + if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { + // we didn't reach the target, so take the remainder of the maximum input as fee + feeAmount = uint256(amountRemaining) - amountIn; + } else { + feeAmount = FullMath.mulDivRoundingUp(amountIn, feePips, 1e6 - feePips); + } + } +} diff --git a/lib/v3-core/contracts/libraries/Tick.sol b/lib/v3-core/contracts/libraries/Tick.sol new file mode 100644 index 0000000..7ceed03 --- /dev/null +++ b/lib/v3-core/contracts/libraries/Tick.sol @@ -0,0 +1,185 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0 <0.8.0; + +import './LowGasSafeMath.sol'; +import './SafeCast.sol'; + +import './TickMath.sol'; +import './LiquidityMath.sol'; + +/// @title Tick +/// @notice Contains functions for managing tick processes and relevant calculations +library Tick { + using LowGasSafeMath for int256; + using SafeCast for int256; + + // info stored for each initialized individual tick + struct Info { + // the total position liquidity that references this tick + uint128 liquidityGross; + // amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left), + int128 liquidityNet; + // fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick) + // only has relative meaning, not absolute — the value depends on when the tick is initialized + uint256 feeGrowthOutside0X128; + uint256 feeGrowthOutside1X128; + // the cumulative tick value on the other side of the tick + int56 tickCumulativeOutside; + // the seconds per unit of liquidity on the _other_ side of this tick (relative to the current tick) + // only has relative meaning, not absolute — the value depends on when the tick is initialized + uint160 secondsPerLiquidityOutsideX128; + // the seconds spent on the other side of the tick (relative to the current tick) + // only has relative meaning, not absolute — the value depends on when the tick is initialized + uint32 secondsOutside; + // true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0 + // these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks + bool initialized; + } + + /// @notice Derives max liquidity per tick from given tick spacing + /// @dev Executed within the pool constructor + /// @param tickSpacing The amount of required tick separation, realized in multiples of `tickSpacing` + /// e.g., a tickSpacing of 3 requires ticks to be initialized every 3rd tick i.e., ..., -6, -3, 0, 3, 6, ... + /// @return The max liquidity per tick + function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) internal pure returns (uint128) { + int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; + int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing; + uint24 numTicks = uint24((maxTick - minTick) / tickSpacing) + 1; + return type(uint128).max / numTicks; + } + + /// @notice Retrieves fee growth data + /// @param self The mapping containing all tick information for initialized ticks + /// @param tickLower The lower tick boundary of the position + /// @param tickUpper The upper tick boundary of the position + /// @param tickCurrent The current tick + /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// @return feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries + /// @return feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries + function getFeeGrowthInside( + mapping(int24 => Tick.Info) storage self, + int24 tickLower, + int24 tickUpper, + int24 tickCurrent, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128 + ) internal view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { + Info storage lower = self[tickLower]; + Info storage upper = self[tickUpper]; + + // calculate fee growth below + uint256 feeGrowthBelow0X128; + uint256 feeGrowthBelow1X128; + if (tickCurrent >= tickLower) { + feeGrowthBelow0X128 = lower.feeGrowthOutside0X128; + feeGrowthBelow1X128 = lower.feeGrowthOutside1X128; + } else { + feeGrowthBelow0X128 = feeGrowthGlobal0X128 - lower.feeGrowthOutside0X128; + feeGrowthBelow1X128 = feeGrowthGlobal1X128 - lower.feeGrowthOutside1X128; + } + + // calculate fee growth above + uint256 feeGrowthAbove0X128; + uint256 feeGrowthAbove1X128; + if (tickCurrent < tickUpper) { + feeGrowthAbove0X128 = upper.feeGrowthOutside0X128; + feeGrowthAbove1X128 = upper.feeGrowthOutside1X128; + } else { + feeGrowthAbove0X128 = feeGrowthGlobal0X128 - upper.feeGrowthOutside0X128; + feeGrowthAbove1X128 = feeGrowthGlobal1X128 - upper.feeGrowthOutside1X128; + } + + feeGrowthInside0X128 = feeGrowthGlobal0X128 - feeGrowthBelow0X128 - feeGrowthAbove0X128; + feeGrowthInside1X128 = feeGrowthGlobal1X128 - feeGrowthBelow1X128 - feeGrowthAbove1X128; + } + + /// @notice Updates a tick and returns true if the tick was flipped from initialized to uninitialized, or vice versa + /// @param self The mapping containing all tick information for initialized ticks + /// @param tick The tick that will be updated + /// @param tickCurrent The current tick + /// @param liquidityDelta A new amount of liquidity to be added (subtracted) when tick is crossed from left to right (right to left) + /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// @param secondsPerLiquidityCumulativeX128 The all-time seconds per max(1, liquidity) of the pool + /// @param tickCumulative The tick * time elapsed since the pool was first initialized + /// @param time The current block timestamp cast to a uint32 + /// @param upper true for updating a position's upper tick, or false for updating a position's lower tick + /// @param maxLiquidity The maximum liquidity allocation for a single tick + /// @return flipped Whether the tick was flipped from initialized to uninitialized, or vice versa + function update( + mapping(int24 => Tick.Info) storage self, + int24 tick, + int24 tickCurrent, + int128 liquidityDelta, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128, + uint160 secondsPerLiquidityCumulativeX128, + int56 tickCumulative, + uint32 time, + bool upper, + uint128 maxLiquidity + ) internal returns (bool flipped) { + Tick.Info storage info = self[tick]; + + uint128 liquidityGrossBefore = info.liquidityGross; + uint128 liquidityGrossAfter = LiquidityMath.addDelta(liquidityGrossBefore, liquidityDelta); + + require(liquidityGrossAfter <= maxLiquidity, 'LO'); + + flipped = (liquidityGrossAfter == 0) != (liquidityGrossBefore == 0); + + if (liquidityGrossBefore == 0) { + // by convention, we assume that all growth before a tick was initialized happened _below_ the tick + if (tick <= tickCurrent) { + info.feeGrowthOutside0X128 = feeGrowthGlobal0X128; + info.feeGrowthOutside1X128 = feeGrowthGlobal1X128; + info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128; + info.tickCumulativeOutside = tickCumulative; + info.secondsOutside = time; + } + info.initialized = true; + } + + info.liquidityGross = liquidityGrossAfter; + + // when the lower (upper) tick is crossed left to right (right to left), liquidity must be added (removed) + info.liquidityNet = upper + ? int256(info.liquidityNet).sub(liquidityDelta).toInt128() + : int256(info.liquidityNet).add(liquidityDelta).toInt128(); + } + + /// @notice Clears tick data + /// @param self The mapping containing all initialized tick information for initialized ticks + /// @param tick The tick that will be cleared + function clear(mapping(int24 => Tick.Info) storage self, int24 tick) internal { + delete self[tick]; + } + + /// @notice Transitions to next tick as needed by price movement + /// @param self The mapping containing all tick information for initialized ticks + /// @param tick The destination tick of the transition + /// @param feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// @param feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// @param secondsPerLiquidityCumulativeX128 The current seconds per liquidity + /// @param tickCumulative The tick * time elapsed since the pool was first initialized + /// @param time The current block.timestamp + /// @return liquidityNet The amount of liquidity added (subtracted) when tick is crossed from left to right (right to left) + function cross( + mapping(int24 => Tick.Info) storage self, + int24 tick, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128, + uint160 secondsPerLiquidityCumulativeX128, + int56 tickCumulative, + uint32 time + ) internal returns (int128 liquidityNet) { + Tick.Info storage info = self[tick]; + info.feeGrowthOutside0X128 = feeGrowthGlobal0X128 - info.feeGrowthOutside0X128; + info.feeGrowthOutside1X128 = feeGrowthGlobal1X128 - info.feeGrowthOutside1X128; + info.secondsPerLiquidityOutsideX128 = secondsPerLiquidityCumulativeX128 - info.secondsPerLiquidityOutsideX128; + info.tickCumulativeOutside = tickCumulative - info.tickCumulativeOutside; + info.secondsOutside = time - info.secondsOutside; + liquidityNet = info.liquidityNet; + } +} diff --git a/lib/v3-core/contracts/libraries/TickBitmap.sol b/lib/v3-core/contracts/libraries/TickBitmap.sol new file mode 100644 index 0000000..3c43585 --- /dev/null +++ b/lib/v3-core/contracts/libraries/TickBitmap.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity >=0.5.0; + +import './BitMath.sol'; + +/// @title Packed tick initialized state library +/// @notice Stores a packed mapping of tick index to its initialized state +/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word. +library TickBitmap { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) { + wordPos = int16(tick >> 8); + bitPos = uint8(tick % 256); + } + + /// @notice Flips the initialized state for a given tick from false to true, or vice versa + /// @param self The mapping in which to flip the tick + /// @param tick The tick to flip + /// @param tickSpacing The spacing between usable ticks + function flipTick( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing + ) internal { + require(tick % tickSpacing == 0); // ensure that the tick is spaced + (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing); + uint256 mask = 1 << bitPos; + self[wordPos] ^= mask; + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing + : (compressed - int24(bitPos)) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing + : (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing; + } + } +} diff --git a/lib/v3-core/contracts/libraries/TickMath.sol b/lib/v3-core/contracts/libraries/TickMath.sol new file mode 100644 index 0000000..ee48fee --- /dev/null +++ b/lib/v3-core/contracts/libraries/TickMath.sol @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0 <0.8.0; + +/// @title Math library for computing sqrt prices from ticks and vice versa +/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports +/// prices between 2**-128 and 2**128 +library TickMath { + /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 + int24 internal constant MIN_TICK = -887272; + /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 + int24 internal constant MAX_TICK = -MIN_TICK; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; + + /// @notice Calculates sqrt(1.0001^tick) * 2^96 + /// @dev Throws if |tick| > max tick + /// @param tick The input tick for the above formula + /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) + /// at the given tick + function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { + uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); + require(absTick <= uint256(MAX_TICK), 'T'); + + uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; + if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; + if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; + if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; + if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; + if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; + if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; + if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; + if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; + if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; + if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; + if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; + if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; + if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; + if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; + if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; + if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; + if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; + if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; + if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; + + if (tick > 0) ratio = type(uint256).max / ratio; + + // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. + // we then downcast because we know the result always fits within 160 bits due to our tick input constraint + // we round up in the division so getTickAtSqrtRatio of the output price is always consistent + sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); + } + + /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio + /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may + /// ever return. + /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 + /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio + function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { + // second inequality must be < because the price can never reach the price at the max tick + require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); + uint256 ratio = uint256(sqrtPriceX96) << 32; + + uint256 r = ratio; + uint256 msb = 0; + + assembly { + let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(5, gt(r, 0xFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(4, gt(r, 0xFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(3, gt(r, 0xFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(2, gt(r, 0xF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(1, gt(r, 0x3)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := gt(r, 0x1) + msb := or(msb, f) + } + + if (msb >= 128) r = ratio >> (msb - 127); + else r = ratio << (127 - msb); + + int256 log_2 = (int256(msb) - 128) << 64; + + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(63, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(62, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(61, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(60, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(59, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(58, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(57, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(56, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(55, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(54, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(53, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(52, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(51, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(50, f)) + } + + int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number + + int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); + int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); + + tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; + } +} diff --git a/lib/v3-core/contracts/libraries/TransferHelper.sol b/lib/v3-core/contracts/libraries/TransferHelper.sol new file mode 100644 index 0000000..25d6309 --- /dev/null +++ b/lib/v3-core/contracts/libraries/TransferHelper.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.6.0; + +import '../interfaces/IERC20Minimal.sol'; + +/// @title TransferHelper +/// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false +library TransferHelper { + /// @notice Transfers tokens from msg.sender to a recipient + /// @dev Calls transfer on token contract, errors with TF if transfer fails + /// @param token The contract address of the token which will be transferred + /// @param to The recipient of the transfer + /// @param value The value of the transfer + function safeTransfer( + address token, + address to, + uint256 value + ) internal { + (bool success, bytes memory data) = + token.call(abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value)); + require(success && (data.length == 0 || abi.decode(data, (bool))), 'TF'); + } +} diff --git a/lib/v3-core/contracts/libraries/UnsafeMath.sol b/lib/v3-core/contracts/libraries/UnsafeMath.sol new file mode 100644 index 0000000..f62f846 --- /dev/null +++ b/lib/v3-core/contracts/libraries/UnsafeMath.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Math functions that do not check inputs or outputs +/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks +library UnsafeMath { + /// @notice Returns ceil(x / y) + /// @dev division by 0 has unspecified behavior, and must be checked externally + /// @param x The dividend + /// @param y The divisor + /// @return z The quotient, ceil(x / y) + function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) { + assembly { + z := add(div(x, y), gt(mod(x, y), 0)) + } + } +} diff --git a/lib/v3-core/contracts/test/BitMathEchidnaTest.sol b/lib/v3-core/contracts/test/BitMathEchidnaTest.sol new file mode 100644 index 0000000..ca7d34f --- /dev/null +++ b/lib/v3-core/contracts/test/BitMathEchidnaTest.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/BitMath.sol'; + +contract BitMathEchidnaTest { + function mostSignificantBitInvariant(uint256 input) external pure { + uint8 msb = BitMath.mostSignificantBit(input); + assert(input >= (uint256(2)**msb)); + assert(msb == 255 || input < uint256(2)**(msb + 1)); + } + + function leastSignificantBitInvariant(uint256 input) external pure { + uint8 lsb = BitMath.leastSignificantBit(input); + assert(input & (uint256(2)**lsb) != 0); + assert(input & (uint256(2)**lsb - 1) == 0); + } +} diff --git a/lib/v3-core/contracts/test/BitMathTest.sol b/lib/v3-core/contracts/test/BitMathTest.sol new file mode 100644 index 0000000..2b387be --- /dev/null +++ b/lib/v3-core/contracts/test/BitMathTest.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/BitMath.sol'; + +contract BitMathTest { + function mostSignificantBit(uint256 x) external pure returns (uint8 r) { + return BitMath.mostSignificantBit(x); + } + + function getGasCostOfMostSignificantBit(uint256 x) external view returns (uint256) { + uint256 gasBefore = gasleft(); + BitMath.mostSignificantBit(x); + return gasBefore - gasleft(); + } + + function leastSignificantBit(uint256 x) external pure returns (uint8 r) { + return BitMath.leastSignificantBit(x); + } + + function getGasCostOfLeastSignificantBit(uint256 x) external view returns (uint256) { + uint256 gasBefore = gasleft(); + BitMath.leastSignificantBit(x); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-core/contracts/test/FullMathEchidnaTest.sol b/lib/v3-core/contracts/test/FullMathEchidnaTest.sol new file mode 100644 index 0000000..9e1063d --- /dev/null +++ b/lib/v3-core/contracts/test/FullMathEchidnaTest.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/FullMath.sol'; + +contract FullMathEchidnaTest { + function checkMulDivRounding( + uint256 x, + uint256 y, + uint256 d + ) external pure { + require(d > 0); + + uint256 ceiled = FullMath.mulDivRoundingUp(x, y, d); + uint256 floored = FullMath.mulDiv(x, y, d); + + if (mulmod(x, y, d) > 0) { + assert(ceiled - floored == 1); + } else { + assert(ceiled == floored); + } + } + + function checkMulDiv( + uint256 x, + uint256 y, + uint256 d + ) external pure { + require(d > 0); + uint256 z = FullMath.mulDiv(x, y, d); + if (x == 0 || y == 0) { + assert(z == 0); + return; + } + + // recompute x and y via mulDiv of the result of floor(x*y/d), should always be less than original inputs by < d + uint256 x2 = FullMath.mulDiv(z, d, y); + uint256 y2 = FullMath.mulDiv(z, d, x); + assert(x2 <= x); + assert(y2 <= y); + + assert(x - x2 < d); + assert(y - y2 < d); + } + + function checkMulDivRoundingUp( + uint256 x, + uint256 y, + uint256 d + ) external pure { + require(d > 0); + uint256 z = FullMath.mulDivRoundingUp(x, y, d); + if (x == 0 || y == 0) { + assert(z == 0); + return; + } + + // recompute x and y via mulDiv of the result of floor(x*y/d), should always be less than original inputs by < d + uint256 x2 = FullMath.mulDiv(z, d, y); + uint256 y2 = FullMath.mulDiv(z, d, x); + assert(x2 >= x); + assert(y2 >= y); + + assert(x2 - x < d); + assert(y2 - y < d); + } +} diff --git a/lib/v3-core/contracts/test/FullMathTest.sol b/lib/v3-core/contracts/test/FullMathTest.sol new file mode 100644 index 0000000..ec59bc9 --- /dev/null +++ b/lib/v3-core/contracts/test/FullMathTest.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/FullMath.sol'; + +contract FullMathTest { + function mulDiv( + uint256 x, + uint256 y, + uint256 z + ) external pure returns (uint256) { + return FullMath.mulDiv(x, y, z); + } + + function mulDivRoundingUp( + uint256 x, + uint256 y, + uint256 z + ) external pure returns (uint256) { + return FullMath.mulDivRoundingUp(x, y, z); + } +} diff --git a/lib/v3-core/contracts/test/LiquidityMathTest.sol b/lib/v3-core/contracts/test/LiquidityMathTest.sol new file mode 100644 index 0000000..d85e0f1 --- /dev/null +++ b/lib/v3-core/contracts/test/LiquidityMathTest.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/LiquidityMath.sol'; + +contract LiquidityMathTest { + function addDelta(uint128 x, int128 y) external pure returns (uint128 z) { + return LiquidityMath.addDelta(x, y); + } + + function getGasCostOfAddDelta(uint128 x, int128 y) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityMath.addDelta(x, y); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol b/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol new file mode 100644 index 0000000..315531d --- /dev/null +++ b/lib/v3-core/contracts/test/LowGasSafeMathEchidnaTest.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/LowGasSafeMath.sol'; + +contract LowGasSafeMathEchidnaTest { + function checkAdd(uint256 x, uint256 y) external pure { + uint256 z = LowGasSafeMath.add(x, y); + assert(z == x + y); + assert(z >= x && z >= y); + } + + function checkSub(uint256 x, uint256 y) external pure { + uint256 z = LowGasSafeMath.sub(x, y); + assert(z == x - y); + assert(z <= x); + } + + function checkMul(uint256 x, uint256 y) external pure { + uint256 z = LowGasSafeMath.mul(x, y); + assert(z == x * y); + assert(x == 0 || y == 0 || (z >= x && z >= y)); + } + + function checkAddi(int256 x, int256 y) external pure { + int256 z = LowGasSafeMath.add(x, y); + assert(z == x + y); + assert(y < 0 ? z < x : z >= x); + } + + function checkSubi(int256 x, int256 y) external pure { + int256 z = LowGasSafeMath.sub(x, y); + assert(z == x - y); + assert(y < 0 ? z > x : z <= x); + } +} diff --git a/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol b/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol new file mode 100644 index 0000000..66d2566 --- /dev/null +++ b/lib/v3-core/contracts/test/MockTimeUniswapV3Pool.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../UniswapV3Pool.sol'; + +// used for testing time dependent behavior +contract MockTimeUniswapV3Pool is UniswapV3Pool { + // Monday, October 5, 2020 9:00:00 AM GMT-05:00 + uint256 public time = 1601906400; + + function setFeeGrowthGlobal0X128(uint256 _feeGrowthGlobal0X128) external { + feeGrowthGlobal0X128 = _feeGrowthGlobal0X128; + } + + function setFeeGrowthGlobal1X128(uint256 _feeGrowthGlobal1X128) external { + feeGrowthGlobal1X128 = _feeGrowthGlobal1X128; + } + + function advanceTime(uint256 by) external { + time += by; + } + + function _blockTimestamp() internal view override returns (uint32) { + return uint32(time); + } +} diff --git a/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol b/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol new file mode 100644 index 0000000..a274fb7 --- /dev/null +++ b/lib/v3-core/contracts/test/MockTimeUniswapV3PoolDeployer.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/IUniswapV3PoolDeployer.sol'; + +import './MockTimeUniswapV3Pool.sol'; + +contract MockTimeUniswapV3PoolDeployer is IUniswapV3PoolDeployer { + struct Parameters { + address factory; + address token0; + address token1; + uint24 fee; + int24 tickSpacing; + } + + Parameters public override parameters; + + event PoolDeployed(address pool); + + function deploy( + address factory, + address token0, + address token1, + uint24 fee, + int24 tickSpacing + ) external returns (address pool) { + parameters = Parameters({factory: factory, token0: token0, token1: token1, fee: fee, tickSpacing: tickSpacing}); + pool = address( + new MockTimeUniswapV3Pool{salt: keccak256(abi.encodePacked(token0, token1, fee, tickSpacing))}() + ); + emit PoolDeployed(pool); + delete parameters; + } +} diff --git a/lib/v3-core/contracts/test/NoDelegateCallTest.sol b/lib/v3-core/contracts/test/NoDelegateCallTest.sol new file mode 100644 index 0000000..8830d5c --- /dev/null +++ b/lib/v3-core/contracts/test/NoDelegateCallTest.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../NoDelegateCall.sol'; + +contract NoDelegateCallTest is NoDelegateCall { + function canBeDelegateCalled() public view returns (uint256) { + return block.timestamp / 5; + } + + function cannotBeDelegateCalled() public view noDelegateCall returns (uint256) { + return block.timestamp / 5; + } + + function getGasCostOfCanBeDelegateCalled() external view returns (uint256) { + uint256 gasBefore = gasleft(); + canBeDelegateCalled(); + return gasBefore - gasleft(); + } + + function getGasCostOfCannotBeDelegateCalled() external view returns (uint256) { + uint256 gasBefore = gasleft(); + cannotBeDelegateCalled(); + return gasBefore - gasleft(); + } + + function callsIntoNoDelegateCallFunction() external view { + noDelegateCallPrivate(); + } + + function noDelegateCallPrivate() private view noDelegateCall {} +} diff --git a/lib/v3-core/contracts/test/OracleEchidnaTest.sol b/lib/v3-core/contracts/test/OracleEchidnaTest.sol new file mode 100644 index 0000000..2cf5f2e --- /dev/null +++ b/lib/v3-core/contracts/test/OracleEchidnaTest.sol @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import './OracleTest.sol'; + +contract OracleEchidnaTest { + OracleTest private oracle; + + bool private initialized; + uint32 private timePassed; + + constructor() { + oracle = new OracleTest(); + } + + function initialize( + uint32 time, + int24 tick, + uint128 liquidity + ) external { + oracle.initialize(OracleTest.InitializeParams({time: time, tick: tick, liquidity: liquidity})); + initialized = true; + } + + function limitTimePassed(uint32 by) private { + require(timePassed + by >= timePassed); + timePassed += by; + } + + function advanceTime(uint32 by) public { + limitTimePassed(by); + oracle.advanceTime(by); + } + + // write an observation, then change tick and liquidity + function update( + uint32 advanceTimeBy, + int24 tick, + uint128 liquidity + ) external { + limitTimePassed(advanceTimeBy); + oracle.update(OracleTest.UpdateParams({advanceTimeBy: advanceTimeBy, tick: tick, liquidity: liquidity})); + } + + function grow(uint16 cardinality) external { + oracle.grow(cardinality); + } + + function checkTimeWeightedResultAssertions(uint32 secondsAgo0, uint32 secondsAgo1) private view { + require(secondsAgo0 != secondsAgo1); + require(initialized); + // secondsAgo0 should be the larger one + if (secondsAgo0 < secondsAgo1) (secondsAgo0, secondsAgo1) = (secondsAgo1, secondsAgo0); + + uint32 timeElapsed = secondsAgo0 - secondsAgo1; + + uint32[] memory secondsAgos = new uint32[](2); + secondsAgos[0] = secondsAgo0; + secondsAgos[1] = secondsAgo1; + + (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) = + oracle.observe(secondsAgos); + int56 timeWeightedTick = (tickCumulatives[1] - tickCumulatives[0]) / timeElapsed; + uint256 timeWeightedHarmonicMeanLiquidity = + (uint256(timeElapsed) * type(uint160).max) / + (uint256(secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0]) << 32); + assert(timeWeightedHarmonicMeanLiquidity <= type(uint128).max); + assert(timeWeightedTick <= type(int24).max); + assert(timeWeightedTick >= type(int24).min); + } + + function echidna_indexAlwaysLtCardinality() external view returns (bool) { + return oracle.index() < oracle.cardinality() || !initialized; + } + + function echidna_AlwaysInitialized() external view returns (bool) { + (, , , bool isInitialized) = oracle.observations(0); + return oracle.cardinality() == 0 || isInitialized; + } + + function echidna_cardinalityAlwaysLteNext() external view returns (bool) { + return oracle.cardinality() <= oracle.cardinalityNext(); + } + + function echidna_canAlwaysObserve0IfInitialized() external view returns (bool) { + if (!initialized) { + return true; + } + uint32[] memory arr = new uint32[](1); + arr[0] = 0; + (bool success, ) = address(oracle).staticcall(abi.encodeWithSelector(OracleTest.observe.selector, arr)); + return success; + } + + function checkTwoAdjacentObservationsTickCumulativeModTimeElapsedAlways0(uint16 index) external view { + uint16 cardinality = oracle.cardinality(); + // check that the observations are initialized, and that the index is not the oldest observation + require(index < cardinality && index != (oracle.index() + 1) % cardinality); + + (uint32 blockTimestamp0, int56 tickCumulative0, , bool initialized0) = + oracle.observations(index == 0 ? cardinality - 1 : index - 1); + (uint32 blockTimestamp1, int56 tickCumulative1, , bool initialized1) = oracle.observations(index); + + require(initialized0); + require(initialized1); + + uint32 timeElapsed = blockTimestamp1 - blockTimestamp0; + assert(timeElapsed > 0); + assert((tickCumulative1 - tickCumulative0) % timeElapsed == 0); + } + + function checkTimeWeightedAveragesAlwaysFitsType(uint32 secondsAgo) external view { + require(initialized); + require(secondsAgo > 0); + uint32[] memory secondsAgos = new uint32[](2); + secondsAgos[0] = secondsAgo; + secondsAgos[1] = 0; + (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) = + oracle.observe(secondsAgos); + + // compute the time weighted tick, rounded towards negative infinity + int56 numerator = tickCumulatives[1] - tickCumulatives[0]; + int56 timeWeightedTick = numerator / int56(secondsAgo); + if (numerator < 0 && numerator % int56(secondsAgo) != 0) { + timeWeightedTick--; + } + + // the time weighted averages fit in their respective accumulated types + assert(timeWeightedTick <= type(int24).max && timeWeightedTick >= type(int24).min); + + uint256 timeWeightedHarmonicMeanLiquidity = + (uint256(secondsAgo) * type(uint160).max) / + (uint256(secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0]) << 32); + assert(timeWeightedHarmonicMeanLiquidity <= type(uint128).max); + } +} diff --git a/lib/v3-core/contracts/test/OracleTest.sol b/lib/v3-core/contracts/test/OracleTest.sol new file mode 100644 index 0000000..c0c83b1 --- /dev/null +++ b/lib/v3-core/contracts/test/OracleTest.sol @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../libraries/Oracle.sol'; + +contract OracleTest { + using Oracle for Oracle.Observation[65535]; + + Oracle.Observation[65535] public observations; + + uint32 public time; + int24 public tick; + uint128 public liquidity; + uint16 public index; + uint16 public cardinality; + uint16 public cardinalityNext; + + struct InitializeParams { + uint32 time; + int24 tick; + uint128 liquidity; + } + + function initialize(InitializeParams calldata params) external { + require(cardinality == 0, 'already initialized'); + time = params.time; + tick = params.tick; + liquidity = params.liquidity; + (cardinality, cardinalityNext) = observations.initialize(params.time); + } + + function advanceTime(uint32 by) public { + time += by; + } + + struct UpdateParams { + uint32 advanceTimeBy; + int24 tick; + uint128 liquidity; + } + + // write an observation, then change tick and liquidity + function update(UpdateParams calldata params) external { + advanceTime(params.advanceTimeBy); + (index, cardinality) = observations.write(index, time, tick, liquidity, cardinality, cardinalityNext); + tick = params.tick; + liquidity = params.liquidity; + } + + function batchUpdate(UpdateParams[] calldata params) external { + // sload everything + int24 _tick = tick; + uint128 _liquidity = liquidity; + uint16 _index = index; + uint16 _cardinality = cardinality; + uint16 _cardinalityNext = cardinalityNext; + uint32 _time = time; + + for (uint256 i = 0; i < params.length; i++) { + _time += params[i].advanceTimeBy; + (_index, _cardinality) = observations.write( + _index, + _time, + _tick, + _liquidity, + _cardinality, + _cardinalityNext + ); + _tick = params[i].tick; + _liquidity = params[i].liquidity; + } + + // sstore everything + tick = _tick; + liquidity = _liquidity; + index = _index; + cardinality = _cardinality; + time = _time; + } + + function grow(uint16 _cardinalityNext) external { + cardinalityNext = observations.grow(cardinalityNext, _cardinalityNext); + } + + function observe(uint32[] calldata secondsAgos) + external + view + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) + { + return observations.observe(time, secondsAgos, tick, index, liquidity, cardinality); + } + + function getGasCostOfObserve(uint32[] calldata secondsAgos) external view returns (uint256) { + (uint32 _time, int24 _tick, uint128 _liquidity, uint16 _index) = (time, tick, liquidity, index); + uint256 gasBefore = gasleft(); + observations.observe(_time, secondsAgos, _tick, _index, _liquidity, cardinality); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol b/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol new file mode 100644 index 0000000..48010d9 --- /dev/null +++ b/lib/v3-core/contracts/test/SqrtPriceMathEchidnaTest.sol @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/FullMath.sol'; +import '../libraries/SqrtPriceMath.sol'; +import '../libraries/FixedPoint96.sol'; + +contract SqrtPriceMathEchidnaTest { + function mulDivRoundingUpInvariants( + uint256 x, + uint256 y, + uint256 z + ) external pure { + require(z > 0); + uint256 notRoundedUp = FullMath.mulDiv(x, y, z); + uint256 roundedUp = FullMath.mulDivRoundingUp(x, y, z); + assert(roundedUp >= notRoundedUp); + assert(roundedUp - notRoundedUp < 2); + if (roundedUp - notRoundedUp == 1) { + assert(mulmod(x, y, z) > 0); + } else { + assert(mulmod(x, y, z) == 0); + } + } + + function getNextSqrtPriceFromInputInvariants( + uint160 sqrtP, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) external pure { + uint160 sqrtQ = SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); + + if (zeroForOne) { + assert(sqrtQ <= sqrtP); + assert(amountIn >= SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true)); + } else { + assert(sqrtQ >= sqrtP); + assert(amountIn >= SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, true)); + } + } + + function getNextSqrtPriceFromOutputInvariants( + uint160 sqrtP, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) external pure { + uint160 sqrtQ = SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); + + if (zeroForOne) { + assert(sqrtQ <= sqrtP); + assert(amountOut <= SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, false)); + } else { + assert(sqrtQ > 0); // this has to be true, otherwise we need another require + assert(sqrtQ >= sqrtP); + assert(amountOut <= SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, false)); + } + } + + function getNextSqrtPriceFromAmount0RoundingUpInvariants( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) external pure { + require(sqrtPX96 > 0); + require(liquidity > 0); + uint160 sqrtQX96 = SqrtPriceMath.getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amount, add); + + if (add) { + assert(sqrtQX96 <= sqrtPX96); + } else { + assert(sqrtQX96 >= sqrtPX96); + } + + if (amount == 0) { + assert(sqrtPX96 == sqrtQX96); + } + } + + function getNextSqrtPriceFromAmount1RoundingDownInvariants( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) external pure { + require(sqrtPX96 > 0); + require(liquidity > 0); + uint160 sqrtQX96 = SqrtPriceMath.getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amount, add); + + if (add) { + assert(sqrtQX96 >= sqrtPX96); + } else { + assert(sqrtQX96 <= sqrtPX96); + } + + if (amount == 0) { + assert(sqrtPX96 == sqrtQX96); + } + } + + function getAmount0DeltaInvariants( + uint160 sqrtP, + uint160 sqrtQ, + uint128 liquidity + ) external pure { + require(sqrtP > 0 && sqrtQ > 0); + + uint256 amount0Down = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, false); + assert(amount0Down == SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, false)); + + uint256 amount0Up = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true); + assert(amount0Up == SqrtPriceMath.getAmount0Delta(sqrtP, sqrtQ, liquidity, true)); + + assert(amount0Down <= amount0Up); + // diff is 0 or 1 + assert(amount0Up - amount0Down < 2); + } + + // ensure that chained division is always equal to the full-precision case for + // liquidity * (sqrt(P) - sqrt(Q)) / (sqrt(P) * sqrt(Q)) + function getAmount0DeltaEquivalency( + uint160 sqrtP, + uint160 sqrtQ, + uint128 liquidity, + bool roundUp + ) external pure { + require(sqrtP >= sqrtQ); + require(sqrtP > 0 && sqrtQ > 0); + require((sqrtP * sqrtQ) / sqrtP == sqrtQ); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtP - sqrtQ; + uint256 denominator = uint256(sqrtP) * sqrtQ; + + uint256 safeResult = + roundUp + ? FullMath.mulDivRoundingUp(numerator1, numerator2, denominator) + : FullMath.mulDiv(numerator1, numerator2, denominator); + uint256 fullResult = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, roundUp); + + assert(safeResult == fullResult); + } + + function getAmount1DeltaInvariants( + uint160 sqrtP, + uint160 sqrtQ, + uint128 liquidity + ) external pure { + require(sqrtP > 0 && sqrtQ > 0); + + uint256 amount1Down = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, false); + assert(amount1Down == SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, false)); + + uint256 amount1Up = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity, true); + assert(amount1Up == SqrtPriceMath.getAmount1Delta(sqrtQ, sqrtP, liquidity, true)); + + assert(amount1Down <= amount1Up); + // diff is 0 or 1 + assert(amount1Up - amount1Down < 2); + } + + function getAmount0DeltaSignedInvariants( + uint160 sqrtP, + uint160 sqrtQ, + int128 liquidity + ) external pure { + require(sqrtP > 0 && sqrtQ > 0); + + int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity); + if (liquidity < 0) assert(amount0 <= 0); + if (liquidity > 0) { + if (sqrtP == sqrtQ) assert(amount0 == 0); + else assert(amount0 > 0); + } + if (liquidity == 0) assert(amount0 == 0); + } + + function getAmount1DeltaSignedInvariants( + uint160 sqrtP, + uint160 sqrtQ, + int128 liquidity + ) external pure { + require(sqrtP > 0 && sqrtQ > 0); + + int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtP, sqrtQ, liquidity); + if (liquidity < 0) assert(amount1 <= 0); + if (liquidity > 0) { + if (sqrtP == sqrtQ) assert(amount1 == 0); + else assert(amount1 > 0); + } + if (liquidity == 0) assert(amount1 == 0); + } + + function getOutOfRangeMintInvariants( + uint160 sqrtA, + uint160 sqrtB, + int128 liquidity + ) external pure { + require(sqrtA > 0 && sqrtB > 0); + require(liquidity > 0); + + int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtA, sqrtB, liquidity); + int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtA, sqrtB, liquidity); + + if (sqrtA == sqrtB) { + assert(amount0 == 0); + assert(amount1 == 0); + } else { + assert(amount0 > 0); + assert(amount1 > 0); + } + } + + function getInRangeMintInvariants( + uint160 sqrtLower, + uint160 sqrtCurrent, + uint160 sqrtUpper, + int128 liquidity + ) external pure { + require(sqrtLower > 0); + require(sqrtLower < sqrtUpper); + require(sqrtLower <= sqrtCurrent && sqrtCurrent <= sqrtUpper); + require(liquidity > 0); + + int256 amount0 = SqrtPriceMath.getAmount0Delta(sqrtCurrent, sqrtUpper, liquidity); + int256 amount1 = SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtCurrent, liquidity); + + assert(amount0 > 0 || amount1 > 0); + } +} diff --git a/lib/v3-core/contracts/test/SqrtPriceMathTest.sol b/lib/v3-core/contracts/test/SqrtPriceMathTest.sol new file mode 100644 index 0000000..41fec2f --- /dev/null +++ b/lib/v3-core/contracts/test/SqrtPriceMathTest.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/SqrtPriceMath.sol'; + +contract SqrtPriceMathTest { + function getNextSqrtPriceFromInput( + uint160 sqrtP, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) external pure returns (uint160 sqrtQ) { + return SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); + } + + function getGasCostOfGetNextSqrtPriceFromInput( + uint160 sqrtP, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + SqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne); + return gasBefore - gasleft(); + } + + function getNextSqrtPriceFromOutput( + uint160 sqrtP, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) external pure returns (uint160 sqrtQ) { + return SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); + } + + function getGasCostOfGetNextSqrtPriceFromOutput( + uint160 sqrtP, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + SqrtPriceMath.getNextSqrtPriceFromOutput(sqrtP, liquidity, amountOut, zeroForOne); + return gasBefore - gasleft(); + } + + function getAmount0Delta( + uint160 sqrtLower, + uint160 sqrtUpper, + uint128 liquidity, + bool roundUp + ) external pure returns (uint256 amount0) { + return SqrtPriceMath.getAmount0Delta(sqrtLower, sqrtUpper, liquidity, roundUp); + } + + function getAmount1Delta( + uint160 sqrtLower, + uint160 sqrtUpper, + uint128 liquidity, + bool roundUp + ) external pure returns (uint256 amount1) { + return SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtUpper, liquidity, roundUp); + } + + function getGasCostOfGetAmount0Delta( + uint160 sqrtLower, + uint160 sqrtUpper, + uint128 liquidity, + bool roundUp + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + SqrtPriceMath.getAmount0Delta(sqrtLower, sqrtUpper, liquidity, roundUp); + return gasBefore - gasleft(); + } + + function getGasCostOfGetAmount1Delta( + uint160 sqrtLower, + uint160 sqrtUpper, + uint128 liquidity, + bool roundUp + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + SqrtPriceMath.getAmount1Delta(sqrtLower, sqrtUpper, liquidity, roundUp); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol b/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol new file mode 100644 index 0000000..67bf861 --- /dev/null +++ b/lib/v3-core/contracts/test/SwapMathEchidnaTest.sol @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/SwapMath.sol'; + +contract SwapMathEchidnaTest { + function checkComputeSwapStepInvariants( + uint160 sqrtPriceRaw, + uint160 sqrtPriceTargetRaw, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) external pure { + require(sqrtPriceRaw > 0); + require(sqrtPriceTargetRaw > 0); + require(feePips > 0); + require(feePips < 1e6); + + (uint160 sqrtQ, uint256 amountIn, uint256 amountOut, uint256 feeAmount) = + SwapMath.computeSwapStep(sqrtPriceRaw, sqrtPriceTargetRaw, liquidity, amountRemaining, feePips); + + assert(amountIn <= type(uint256).max - feeAmount); + + if (amountRemaining < 0) { + assert(amountOut <= uint256(-amountRemaining)); + } else { + assert(amountIn + feeAmount <= uint256(amountRemaining)); + } + + if (sqrtPriceRaw == sqrtPriceTargetRaw) { + assert(amountIn == 0); + assert(amountOut == 0); + assert(feeAmount == 0); + assert(sqrtQ == sqrtPriceTargetRaw); + } + + // didn't reach price target, entire amount must be consumed + if (sqrtQ != sqrtPriceTargetRaw) { + if (amountRemaining < 0) assert(amountOut == uint256(-amountRemaining)); + else assert(amountIn + feeAmount == uint256(amountRemaining)); + } + + // next price is between price and price target + if (sqrtPriceTargetRaw <= sqrtPriceRaw) { + assert(sqrtQ <= sqrtPriceRaw); + assert(sqrtQ >= sqrtPriceTargetRaw); + } else { + assert(sqrtQ >= sqrtPriceRaw); + assert(sqrtQ <= sqrtPriceTargetRaw); + } + } +} diff --git a/lib/v3-core/contracts/test/SwapMathTest.sol b/lib/v3-core/contracts/test/SwapMathTest.sol new file mode 100644 index 0000000..b0f59df --- /dev/null +++ b/lib/v3-core/contracts/test/SwapMathTest.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/SwapMath.sol'; + +contract SwapMathTest { + function computeSwapStep( + uint160 sqrtP, + uint160 sqrtPTarget, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) + external + pure + returns ( + uint160 sqrtQ, + uint256 amountIn, + uint256 amountOut, + uint256 feeAmount + ) + { + return SwapMath.computeSwapStep(sqrtP, sqrtPTarget, liquidity, amountRemaining, feePips); + } + + function getGasCostOfComputeSwapStep( + uint160 sqrtP, + uint160 sqrtPTarget, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + SwapMath.computeSwapStep(sqrtP, sqrtPTarget, liquidity, amountRemaining, feePips); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-core/contracts/test/TestERC20.sol b/lib/v3-core/contracts/test/TestERC20.sol new file mode 100644 index 0000000..411e0ea --- /dev/null +++ b/lib/v3-core/contracts/test/TestERC20.sol @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/IERC20Minimal.sol'; + +contract TestERC20 is IERC20Minimal { + mapping(address => uint256) public override balanceOf; + mapping(address => mapping(address => uint256)) public override allowance; + + constructor(uint256 amountToMint) { + mint(msg.sender, amountToMint); + } + + function mint(address to, uint256 amount) public { + uint256 balanceNext = balanceOf[to] + amount; + require(balanceNext >= amount, 'overflow balance'); + balanceOf[to] = balanceNext; + } + + function transfer(address recipient, uint256 amount) external override returns (bool) { + uint256 balanceBefore = balanceOf[msg.sender]; + require(balanceBefore >= amount, 'insufficient balance'); + balanceOf[msg.sender] = balanceBefore - amount; + + uint256 balanceRecipient = balanceOf[recipient]; + require(balanceRecipient + amount >= balanceRecipient, 'recipient balance overflow'); + balanceOf[recipient] = balanceRecipient + amount; + + emit Transfer(msg.sender, recipient, amount); + return true; + } + + function approve(address spender, uint256 amount) external override returns (bool) { + allowance[msg.sender][spender] = amount; + emit Approval(msg.sender, spender, amount); + return true; + } + + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external override returns (bool) { + uint256 allowanceBefore = allowance[sender][msg.sender]; + require(allowanceBefore >= amount, 'allowance insufficient'); + + allowance[sender][msg.sender] = allowanceBefore - amount; + + uint256 balanceRecipient = balanceOf[recipient]; + require(balanceRecipient + amount >= balanceRecipient, 'overflow balance recipient'); + balanceOf[recipient] = balanceRecipient + amount; + uint256 balanceSender = balanceOf[sender]; + require(balanceSender >= amount, 'underflow balance sender'); + balanceOf[sender] = balanceSender - amount; + + emit Transfer(sender, recipient, amount); + return true; + } +} diff --git a/lib/v3-core/contracts/test/TestUniswapV3Callee.sol b/lib/v3-core/contracts/test/TestUniswapV3Callee.sol new file mode 100644 index 0000000..b569935 --- /dev/null +++ b/lib/v3-core/contracts/test/TestUniswapV3Callee.sol @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/IERC20Minimal.sol'; + +import '../libraries/SafeCast.sol'; +import '../libraries/TickMath.sol'; + +import '../interfaces/callback/IUniswapV3MintCallback.sol'; +import '../interfaces/callback/IUniswapV3SwapCallback.sol'; +import '../interfaces/callback/IUniswapV3FlashCallback.sol'; + +import '../interfaces/IUniswapV3Pool.sol'; + +contract TestUniswapV3Callee is IUniswapV3MintCallback, IUniswapV3SwapCallback, IUniswapV3FlashCallback { + using SafeCast for uint256; + + function swapExact0For1( + address pool, + uint256 amount0In, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, true, amount0In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swap0ForExact1( + address pool, + uint256 amount1Out, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, true, -amount1Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swapExact1For0( + address pool, + uint256 amount1In, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, false, amount1In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swap1ForExact0( + address pool, + uint256 amount0Out, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, false, -amount0Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swapToLowerSqrtPrice( + address pool, + uint160 sqrtPriceX96, + address recipient + ) external { + IUniswapV3Pool(pool).swap(recipient, true, type(int256).max, sqrtPriceX96, abi.encode(msg.sender)); + } + + function swapToHigherSqrtPrice( + address pool, + uint160 sqrtPriceX96, + address recipient + ) external { + IUniswapV3Pool(pool).swap(recipient, false, type(int256).max, sqrtPriceX96, abi.encode(msg.sender)); + } + + event SwapCallback(int256 amount0Delta, int256 amount1Delta); + + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external override { + address sender = abi.decode(data, (address)); + + emit SwapCallback(amount0Delta, amount1Delta); + + if (amount0Delta > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(amount0Delta)); + } else if (amount1Delta > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(amount1Delta)); + } else { + // if both are not gt 0, both must be 0. + assert(amount0Delta == 0 && amount1Delta == 0); + } + } + + function mint( + address pool, + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external { + IUniswapV3Pool(pool).mint(recipient, tickLower, tickUpper, amount, abi.encode(msg.sender)); + } + + event MintCallback(uint256 amount0Owed, uint256 amount1Owed); + + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external override { + address sender = abi.decode(data, (address)); + + emit MintCallback(amount0Owed, amount1Owed); + if (amount0Owed > 0) + IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, amount0Owed); + if (amount1Owed > 0) + IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, amount1Owed); + } + + event FlashCallback(uint256 fee0, uint256 fee1); + + function flash( + address pool, + address recipient, + uint256 amount0, + uint256 amount1, + uint256 pay0, + uint256 pay1 + ) external { + IUniswapV3Pool(pool).flash(recipient, amount0, amount1, abi.encode(msg.sender, pay0, pay1)); + } + + function uniswapV3FlashCallback( + uint256 fee0, + uint256 fee1, + bytes calldata data + ) external override { + emit FlashCallback(fee0, fee1); + + (address sender, uint256 pay0, uint256 pay1) = abi.decode(data, (address, uint256, uint256)); + + if (pay0 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, pay0); + if (pay1 > 0) IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, pay1); + } +} diff --git a/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol b/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol new file mode 100644 index 0000000..fbd0b2a --- /dev/null +++ b/lib/v3-core/contracts/test/TestUniswapV3ReentrantCallee.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/TickMath.sol'; + +import '../interfaces/callback/IUniswapV3SwapCallback.sol'; + +import '../interfaces/IUniswapV3Pool.sol'; + +contract TestUniswapV3ReentrantCallee is IUniswapV3SwapCallback { + string private constant expectedReason = 'LOK'; + + function swapToReenter(address pool) external { + IUniswapV3Pool(pool).swap(address(0), false, 1, TickMath.MAX_SQRT_RATIO - 1, new bytes(0)); + } + + function uniswapV3SwapCallback( + int256, + int256, + bytes calldata + ) external override { + // try to reenter swap + try IUniswapV3Pool(msg.sender).swap(address(0), false, 1, 0, new bytes(0)) {} catch Error( + string memory reason + ) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + // try to reenter mint + try IUniswapV3Pool(msg.sender).mint(address(0), 0, 0, 0, new bytes(0)) {} catch Error(string memory reason) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + // try to reenter collect + try IUniswapV3Pool(msg.sender).collect(address(0), 0, 0, 0, 0) {} catch Error(string memory reason) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + // try to reenter burn + try IUniswapV3Pool(msg.sender).burn(0, 0, 0) {} catch Error(string memory reason) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + // try to reenter flash + try IUniswapV3Pool(msg.sender).flash(address(0), 0, 0, new bytes(0)) {} catch Error(string memory reason) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + // try to reenter collectProtocol + try IUniswapV3Pool(msg.sender).collectProtocol(address(0), 0, 0) {} catch Error(string memory reason) { + require(keccak256(abi.encode(reason)) == keccak256(abi.encode(expectedReason))); + } + + require(false, 'Unable to reenter'); + } +} diff --git a/lib/v3-core/contracts/test/TestUniswapV3Router.sol b/lib/v3-core/contracts/test/TestUniswapV3Router.sol new file mode 100644 index 0000000..8f916dd --- /dev/null +++ b/lib/v3-core/contracts/test/TestUniswapV3Router.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/SafeCast.sol'; +import '../libraries/TickMath.sol'; + +import '../interfaces/IERC20Minimal.sol'; +import '../interfaces/callback/IUniswapV3SwapCallback.sol'; +import '../interfaces/IUniswapV3Pool.sol'; + +contract TestUniswapV3Router is IUniswapV3SwapCallback { + using SafeCast for uint256; + + // flash swaps for an exact amount of token0 in the output pool + function swapForExact0Multi( + address recipient, + address poolInput, + address poolOutput, + uint256 amount0Out + ) external { + address[] memory pools = new address[](1); + pools[0] = poolInput; + IUniswapV3Pool(poolOutput).swap( + recipient, + false, + -amount0Out.toInt256(), + TickMath.MAX_SQRT_RATIO - 1, + abi.encode(pools, msg.sender) + ); + } + + // flash swaps for an exact amount of token1 in the output pool + function swapForExact1Multi( + address recipient, + address poolInput, + address poolOutput, + uint256 amount1Out + ) external { + address[] memory pools = new address[](1); + pools[0] = poolInput; + IUniswapV3Pool(poolOutput).swap( + recipient, + true, + -amount1Out.toInt256(), + TickMath.MIN_SQRT_RATIO + 1, + abi.encode(pools, msg.sender) + ); + } + + event SwapCallback(int256 amount0Delta, int256 amount1Delta); + + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) public override { + emit SwapCallback(amount0Delta, amount1Delta); + + (address[] memory pools, address payer) = abi.decode(data, (address[], address)); + + if (pools.length == 1) { + // get the address and amount of the token that we need to pay + address tokenToBePaid = + amount0Delta > 0 ? IUniswapV3Pool(msg.sender).token0() : IUniswapV3Pool(msg.sender).token1(); + int256 amountToBePaid = amount0Delta > 0 ? amount0Delta : amount1Delta; + + bool zeroForOne = tokenToBePaid == IUniswapV3Pool(pools[0]).token1(); + IUniswapV3Pool(pools[0]).swap( + msg.sender, + zeroForOne, + -amountToBePaid, + zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1, + abi.encode(new address[](0), payer) + ); + } else { + if (amount0Delta > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom( + payer, + msg.sender, + uint256(amount0Delta) + ); + } else { + IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom( + payer, + msg.sender, + uint256(amount1Delta) + ); + } + } + } +} diff --git a/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol b/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol new file mode 100644 index 0000000..0a78c88 --- /dev/null +++ b/lib/v3-core/contracts/test/TestUniswapV3SwapPay.sol @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/IERC20Minimal.sol'; + +import '../interfaces/callback/IUniswapV3SwapCallback.sol'; +import '../interfaces/IUniswapV3Pool.sol'; + +contract TestUniswapV3SwapPay is IUniswapV3SwapCallback { + function swap( + address pool, + address recipient, + bool zeroForOne, + uint160 sqrtPriceX96, + int256 amountSpecified, + uint256 pay0, + uint256 pay1 + ) external { + IUniswapV3Pool(pool).swap( + recipient, + zeroForOne, + amountSpecified, + sqrtPriceX96, + abi.encode(msg.sender, pay0, pay1) + ); + } + + function uniswapV3SwapCallback( + int256, + int256, + bytes calldata data + ) external override { + (address sender, uint256 pay0, uint256 pay1) = abi.decode(data, (address, uint256, uint256)); + + if (pay0 > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(pay0)); + } else if (pay1 > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(pay1)); + } + } +} diff --git a/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol b/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol new file mode 100644 index 0000000..675798a --- /dev/null +++ b/lib/v3-core/contracts/test/TickBitmapEchidnaTest.sol @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/TickBitmap.sol'; + +contract TickBitmapEchidnaTest { + using TickBitmap for mapping(int16 => uint256); + + mapping(int16 => uint256) private bitmap; + + // returns whether the given tick is initialized + function isInitialized(int24 tick) private view returns (bool) { + (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, true); + return next == tick ? initialized : false; + } + + function flipTick(int24 tick) external { + bool before = isInitialized(tick); + bitmap.flipTick(tick, 1); + assert(isInitialized(tick) == !before); + } + + function checkNextInitializedTickWithinOneWordInvariants(int24 tick, bool lte) external view { + (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); + if (lte) { + // type(int24).min + 256 + require(tick >= -8388352); + assert(next <= tick); + assert(tick - next < 256); + // all the ticks between the input tick and the next tick should be uninitialized + for (int24 i = tick; i > next; i--) { + assert(!isInitialized(i)); + } + assert(isInitialized(next) == initialized); + } else { + // type(int24).max - 256 + require(tick < 8388351); + assert(next > tick); + assert(next - tick <= 256); + // all the ticks between the input tick and the next tick should be uninitialized + for (int24 i = tick + 1; i < next; i++) { + assert(!isInitialized(i)); + } + assert(isInitialized(next) == initialized); + } + } +} diff --git a/lib/v3-core/contracts/test/TickBitmapTest.sol b/lib/v3-core/contracts/test/TickBitmapTest.sol new file mode 100644 index 0000000..c6fb6b0 --- /dev/null +++ b/lib/v3-core/contracts/test/TickBitmapTest.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/TickBitmap.sol'; + +contract TickBitmapTest { + using TickBitmap for mapping(int16 => uint256); + + mapping(int16 => uint256) public bitmap; + + function flipTick(int24 tick) external { + bitmap.flipTick(tick, 1); + } + + function getGasCostOfFlipTick(int24 tick) external returns (uint256) { + uint256 gasBefore = gasleft(); + bitmap.flipTick(tick, 1); + return gasBefore - gasleft(); + } + + function nextInitializedTickWithinOneWord(int24 tick, bool lte) + external + view + returns (int24 next, bool initialized) + { + return bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); + } + + function getGasCostOfNextInitializedTickWithinOneWord(int24 tick, bool lte) external view returns (uint256) { + uint256 gasBefore = gasleft(); + bitmap.nextInitializedTickWithinOneWord(tick, 1, lte); + return gasBefore - gasleft(); + } + + // returns whether the given tick is initialized + function isInitialized(int24 tick) external view returns (bool) { + (int24 next, bool initialized) = bitmap.nextInitializedTickWithinOneWord(tick, 1, true); + return next == tick ? initialized : false; + } +} diff --git a/lib/v3-core/contracts/test/TickEchidnaTest.sol b/lib/v3-core/contracts/test/TickEchidnaTest.sol new file mode 100644 index 0000000..1d5514f --- /dev/null +++ b/lib/v3-core/contracts/test/TickEchidnaTest.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/Tick.sol'; + +contract TickEchidnaTest { + function checkTickSpacingToParametersInvariants(int24 tickSpacing) external pure { + require(tickSpacing <= TickMath.MAX_TICK); + require(tickSpacing > 0); + + int24 minTick = (TickMath.MIN_TICK / tickSpacing) * tickSpacing; + int24 maxTick = (TickMath.MAX_TICK / tickSpacing) * tickSpacing; + + uint128 maxLiquidityPerTick = Tick.tickSpacingToMaxLiquidityPerTick(tickSpacing); + + // symmetry around 0 tick + assert(maxTick == -minTick); + // positive max tick + assert(maxTick > 0); + // divisibility + assert((maxTick - minTick) % tickSpacing == 0); + + uint256 numTicks = uint256((maxTick - minTick) / tickSpacing) + 1; + // max liquidity at every tick is less than the cap + assert(uint256(maxLiquidityPerTick) * numTicks <= type(uint128).max); + } +} diff --git a/lib/v3-core/contracts/test/TickMathEchidnaTest.sol b/lib/v3-core/contracts/test/TickMathEchidnaTest.sol new file mode 100644 index 0000000..91064b0 --- /dev/null +++ b/lib/v3-core/contracts/test/TickMathEchidnaTest.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/TickMath.sol'; + +contract TickMathEchidnaTest { + // uniqueness and increasing order + function checkGetSqrtRatioAtTickInvariants(int24 tick) external pure { + uint160 ratio = TickMath.getSqrtRatioAtTick(tick); + assert(TickMath.getSqrtRatioAtTick(tick - 1) < ratio && ratio < TickMath.getSqrtRatioAtTick(tick + 1)); + assert(ratio >= TickMath.MIN_SQRT_RATIO); + assert(ratio <= TickMath.MAX_SQRT_RATIO); + } + + // the ratio is always between the returned tick and the returned tick+1 + function checkGetTickAtSqrtRatioInvariants(uint160 ratio) external pure { + int24 tick = TickMath.getTickAtSqrtRatio(ratio); + assert(ratio >= TickMath.getSqrtRatioAtTick(tick) && ratio < TickMath.getSqrtRatioAtTick(tick + 1)); + assert(tick >= TickMath.MIN_TICK); + assert(tick < TickMath.MAX_TICK); + } +} diff --git a/lib/v3-core/contracts/test/TickMathTest.sol b/lib/v3-core/contracts/test/TickMathTest.sol new file mode 100644 index 0000000..2816e57 --- /dev/null +++ b/lib/v3-core/contracts/test/TickMathTest.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/TickMath.sol'; + +contract TickMathTest { + function getSqrtRatioAtTick(int24 tick) external pure returns (uint160) { + return TickMath.getSqrtRatioAtTick(tick); + } + + function getGasCostOfGetSqrtRatioAtTick(int24 tick) external view returns (uint256) { + uint256 gasBefore = gasleft(); + TickMath.getSqrtRatioAtTick(tick); + return gasBefore - gasleft(); + } + + function getTickAtSqrtRatio(uint160 sqrtPriceX96) external pure returns (int24) { + return TickMath.getTickAtSqrtRatio(sqrtPriceX96); + } + + function getGasCostOfGetTickAtSqrtRatio(uint160 sqrtPriceX96) external view returns (uint256) { + uint256 gasBefore = gasleft(); + TickMath.getTickAtSqrtRatio(sqrtPriceX96); + return gasBefore - gasleft(); + } + + function MIN_SQRT_RATIO() external pure returns (uint160) { + return TickMath.MIN_SQRT_RATIO; + } + + function MAX_SQRT_RATIO() external pure returns (uint160) { + return TickMath.MAX_SQRT_RATIO; + } +} diff --git a/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol b/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol new file mode 100644 index 0000000..fcda269 --- /dev/null +++ b/lib/v3-core/contracts/test/TickOverflowSafetyEchidnaTest.sol @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/Tick.sol'; + +contract TickOverflowSafetyEchidnaTest { + using Tick for mapping(int24 => Tick.Info); + + int24 private constant MIN_TICK = -16; + int24 private constant MAX_TICK = 16; + uint128 private constant MAX_LIQUIDITY = type(uint128).max / 32; + + mapping(int24 => Tick.Info) private ticks; + int24 private tick = 0; + + // used to track how much total liquidity has been added. should never be negative + int256 totalLiquidity = 0; + // half the cap of fee growth has happened, this can overflow + uint256 private feeGrowthGlobal0X128 = type(uint256).max / 2; + uint256 private feeGrowthGlobal1X128 = type(uint256).max / 2; + // how much total growth has happened, this cannot overflow + uint256 private totalGrowth0 = 0; + uint256 private totalGrowth1 = 0; + + function increaseFeeGrowthGlobal0X128(uint256 amount) external { + require(totalGrowth0 + amount > totalGrowth0); // overflow check + feeGrowthGlobal0X128 += amount; // overflow desired + totalGrowth0 += amount; + } + + function increaseFeeGrowthGlobal1X128(uint256 amount) external { + require(totalGrowth1 + amount > totalGrowth1); // overflow check + feeGrowthGlobal1X128 += amount; // overflow desired + totalGrowth1 += amount; + } + + function setPosition( + int24 tickLower, + int24 tickUpper, + int128 liquidityDelta + ) external { + require(tickLower > MIN_TICK); + require(tickUpper < MAX_TICK); + require(tickLower < tickUpper); + bool flippedLower = + ticks.update( + tickLower, + tick, + liquidityDelta, + feeGrowthGlobal0X128, + feeGrowthGlobal1X128, + 0, + 0, + uint32(block.timestamp), + false, + MAX_LIQUIDITY + ); + bool flippedUpper = + ticks.update( + tickUpper, + tick, + liquidityDelta, + feeGrowthGlobal0X128, + feeGrowthGlobal1X128, + 0, + 0, + uint32(block.timestamp), + true, + MAX_LIQUIDITY + ); + + if (flippedLower) { + if (liquidityDelta < 0) { + assert(ticks[tickLower].liquidityGross == 0); + ticks.clear(tickLower); + } else assert(ticks[tickLower].liquidityGross > 0); + } + + if (flippedUpper) { + if (liquidityDelta < 0) { + assert(ticks[tickUpper].liquidityGross == 0); + ticks.clear(tickUpper); + } else assert(ticks[tickUpper].liquidityGross > 0); + } + + totalLiquidity += liquidityDelta; + // requires should have prevented this + assert(totalLiquidity >= 0); + + if (totalLiquidity == 0) { + totalGrowth0 = 0; + totalGrowth1 = 0; + } + } + + function moveToTick(int24 target) external { + require(target > MIN_TICK); + require(target < MAX_TICK); + while (tick != target) { + if (tick < target) { + if (ticks[tick + 1].liquidityGross > 0) + ticks.cross(tick + 1, feeGrowthGlobal0X128, feeGrowthGlobal1X128, 0, 0, uint32(block.timestamp)); + tick++; + } else { + if (ticks[tick].liquidityGross > 0) + ticks.cross(tick, feeGrowthGlobal0X128, feeGrowthGlobal1X128, 0, 0, uint32(block.timestamp)); + tick--; + } + } + } +} diff --git a/lib/v3-core/contracts/test/TickTest.sol b/lib/v3-core/contracts/test/TickTest.sol new file mode 100644 index 0000000..d9fa7cb --- /dev/null +++ b/lib/v3-core/contracts/test/TickTest.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../libraries/Tick.sol'; + +contract TickTest { + using Tick for mapping(int24 => Tick.Info); + + mapping(int24 => Tick.Info) public ticks; + + function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) external pure returns (uint128) { + return Tick.tickSpacingToMaxLiquidityPerTick(tickSpacing); + } + + function setTick(int24 tick, Tick.Info memory info) external { + ticks[tick] = info; + } + + function getFeeGrowthInside( + int24 tickLower, + int24 tickUpper, + int24 tickCurrent, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128 + ) external view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { + return ticks.getFeeGrowthInside(tickLower, tickUpper, tickCurrent, feeGrowthGlobal0X128, feeGrowthGlobal1X128); + } + + function update( + int24 tick, + int24 tickCurrent, + int128 liquidityDelta, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128, + uint160 secondsPerLiquidityCumulativeX128, + int56 tickCumulative, + uint32 time, + bool upper, + uint128 maxLiquidity + ) external returns (bool flipped) { + return + ticks.update( + tick, + tickCurrent, + liquidityDelta, + feeGrowthGlobal0X128, + feeGrowthGlobal1X128, + secondsPerLiquidityCumulativeX128, + tickCumulative, + time, + upper, + maxLiquidity + ); + } + + function clear(int24 tick) external { + ticks.clear(tick); + } + + function cross( + int24 tick, + uint256 feeGrowthGlobal0X128, + uint256 feeGrowthGlobal1X128, + uint160 secondsPerLiquidityCumulativeX128, + int56 tickCumulative, + uint32 time + ) external returns (int128 liquidityNet) { + return + ticks.cross( + tick, + feeGrowthGlobal0X128, + feeGrowthGlobal1X128, + secondsPerLiquidityCumulativeX128, + tickCumulative, + time + ); + } +} diff --git a/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol b/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol new file mode 100644 index 0000000..d1f900b --- /dev/null +++ b/lib/v3-core/contracts/test/UniswapV3PoolSwapTest.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/IERC20Minimal.sol'; + +import '../interfaces/callback/IUniswapV3SwapCallback.sol'; +import '../interfaces/IUniswapV3Pool.sol'; + +contract UniswapV3PoolSwapTest is IUniswapV3SwapCallback { + int256 private _amount0Delta; + int256 private _amount1Delta; + + function getSwapResult( + address pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) + external + returns ( + int256 amount0Delta, + int256 amount1Delta, + uint160 nextSqrtRatio + ) + { + (amount0Delta, amount1Delta) = IUniswapV3Pool(pool).swap( + address(0), + zeroForOne, + amountSpecified, + sqrtPriceLimitX96, + abi.encode(msg.sender) + ); + + (nextSqrtRatio, , , , , , ) = IUniswapV3Pool(pool).slot0(); + } + + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external override { + address sender = abi.decode(data, (address)); + + if (amount0Delta > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(amount0Delta)); + } else if (amount1Delta > 0) { + IERC20Minimal(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(amount1Delta)); + } + } +} diff --git a/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol b/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol new file mode 100644 index 0000000..0a44d7e --- /dev/null +++ b/lib/v3-core/contracts/test/UnsafeMathEchidnaTest.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/UnsafeMath.sol'; + +contract UnsafeMathEchidnaTest { + function checkDivRoundingUp(uint256 x, uint256 d) external pure { + require(d > 0); + uint256 z = UnsafeMath.divRoundingUp(x, d); + uint256 diff = z - (x / d); + if (x % d == 0) { + assert(diff == 0); + } else { + assert(diff == 1); + } + } +} diff --git a/lib/v3-core/echidna.config.yml b/lib/v3-core/echidna.config.yml new file mode 100644 index 0000000..64a761d --- /dev/null +++ b/lib/v3-core/echidna.config.yml @@ -0,0 +1,74 @@ +#format can be "text" or "json" for different output (human or machine readable) +format: 'text' +#checkAsserts checks assertions +checkAsserts: true +#coverage controls coverage guided testing +coverage: false +# #psender is the sender for property transactions; by default intentionally +# #the same as contract deployer +# psender: "0x00a329c0648769a73afac7f9381e08fb43dbea70" +# #prefix is the prefix for Boolean functions that are properties to be checked +# prefix: "echidna_" +# #propMaxGas defines gas cost at which a property fails +# propMaxGas: 8000030 +# #testMaxGas is a gas limit; does not cause failure, but terminates sequence +# testMaxGas: 8000030 +# #maxGasprice is the maximum gas price +# maxGasprice: 100000000000 +# #testLimit is the number of test sequences to run +# testLimit: 50000 +# #stopOnFail makes echidna terminate as soon as any property fails and has been shrunk +# stopOnFail: false +# #estimateGas makes echidna perform analysis of maximum gas costs for functions (experimental) +# estimateGas: false +# #seqLen defines how many transactions are in a test sequence +# seqLen: 100 +# #shrinkLimit determines how much effort is spent shrinking failing sequences +# shrinkLimit: 5000 +# #contractAddr is the address of the contract itself +# contractAddr: "0x00a329c0648769a73afac7f9381e08fb43dbea72" +# #deployer is address of the contract deployer (who often is privileged owner, etc.) +# deployer: "0x00a329c0648769a73afac7f9381e08fb43dbea70" +# #sender is set of addresses transactions may originate from +# sender: ["0x10000", "0x20000", "0x00a329c0648769a73afac7f9381e08fb43dbea70"] +# #balanceAddr is default balance for addresses +# balanceAddr: 0xffffffff +# #balanceContract overrides balanceAddr for the contract address +# balanceContract: 0 +# #solcArgs allows special args to solc +# solcArgs: "" +# #solcLibs is solc libraries +# solcLibs: [] +# #cryticArgs allows special args to crytic +# cryticArgs: [] +# #quiet produces (much) less verbose output +# quiet: false +# #initialize the blockchain with some data +# initialize: null +# #whether ot not to use the multi-abi mode of testing +# multi-abi: false +# #benchmarkMode enables benchmark mode +# benchmarkMode: false +# #timeout controls test timeout settings +# timeout: null +# #seed not defined by default, is the random seed +# #seed: 0 +# #dictFreq controls how often to use echidna's internal dictionary vs random +# #values +# dictFreq: 0.40 +# maxTimeDelay: 604800 +# #maximum time between generated txs; default is one week +# maxBlockDelay: 60480 +# #maximum number of blocks elapsed between generated txs; default is expected increment in one week +# # timeout: +# #campaign timeout (in seconds) +# # list of methods to filter +# filterFunctions: [] +# # by default, blacklist methods in filterFunctions +# filterBlacklist: true +# #directory to save the corpus; by default is disabled +# corpusDir: null +# # constants for corpus mutations (for experimentation only) +# mutConsts: [100, 1, 1] +# # maximum value to send to payable functions +# maxValue: 100000000000000000000 # 100 eth diff --git a/lib/v3-core/hardhat.config.ts b/lib/v3-core/hardhat.config.ts new file mode 100644 index 0000000..1b0971b --- /dev/null +++ b/lib/v3-core/hardhat.config.ts @@ -0,0 +1,68 @@ +import 'hardhat-typechain' +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-waffle' +import '@nomiclabs/hardhat-etherscan' + +export default { + networks: { + hardhat: { + allowUnlimitedContractSize: false, + }, + mainnet: { + url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + ropsten: { + url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + rinkeby: { + url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + goerli: { + url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + kovan: { + url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + arbitrumRinkeby: { + url: `https://arbitrum-rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + arbitrum: { + url: `https://arbitrum-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + optimismKovan: { + url: `https://optimism-kovan.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + optimism: { + url: `https://optimism-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + mumbai: { + url: `https://polygon-mumbai.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + polygon: { + url: `https://polygon-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + bnb: { + url: `https://bsc-dataseed.binance.org/`, + }, + }, + etherscan: { + // Your API key for Etherscan + // Obtain one at https://etherscan.io/ + apiKey: process.env.ETHERSCAN_API_KEY, + }, + solidity: { + version: '0.7.6', + settings: { + optimizer: { + enabled: true, + runs: 800, + }, + metadata: { + // do not include the metadata hash, since this is machine dependent + // and we want all generated code to be deterministic + // https://docs.soliditylang.org/en/v0.7.6/metadata.html + bytecodeHash: 'none', + }, + }, + }, +} diff --git a/lib/v3-core/package.json b/lib/v3-core/package.json new file mode 100644 index 0000000..188721b --- /dev/null +++ b/lib/v3-core/package.json @@ -0,0 +1,59 @@ +{ + "name": "@uniswap/v3-core", + "description": "🦄 Core smart contracts of Uniswap V3", + "license": "BUSL-1.1", + "publishConfig": { + "access": "public" + }, + "version": "1.0.1", + "homepage": "https://uniswap.org", + "keywords": [ + "uniswap", + "core", + "v3" + ], + "repository": { + "type": "git", + "url": "https://github.com/Uniswap/uniswap-v3-core" + }, + "files": [ + "contracts/interfaces", + "contracts/libraries", + "artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json", + "artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json", + "artifacts/contracts/interfaces/**/*.json", + "!artifacts/contracts/interfaces/**/*.dbg.json" + ], + "engines": { + "node": ">=10" + }, + "dependencies": {}, + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.2", + "@nomiclabs/hardhat-etherscan": "^2.1.8", + "@nomiclabs/hardhat-waffle": "^2.0.1", + "@typechain/ethers-v5": "^4.0.0", + "@types/chai": "^4.2.6", + "@types/mocha": "^5.2.7", + "chai": "^4.2.0", + "decimal.js": "^10.2.1", + "ethereum-waffle": "^3.0.2", + "ethers": "^5.0.8", + "hardhat": "^2.2.0", + "hardhat-typechain": "^0.3.5", + "mocha": "^6.2.2", + "mocha-chai-jest-snapshot": "^1.1.0", + "prettier": "^2.0.5", + "prettier-plugin-solidity": "^1.0.0-alpha.59", + "solhint": "^3.2.1", + "solhint-plugin-prettier": "^0.0.5", + "ts-generator": "^0.1.1", + "ts-node": "^8.5.4", + "typechain": "^4.0.0", + "typescript": "^3.7.3" + }, + "scripts": { + "compile": "hardhat compile", + "test": "hardhat test" + } +} diff --git a/lib/v3-core/test/BitMath.spec.ts b/lib/v3-core/test/BitMath.spec.ts new file mode 100644 index 0000000..00b9285 --- /dev/null +++ b/lib/v3-core/test/BitMath.spec.ts @@ -0,0 +1,79 @@ +import { expect } from './shared/expect' +import { BitMathTest } from '../typechain/BitMathTest' +import { ethers, waffle } from 'hardhat' +import snapshotGasCost from './shared/snapshotGasCost' + +const { BigNumber } = ethers + +describe('BitMath', () => { + let bitMath: BitMathTest + const fixture = async () => { + const factory = await ethers.getContractFactory('BitMathTest') + return (await factory.deploy()) as BitMathTest + } + beforeEach('deploy BitMathTest', async () => { + bitMath = await waffle.loadFixture(fixture) + }) + + describe('#mostSignificantBit', () => { + it('0', async () => { + await expect(bitMath.mostSignificantBit(0)).to.be.reverted + }) + it('1', async () => { + expect(await bitMath.mostSignificantBit(1)).to.eq(0) + }) + it('2', async () => { + expect(await bitMath.mostSignificantBit(2)).to.eq(1) + }) + it('all powers of 2', async () => { + const results = await Promise.all( + [...Array(255)].map((_, i) => bitMath.mostSignificantBit(BigNumber.from(2).pow(i))) + ) + expect(results).to.deep.eq([...Array(255)].map((_, i) => i)) + }) + it('uint256(-1)', async () => { + expect(await bitMath.mostSignificantBit(BigNumber.from(2).pow(256).sub(1))).to.eq(255) + }) + + it('gas cost of smaller number', async () => { + await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(3568))) + }) + it('gas cost of max uint128', async () => { + await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(2).pow(128).sub(1))) + }) + it('gas cost of max uint256', async () => { + await snapshotGasCost(bitMath.getGasCostOfMostSignificantBit(BigNumber.from(2).pow(256).sub(1))) + }) + }) + + describe('#leastSignificantBit', () => { + it('0', async () => { + await expect(bitMath.leastSignificantBit(0)).to.be.reverted + }) + it('1', async () => { + expect(await bitMath.leastSignificantBit(1)).to.eq(0) + }) + it('2', async () => { + expect(await bitMath.leastSignificantBit(2)).to.eq(1) + }) + it('all powers of 2', async () => { + const results = await Promise.all( + [...Array(255)].map((_, i) => bitMath.leastSignificantBit(BigNumber.from(2).pow(i))) + ) + expect(results).to.deep.eq([...Array(255)].map((_, i) => i)) + }) + it('uint256(-1)', async () => { + expect(await bitMath.leastSignificantBit(BigNumber.from(2).pow(256).sub(1))).to.eq(0) + }) + + it('gas cost of smaller number', async () => { + await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(3568))) + }) + it('gas cost of max uint128', async () => { + await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(2).pow(128).sub(1))) + }) + it('gas cost of max uint256', async () => { + await snapshotGasCost(bitMath.getGasCostOfLeastSignificantBit(BigNumber.from(2).pow(256).sub(1))) + }) + }) +}) diff --git a/lib/v3-core/test/FullMath.spec.ts b/lib/v3-core/test/FullMath.spec.ts new file mode 100644 index 0000000..a7dfb92 --- /dev/null +++ b/lib/v3-core/test/FullMath.spec.ts @@ -0,0 +1,182 @@ +import { ethers } from 'hardhat' +import { FullMathTest } from '../typechain/FullMathTest' +import { expect } from './shared/expect' +import { Decimal } from 'decimal.js' + +const { + BigNumber, + constants: { MaxUint256 }, +} = ethers +const Q128 = BigNumber.from(2).pow(128) + +Decimal.config({ toExpNeg: -500, toExpPos: 500 }) + +describe('FullMath', () => { + let fullMath: FullMathTest + before('deploy FullMathTest', async () => { + const factory = await ethers.getContractFactory('FullMathTest') + fullMath = (await factory.deploy()) as FullMathTest + }) + + describe('#mulDiv', () => { + it('reverts if denominator is 0', async () => { + await expect(fullMath.mulDiv(Q128, 5, 0)).to.be.reverted + }) + it('reverts if denominator is 0 and numerator overflows', async () => { + await expect(fullMath.mulDiv(Q128, Q128, 0)).to.be.reverted + }) + it('reverts if output overflows uint256', async () => { + await expect(fullMath.mulDiv(Q128, Q128, 1)).to.be.reverted + }) + it('reverts if output overflows uint256', async () => { + await expect(fullMath.mulDiv(Q128, Q128, 1)).to.be.reverted + }) + it('reverts on overflow with all max inputs', async () => { + await expect(fullMath.mulDiv(MaxUint256, MaxUint256, MaxUint256.sub(1))).to.be.reverted + }) + + it('all max inputs', async () => { + expect(await fullMath.mulDiv(MaxUint256, MaxUint256, MaxUint256)).to.eq(MaxUint256) + }) + + it('accurate without phantom overflow', async () => { + const result = Q128.div(3) + expect( + await fullMath.mulDiv( + Q128, + /*0.5=*/ BigNumber.from(50).mul(Q128).div(100), + /*1.5=*/ BigNumber.from(150).mul(Q128).div(100) + ) + ).to.eq(result) + }) + + it('accurate with phantom overflow', async () => { + const result = BigNumber.from(4375).mul(Q128).div(1000) + expect(await fullMath.mulDiv(Q128, BigNumber.from(35).mul(Q128), BigNumber.from(8).mul(Q128))).to.eq(result) + }) + + it('accurate with phantom overflow and repeating decimal', async () => { + const result = BigNumber.from(1).mul(Q128).div(3) + expect(await fullMath.mulDiv(Q128, BigNumber.from(1000).mul(Q128), BigNumber.from(3000).mul(Q128))).to.eq(result) + }) + }) + + describe('#mulDivRoundingUp', () => { + it('reverts if denominator is 0', async () => { + await expect(fullMath.mulDivRoundingUp(Q128, 5, 0)).to.be.reverted + }) + it('reverts if denominator is 0 and numerator overflows', async () => { + await expect(fullMath.mulDivRoundingUp(Q128, Q128, 0)).to.be.reverted + }) + it('reverts if output overflows uint256', async () => { + await expect(fullMath.mulDivRoundingUp(Q128, Q128, 1)).to.be.reverted + }) + it('reverts on overflow with all max inputs', async () => { + await expect(fullMath.mulDivRoundingUp(MaxUint256, MaxUint256, MaxUint256.sub(1))).to.be.reverted + }) + + it('reverts if mulDiv overflows 256 bits after rounding up', async () => { + await expect( + fullMath.mulDivRoundingUp( + '535006138814359', + '432862656469423142931042426214547535783388063929571229938474969', + '2' + ) + ).to.be.reverted + }) + + it('reverts if mulDiv overflows 256 bits after rounding up case 2', async () => { + await expect( + fullMath.mulDivRoundingUp( + '115792089237316195423570985008687907853269984659341747863450311749907997002549', + '115792089237316195423570985008687907853269984659341747863450311749907997002550', + '115792089237316195423570985008687907853269984653042931687443039491902864365164' + ) + ).to.be.reverted + }) + + it('all max inputs', async () => { + expect(await fullMath.mulDivRoundingUp(MaxUint256, MaxUint256, MaxUint256)).to.eq(MaxUint256) + }) + + it('accurate without phantom overflow', async () => { + const result = Q128.div(3).add(1) + expect( + await fullMath.mulDivRoundingUp( + Q128, + /*0.5=*/ BigNumber.from(50).mul(Q128).div(100), + /*1.5=*/ BigNumber.from(150).mul(Q128).div(100) + ) + ).to.eq(result) + }) + + it('accurate with phantom overflow', async () => { + const result = BigNumber.from(4375).mul(Q128).div(1000) + expect(await fullMath.mulDivRoundingUp(Q128, BigNumber.from(35).mul(Q128), BigNumber.from(8).mul(Q128))).to.eq( + result + ) + }) + + it('accurate with phantom overflow and repeating decimal', async () => { + const result = BigNumber.from(1).mul(Q128).div(3).add(1) + expect( + await fullMath.mulDivRoundingUp(Q128, BigNumber.from(1000).mul(Q128), BigNumber.from(3000).mul(Q128)) + ).to.eq(result) + }) + }) + + function pseudoRandomBigNumber() { + return BigNumber.from(new Decimal(MaxUint256.toString()).mul(Math.random().toString()).round().toString()) + } + + // tiny fuzzer. unskip to run + it.skip('check a bunch of random inputs against JS implementation', async () => { + // generates random inputs + const tests = Array(1_000) + .fill(null) + .map(() => { + return { + x: pseudoRandomBigNumber(), + y: pseudoRandomBigNumber(), + d: pseudoRandomBigNumber(), + } + }) + .map(({ x, y, d }) => { + return { + input: { + x, + y, + d, + }, + floored: fullMath.mulDiv(x, y, d), + ceiled: fullMath.mulDivRoundingUp(x, y, d), + } + }) + + await Promise.all( + tests.map(async ({ input: { x, y, d }, floored, ceiled }) => { + if (d.eq(0)) { + await expect(floored).to.be.reverted + await expect(ceiled).to.be.reverted + return + } + + if (x.eq(0) || y.eq(0)) { + await expect(floored).to.eq(0) + await expect(ceiled).to.eq(0) + } else if (x.mul(y).div(d).gt(MaxUint256)) { + await expect(floored).to.be.reverted + await expect(ceiled).to.be.reverted + } else { + expect(await floored).to.eq(x.mul(y).div(d)) + expect(await ceiled).to.eq( + x + .mul(y) + .div(d) + .add(x.mul(y).mod(d).gt(0) ? 1 : 0) + ) + } + }) + ) + }) +}) diff --git a/lib/v3-core/test/LiquidityMath.spec.ts b/lib/v3-core/test/LiquidityMath.spec.ts new file mode 100644 index 0000000..76f6ac2 --- /dev/null +++ b/lib/v3-core/test/LiquidityMath.spec.ts @@ -0,0 +1,44 @@ +import { expect } from './shared/expect' +import { LiquidityMathTest } from '../typechain/LiquidityMathTest' +import { ethers, waffle } from 'hardhat' +import snapshotGasCost from './shared/snapshotGasCost' + +const { BigNumber } = ethers + +describe('LiquidityMath', () => { + let liquidityMath: LiquidityMathTest + const fixture = async () => { + const factory = await ethers.getContractFactory('LiquidityMathTest') + return (await factory.deploy()) as LiquidityMathTest + } + beforeEach('deploy LiquidityMathTest', async () => { + liquidityMath = await waffle.loadFixture(fixture) + }) + + describe('#addDelta', () => { + it('1 + 0', async () => { + expect(await liquidityMath.addDelta(1, 0)).to.eq(1) + }) + it('1 + -1', async () => { + expect(await liquidityMath.addDelta(1, -1)).to.eq(0) + }) + it('1 + 1', async () => { + expect(await liquidityMath.addDelta(1, 1)).to.eq(2) + }) + it('2**128-15 + 15 overflows', async () => { + await expect(liquidityMath.addDelta(BigNumber.from(2).pow(128).sub(15), 15)).to.be.revertedWith('LA') + }) + it('0 + -1 underflows', async () => { + await expect(liquidityMath.addDelta(0, -1)).to.be.revertedWith('LS') + }) + it('3 + -4 underflows', async () => { + await expect(liquidityMath.addDelta(3, -4)).to.be.revertedWith('LS') + }) + it('gas add', async () => { + await snapshotGasCost(liquidityMath.getGasCostOfAddDelta(15, 4)) + }) + it('gas sub', async () => { + await snapshotGasCost(liquidityMath.getGasCostOfAddDelta(15, -4)) + }) + }) +}) diff --git a/lib/v3-core/test/NoDelegateCall.spec.ts b/lib/v3-core/test/NoDelegateCall.spec.ts new file mode 100644 index 0000000..c46af93 --- /dev/null +++ b/lib/v3-core/test/NoDelegateCall.spec.ts @@ -0,0 +1,54 @@ +import { Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { NoDelegateCallTest } from '../typechain/NoDelegateCallTest' +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('NoDelegateCall', () => { + let wallet: Wallet, other: Wallet + + let loadFixture: ReturnType + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + loadFixture = waffle.createFixtureLoader([wallet, other]) + }) + + const noDelegateCallFixture = async () => { + const noDelegateCallTestFactory = await ethers.getContractFactory('NoDelegateCallTest') + const noDelegateCallTest = (await noDelegateCallTestFactory.deploy()) as NoDelegateCallTest + const minimalProxyFactory = new ethers.ContractFactory( + noDelegateCallTestFactory.interface, + `3d602d80600a3d3981f3363d3d373d3d3d363d73${noDelegateCallTest.address.slice(2)}5af43d82803e903d91602b57fd5bf3`, + wallet + ) + const proxy = (await minimalProxyFactory.deploy()) as NoDelegateCallTest + return { noDelegateCallTest, proxy } + } + + let base: NoDelegateCallTest + let proxy: NoDelegateCallTest + + beforeEach('deploy test contracts', async () => { + ;({ noDelegateCallTest: base, proxy } = await loadFixture(noDelegateCallFixture)) + }) + + it('runtime overhead', async () => { + await snapshotGasCost( + (await base.getGasCostOfCannotBeDelegateCalled()).sub(await base.getGasCostOfCanBeDelegateCalled()) + ) + }) + + it('proxy can call the method without the modifier', async () => { + await proxy.canBeDelegateCalled() + }) + it('proxy cannot call the method with the modifier', async () => { + await expect(proxy.cannotBeDelegateCalled()).to.be.reverted + }) + + it('can call the method that calls into a private method with the modifier', async () => { + await base.callsIntoNoDelegateCallFunction() + }) + it('proxy cannot call the method that calls a private method with the modifier', async () => { + await expect(proxy.callsIntoNoDelegateCallFunction()).to.be.reverted + }) +}) diff --git a/lib/v3-core/test/Oracle.spec.ts b/lib/v3-core/test/Oracle.spec.ts new file mode 100644 index 0000000..1a31d6f --- /dev/null +++ b/lib/v3-core/test/Oracle.spec.ts @@ -0,0 +1,798 @@ +import { BigNumber, BigNumberish, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { OracleTest } from '../typechain/OracleTest' +import checkObservationEquals from './shared/checkObservationEquals' +import { expect } from './shared/expect' +import { TEST_POOL_START_TIME } from './shared/fixtures' +import snapshotGasCost from './shared/snapshotGasCost' +import { MaxUint128 } from './shared/utilities' + +describe('Oracle', () => { + let wallet: Wallet, other: Wallet + + let loadFixture: ReturnType + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + loadFixture = waffle.createFixtureLoader([wallet, other]) + }) + + const oracleFixture = async () => { + const oracleTestFactory = await ethers.getContractFactory('OracleTest') + return (await oracleTestFactory.deploy()) as OracleTest + } + + const initializedOracleFixture = async () => { + const oracle = await oracleFixture() + await oracle.initialize({ + time: 0, + tick: 0, + liquidity: 0, + }) + return oracle + } + + describe('#initialize', () => { + let oracle: OracleTest + beforeEach('deploy test oracle', async () => { + oracle = await loadFixture(oracleFixture) + }) + it('index is 0', async () => { + await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) + expect(await oracle.index()).to.eq(0) + }) + it('cardinality is 1', async () => { + await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) + expect(await oracle.cardinality()).to.eq(1) + }) + it('cardinality next is 1', async () => { + await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) + expect(await oracle.cardinalityNext()).to.eq(1) + }) + it('sets first slot timestamp only', async () => { + await oracle.initialize({ liquidity: 1, tick: 1, time: 1 }) + checkObservationEquals(await oracle.observations(0), { + initialized: true, + blockTimestamp: 1, + tickCumulative: 0, + secondsPerLiquidityCumulativeX128: 0, + }) + }) + it('gas', async () => { + await snapshotGasCost(oracle.initialize({ liquidity: 1, tick: 1, time: 1 })) + }) + }) + + describe('#grow', () => { + let oracle: OracleTest + beforeEach('deploy initialized test oracle', async () => { + oracle = await loadFixture(initializedOracleFixture) + }) + + it('increases the cardinality next for the first call', async () => { + await oracle.grow(5) + expect(await oracle.index()).to.eq(0) + expect(await oracle.cardinality()).to.eq(1) + expect(await oracle.cardinalityNext()).to.eq(5) + }) + + it('does not touch the first slot', async () => { + await oracle.grow(5) + checkObservationEquals(await oracle.observations(0), { + secondsPerLiquidityCumulativeX128: 0, + tickCumulative: 0, + blockTimestamp: 0, + initialized: true, + }) + }) + + it('is no op if oracle is already gte that size', async () => { + await oracle.grow(5) + await oracle.grow(3) + expect(await oracle.index()).to.eq(0) + expect(await oracle.cardinality()).to.eq(1) + expect(await oracle.cardinalityNext()).to.eq(5) + }) + + it('adds data to all the slots', async () => { + await oracle.grow(5) + for (let i = 1; i < 5; i++) { + checkObservationEquals(await oracle.observations(i), { + secondsPerLiquidityCumulativeX128: 0, + tickCumulative: 0, + blockTimestamp: 1, + initialized: false, + }) + } + }) + + it('grow after wrap', async () => { + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 2, liquidity: 1, tick: 1 }) // index is now 1 + await oracle.update({ advanceTimeBy: 2, liquidity: 1, tick: 1 }) // index is now 0 again + expect(await oracle.index()).to.eq(0) + await oracle.grow(3) + expect(await oracle.index()).to.eq(0) + expect(await oracle.cardinality()).to.eq(2) + expect(await oracle.cardinalityNext()).to.eq(3) + }) + + it('gas for growing by 1 slot when index == cardinality - 1', async () => { + await snapshotGasCost(oracle.grow(2)) + }) + + it('gas for growing by 10 slots when index == cardinality - 1', async () => { + await snapshotGasCost(oracle.grow(11)) + }) + + it('gas for growing by 1 slot when index != cardinality - 1', async () => { + await oracle.grow(2) + await snapshotGasCost(oracle.grow(3)) + }) + + it('gas for growing by 10 slots when index != cardinality - 1', async () => { + await oracle.grow(2) + await snapshotGasCost(oracle.grow(12)) + }) + }) + + describe('#write', () => { + let oracle: OracleTest + + beforeEach('deploy initialized test oracle', async () => { + oracle = await loadFixture(initializedOracleFixture) + }) + + it('single element array gets overwritten', async () => { + await oracle.update({ advanceTimeBy: 1, tick: 2, liquidity: 5 }) + expect(await oracle.index()).to.eq(0) + checkObservationEquals(await oracle.observations(0), { + initialized: true, + secondsPerLiquidityCumulativeX128: '340282366920938463463374607431768211456', + tickCumulative: 0, + blockTimestamp: 1, + }) + await oracle.update({ advanceTimeBy: 5, tick: -1, liquidity: 8 }) + expect(await oracle.index()).to.eq(0) + checkObservationEquals(await oracle.observations(0), { + initialized: true, + secondsPerLiquidityCumulativeX128: '680564733841876926926749214863536422912', + tickCumulative: 10, + blockTimestamp: 6, + }) + await oracle.update({ advanceTimeBy: 3, tick: 2, liquidity: 3 }) + expect(await oracle.index()).to.eq(0) + checkObservationEquals(await oracle.observations(0), { + initialized: true, + secondsPerLiquidityCumulativeX128: '808170621437228850725514692650449502208', + tickCumulative: 7, + blockTimestamp: 9, + }) + }) + + it('does nothing if time has not changed', async () => { + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 1, tick: 3, liquidity: 2 }) + expect(await oracle.index()).to.eq(1) + await oracle.update({ advanceTimeBy: 0, tick: -5, liquidity: 9 }) + expect(await oracle.index()).to.eq(1) + }) + + it('writes an index if time has changed', async () => { + await oracle.grow(3) + await oracle.update({ advanceTimeBy: 6, tick: 3, liquidity: 2 }) + expect(await oracle.index()).to.eq(1) + await oracle.update({ advanceTimeBy: 4, tick: -5, liquidity: 9 }) + + expect(await oracle.index()).to.eq(2) + checkObservationEquals(await oracle.observations(1), { + tickCumulative: 0, + secondsPerLiquidityCumulativeX128: '2041694201525630780780247644590609268736', + initialized: true, + blockTimestamp: 6, + }) + }) + + it('grows cardinality when writing past', async () => { + await oracle.grow(2) + await oracle.grow(4) + expect(await oracle.cardinality()).to.eq(1) + await oracle.update({ advanceTimeBy: 3, tick: 5, liquidity: 6 }) + expect(await oracle.cardinality()).to.eq(4) + await oracle.update({ advanceTimeBy: 4, tick: 6, liquidity: 4 }) + expect(await oracle.cardinality()).to.eq(4) + expect(await oracle.index()).to.eq(2) + checkObservationEquals(await oracle.observations(2), { + secondsPerLiquidityCumulativeX128: '1247702012043441032699040227249816775338', + tickCumulative: 20, + initialized: true, + blockTimestamp: 7, + }) + }) + + it('wraps around', async () => { + await oracle.grow(3) + await oracle.update({ advanceTimeBy: 3, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 4, tick: 2, liquidity: 3 }) + await oracle.update({ advanceTimeBy: 5, tick: 3, liquidity: 4 }) + + expect(await oracle.index()).to.eq(0) + + checkObservationEquals(await oracle.observations(0), { + secondsPerLiquidityCumulativeX128: '2268549112806256423089164049545121409706', + tickCumulative: 14, + initialized: true, + blockTimestamp: 12, + }) + }) + + it('accumulates liquidity', async () => { + await oracle.grow(4) + + await oracle.update({ advanceTimeBy: 3, tick: 3, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 4, tick: -7, liquidity: 6 }) + await oracle.update({ advanceTimeBy: 5, tick: -2, liquidity: 4 }) + + expect(await oracle.index()).to.eq(3) + + checkObservationEquals(await oracle.observations(1), { + initialized: true, + tickCumulative: 0, + secondsPerLiquidityCumulativeX128: '1020847100762815390390123822295304634368', + blockTimestamp: 3, + }) + checkObservationEquals(await oracle.observations(2), { + initialized: true, + tickCumulative: 12, + secondsPerLiquidityCumulativeX128: '1701411834604692317316873037158841057280', + blockTimestamp: 7, + }) + checkObservationEquals(await oracle.observations(3), { + initialized: true, + tickCumulative: -23, + secondsPerLiquidityCumulativeX128: '1984980473705474370203018543351981233493', + blockTimestamp: 12, + }) + checkObservationEquals(await oracle.observations(4), { + initialized: false, + tickCumulative: 0, + secondsPerLiquidityCumulativeX128: 0, + blockTimestamp: 0, + }) + }) + }) + + describe('#observe', () => { + describe('before initialization', async () => { + let oracle: OracleTest + beforeEach('deploy test oracle', async () => { + oracle = await loadFixture(oracleFixture) + }) + + const observeSingle = async (secondsAgo: number) => { + const { + tickCumulatives: [tickCumulative], + secondsPerLiquidityCumulativeX128s: [secondsPerLiquidityCumulativeX128], + } = await oracle.observe([secondsAgo]) + return { secondsPerLiquidityCumulativeX128, tickCumulative } + } + + it('fails before initialize', async () => { + await expect(observeSingle(0)).to.be.revertedWith('I') + }) + + it('fails if an older observation does not exist', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + await expect(observeSingle(1)).to.be.revertedWith('OLD') + }) + + it('does not fail across overflow boundary', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 2 ** 32 - 1 }) + await oracle.advanceTime(2) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(1) + expect(tickCumulative).to.be.eq(2) + expect(secondsPerLiquidityCumulativeX128).to.be.eq('85070591730234615865843651857942052864') + }) + + it('interpolates correctly at max liquidity', async () => { + await oracle.initialize({ liquidity: MaxUint128, tick: 0, time: 0 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: 0 }) + let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(13) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) + expect(secondsPerLiquidityCumulativeX128).to.eq(7) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) + expect(secondsPerLiquidityCumulativeX128).to.eq(1) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('interpolates correctly at min liquidity', async () => { + await oracle.initialize({ liquidity: 0, tick: 0, time: 0 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: MaxUint128 }) + let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(13).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(1).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('interpolates the same as 0 liquidity for 1 liquidity', async () => { + await oracle.initialize({ liquidity: 1, tick: 0, time: 0 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: MaxUint128 }) + let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(13).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(6)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(12)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(1).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(13)) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('interpolates correctly across uint32 seconds boundaries', async () => { + // setup + await oracle.initialize({ liquidity: 0, tick: 0, time: 0 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 2 ** 32 - 6, tick: 0, liquidity: 0 }) + let { secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(2 ** 32 - 6).shl(128)) + await oracle.update({ advanceTimeBy: 13, tick: 0, liquidity: 0 }) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(0)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(7).shl(128)) + + // interpolation checks + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(3)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(4).shl(128)) + ;({ secondsPerLiquidityCumulativeX128 } = await observeSingle(8)) + expect(secondsPerLiquidityCumulativeX128).to.eq(BigNumber.from(2 ** 32 - 1).shl(128)) + }) + + it('single observation at current time', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('single observation in past but not earlier than secondsAgo', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + await oracle.advanceTime(3) + await expect(observeSingle(4)).to.be.revertedWith('OLD') + }) + + it('single observation in past at exactly seconds ago', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + await oracle.advanceTime(3) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(3) + expect(tickCumulative).to.eq(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('single observation in past counterfactual in past', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + await oracle.advanceTime(3) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(1) + expect(tickCumulative).to.eq(4) + expect(secondsPerLiquidityCumulativeX128).to.eq('170141183460469231731687303715884105728') + }) + + it('single observation in past counterfactual now', async () => { + await oracle.initialize({ liquidity: 4, tick: 2, time: 5 }) + await oracle.advanceTime(3) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(6) + expect(secondsPerLiquidityCumulativeX128).to.eq('255211775190703847597530955573826158592') + }) + + it('two observations in chronological order 0 seconds ago exact', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(-20) + expect(secondsPerLiquidityCumulativeX128).to.eq('272225893536750770770699685945414569164') + }) + + it('two observations in chronological order 0 seconds ago counterfactual', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(-13) + expect(secondsPerLiquidityCumulativeX128).to.eq('1463214177760035392892510811956603309260') + }) + + it('two observations in chronological order seconds ago is exactly on first observation', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(11) + expect(tickCumulative).to.eq(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + }) + + it('two observations in chronological order seconds ago is between first and second', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(9) + expect(tickCumulative).to.eq(-10) + expect(secondsPerLiquidityCumulativeX128).to.eq('136112946768375385385349842972707284582') + }) + + it('two observations in reverse order 0 seconds ago exact', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(-17) + expect(secondsPerLiquidityCumulativeX128).to.eq('782649443918158465965761597093066886348') + }) + + it('two observations in reverse order 0 seconds ago counterfactual', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(-52) + expect(secondsPerLiquidityCumulativeX128).to.eq('1378143586029800777026667160098661256396') + }) + + it('two observations in reverse order seconds ago is exactly on first observation', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(10) + expect(tickCumulative).to.eq(-20) + expect(secondsPerLiquidityCumulativeX128).to.eq('272225893536750770770699685945414569164') + }) + + it('two observations in reverse order seconds ago is between first and second', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.grow(2) + await oracle.update({ advanceTimeBy: 4, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 3, tick: -5, liquidity: 4 }) + await oracle.advanceTime(7) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(9) + expect(tickCumulative).to.eq(-19) + expect(secondsPerLiquidityCumulativeX128).to.eq('442367076997220002502386989661298674892') + }) + + it('can fetch multiple observations', async () => { + await oracle.initialize({ time: 5, tick: 2, liquidity: BigNumber.from(2).pow(15) }) + await oracle.grow(4) + await oracle.update({ advanceTimeBy: 13, tick: 6, liquidity: BigNumber.from(2).pow(12) }) + await oracle.advanceTime(5) + + const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([0, 3, 8, 13, 15, 18]) + expect(tickCumulatives).to.have.lengthOf(6) + expect(tickCumulatives[0]).to.eq(56) + expect(tickCumulatives[1]).to.eq(38) + expect(tickCumulatives[2]).to.eq(20) + expect(tickCumulatives[3]).to.eq(10) + expect(tickCumulatives[4]).to.eq(6) + expect(tickCumulatives[5]).to.eq(0) + expect(secondsPerLiquidityCumulativeX128s).to.have.lengthOf(6) + expect(secondsPerLiquidityCumulativeX128s[0]).to.eq('550383467004691728624232610897330176') + expect(secondsPerLiquidityCumulativeX128s[1]).to.eq('301153217795020002454768787094765568') + expect(secondsPerLiquidityCumulativeX128s[2]).to.eq('103845937170696552570609926584401920') + expect(secondsPerLiquidityCumulativeX128s[3]).to.eq('51922968585348276285304963292200960') + expect(secondsPerLiquidityCumulativeX128s[4]).to.eq('31153781151208965771182977975320576') + expect(secondsPerLiquidityCumulativeX128s[5]).to.eq(0) + }) + + it('gas for observe since most recent', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.advanceTime(2) + await snapshotGasCost(oracle.getGasCostOfObserve([1])) + }) + + it('gas for single observation at current time', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + + it('gas for single observation at current time counterfactually computed', async () => { + await oracle.initialize({ liquidity: 5, tick: -5, time: 5 }) + await oracle.advanceTime(5) + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + }) + + for (const startingTime of [5, 2 ** 32 - 5]) { + describe(`initialized with 5 observations with starting time of ${startingTime}`, () => { + const oracleFixture5Observations = async () => { + const oracle = await oracleFixture() + await oracle.initialize({ liquidity: 5, tick: -5, time: startingTime }) + await oracle.grow(5) + await oracle.update({ advanceTimeBy: 3, tick: 1, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 2, tick: -6, liquidity: 4 }) + await oracle.update({ advanceTimeBy: 4, tick: -2, liquidity: 4 }) + await oracle.update({ advanceTimeBy: 1, tick: -2, liquidity: 9 }) + await oracle.update({ advanceTimeBy: 3, tick: 4, liquidity: 2 }) + await oracle.update({ advanceTimeBy: 6, tick: 6, liquidity: 7 }) + return oracle + } + let oracle: OracleTest + beforeEach('set up observations', async () => { + oracle = await loadFixture(oracleFixture5Observations) + }) + + const observeSingle = async (secondsAgo: number) => { + const { + tickCumulatives: [tickCumulative], + secondsPerLiquidityCumulativeX128s: [secondsPerLiquidityCumulativeX128], + } = await oracle.observe([secondsAgo]) + return { secondsPerLiquidityCumulativeX128, tickCumulative } + } + + it('index, cardinality, cardinality next', async () => { + expect(await oracle.index()).to.eq(1) + expect(await oracle.cardinality()).to.eq(5) + expect(await oracle.cardinalityNext()).to.eq(5) + }) + it('latest observation same time as latest', async () => { + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(-21) + expect(secondsPerLiquidityCumulativeX128).to.eq('2104079302127802832415199655953100107502') + }) + it('latest observation 5 seconds after latest', async () => { + await oracle.advanceTime(5) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(5) + expect(tickCumulative).to.eq(-21) + expect(secondsPerLiquidityCumulativeX128).to.eq('2104079302127802832415199655953100107502') + }) + it('current observation 5 seconds after latest', async () => { + await oracle.advanceTime(5) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(0) + expect(tickCumulative).to.eq(9) + expect(secondsPerLiquidityCumulativeX128).to.eq('2347138135642758877746181518404363115684') + }) + it('between latest observation and just before latest observation at same time as latest', async () => { + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(3) + expect(tickCumulative).to.eq(-33) + expect(secondsPerLiquidityCumulativeX128).to.eq('1593655751746395137220137744805447790318') + }) + it('between latest observation and just before latest observation after the latest observation', async () => { + await oracle.advanceTime(5) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(8) + expect(tickCumulative).to.eq(-33) + expect(secondsPerLiquidityCumulativeX128).to.eq('1593655751746395137220137744805447790318') + }) + it('older than oldest reverts', async () => { + await expect(observeSingle(15)).to.be.revertedWith('OLD') + await oracle.advanceTime(5) + await expect(observeSingle(20)).to.be.revertedWith('OLD') + }) + it('oldest observation', async () => { + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(14) + expect(tickCumulative).to.eq(-13) + expect(secondsPerLiquidityCumulativeX128).to.eq('544451787073501541541399371890829138329') + }) + it('oldest observation after some time', async () => { + await oracle.advanceTime(6) + const { tickCumulative, secondsPerLiquidityCumulativeX128 } = await observeSingle(20) + expect(tickCumulative).to.eq(-13) + expect(secondsPerLiquidityCumulativeX128).to.eq('544451787073501541541399371890829138329') + }) + + it('fetch many values', async () => { + await oracle.advanceTime(6) + const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([ + 20, + 17, + 13, + 10, + 5, + 1, + 0, + ]) + expect({ + tickCumulatives: tickCumulatives.map((tc) => tc.toNumber()), + secondsPerLiquidityCumulativeX128s: secondsPerLiquidityCumulativeX128s.map((lc) => lc.toString()), + }).to.matchSnapshot() + }) + + it('gas all of last 20 seconds', async () => { + await oracle.advanceTime(6) + await snapshotGasCost( + oracle.getGasCostOfObserve([20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) + ) + }) + + it('gas latest equal', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + it('gas latest transform', async () => { + await oracle.advanceTime(5) + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + it('gas oldest', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([14])) + }) + it('gas between oldest and oldest + 1', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([13])) + }) + it('gas middle', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([5])) + }) + }) + } + }) + + describe.skip('full oracle', function () { + this.timeout(1_200_000) + + let oracle: OracleTest + + const BATCH_SIZE = 300 + + const STARTING_TIME = TEST_POOL_START_TIME + + const maxedOutOracleFixture = async () => { + const oracle = await oracleFixture() + await oracle.initialize({ liquidity: 0, tick: 0, time: STARTING_TIME }) + let cardinalityNext = await oracle.cardinalityNext() + while (cardinalityNext < 65535) { + const growTo = Math.min(65535, cardinalityNext + BATCH_SIZE) + console.log('growing from', cardinalityNext, 'to', growTo) + await oracle.grow(growTo) + cardinalityNext = growTo + } + + for (let i = 0; i < 65535; i += BATCH_SIZE) { + console.log('batch update starting at', i) + const batch = Array(BATCH_SIZE) + .fill(null) + .map((_, j) => ({ + advanceTimeBy: 13, + tick: -i - j, + liquidity: i + j, + })) + await oracle.batchUpdate(batch) + } + + return oracle + } + + beforeEach('create a full oracle', async () => { + oracle = await loadFixture(maxedOutOracleFixture) + }) + + it('has max cardinality next', async () => { + expect(await oracle.cardinalityNext()).to.eq(65535) + }) + + it('has max cardinality', async () => { + expect(await oracle.cardinality()).to.eq(65535) + }) + + it('index wrapped around', async () => { + expect(await oracle.index()).to.eq(165) + }) + + async function checkObserve( + secondsAgo: number, + expected?: { tickCumulative: BigNumberish; secondsPerLiquidityCumulativeX128: BigNumberish } + ) { + const { tickCumulatives, secondsPerLiquidityCumulativeX128s } = await oracle.observe([secondsAgo]) + const check = { + tickCumulative: tickCumulatives[0].toString(), + secondsPerLiquidityCumulativeX128: secondsPerLiquidityCumulativeX128s[0].toString(), + } + if (typeof expected === 'undefined') { + expect(check).to.matchSnapshot() + } else { + expect(check).to.deep.eq({ + tickCumulative: expected.tickCumulative.toString(), + secondsPerLiquidityCumulativeX128: expected.secondsPerLiquidityCumulativeX128.toString(), + }) + } + } + + it('can observe into the ordered portion with exact seconds ago', async () => { + await checkObserve(100 * 13, { + secondsPerLiquidityCumulativeX128: '60465049086512033878831623038233202591033', + tickCumulative: '-27970560813', + }) + }) + + it('can observe into the ordered portion with unexact seconds ago', async () => { + await checkObserve(100 * 13 + 5, { + secondsPerLiquidityCumulativeX128: '60465023149565257990964350912969670793706', + tickCumulative: '-27970232823', + }) + }) + + it('can observe at exactly the latest observation', async () => { + await checkObserve(0, { + secondsPerLiquidityCumulativeX128: '60471787506468701386237800669810720099776', + tickCumulative: '-28055903863', + }) + }) + + it('can observe at exactly the latest observation after some time passes', async () => { + await oracle.advanceTime(5) + await checkObserve(5, { + secondsPerLiquidityCumulativeX128: '60471787506468701386237800669810720099776', + tickCumulative: '-28055903863', + }) + }) + + it('can observe after the latest observation counterfactual', async () => { + await oracle.advanceTime(5) + await checkObserve(3, { + secondsPerLiquidityCumulativeX128: '60471797865298117996489508104462919730461', + tickCumulative: '-28056035261', + }) + }) + + it('can observe into the unordered portion of array at exact seconds ago of observation', async () => { + await checkObserve(200 * 13, { + secondsPerLiquidityCumulativeX128: '60458300386499273141628780395875293027404', + tickCumulative: '-27885347763', + }) + }) + + it('can observe into the unordered portion of array at seconds ago between observations', async () => { + await checkObserve(200 * 13 + 5, { + secondsPerLiquidityCumulativeX128: '60458274409952896081377821330361274907140', + tickCumulative: '-27885020273', + }) + }) + + it('can observe the oldest observation 13*65534 seconds ago', async () => { + await checkObserve(13 * 65534, { + secondsPerLiquidityCumulativeX128: '33974356747348039873972993881117400879779', + tickCumulative: '-175890', + }) + }) + + it('can observe the oldest observation 13*65534 + 5 seconds ago if time has elapsed', async () => { + await oracle.advanceTime(5) + await checkObserve(13 * 65534 + 5, { + secondsPerLiquidityCumulativeX128: '33974356747348039873972993881117400879779', + tickCumulative: '-175890', + }) + }) + + it('gas cost of observe(0)', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + it('gas cost of observe(200 * 13)', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([200 + 13])) + }) + it('gas cost of observe(200 * 13 + 5)', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([200 + 13 + 5])) + }) + it('gas cost of observe(0) after 5 seconds', async () => { + await oracle.advanceTime(5) + await snapshotGasCost(oracle.getGasCostOfObserve([0])) + }) + it('gas cost of observe(5) after 5 seconds', async () => { + await oracle.advanceTime(5) + await snapshotGasCost(oracle.getGasCostOfObserve([5])) + }) + it('gas cost of observe(oldest)', async () => { + await snapshotGasCost(oracle.getGasCostOfObserve([65534 * 13])) + }) + it('gas cost of observe(oldest) after 5 seconds', async () => { + await oracle.advanceTime(5) + await snapshotGasCost(oracle.getGasCostOfObserve([65534 * 13 + 5])) + }) + }) +}) diff --git a/lib/v3-core/test/SqrtPriceMath.spec.ts b/lib/v3-core/test/SqrtPriceMath.spec.ts new file mode 100644 index 0000000..ef01245 --- /dev/null +++ b/lib/v3-core/test/SqrtPriceMath.spec.ts @@ -0,0 +1,379 @@ +import { BigNumber, constants } from 'ethers' +import { ethers } from 'hardhat' +import { SqrtPriceMathTest } from '../typechain/SqrtPriceMathTest' + +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' +import { encodePriceSqrt, expandTo18Decimals, MaxUint128 } from './shared/utilities' + +const { + constants: { MaxUint256 }, +} = ethers + +describe('SqrtPriceMath', () => { + let sqrtPriceMath: SqrtPriceMathTest + before(async () => { + const sqrtPriceMathTestFactory = await ethers.getContractFactory('SqrtPriceMathTest') + sqrtPriceMath = (await sqrtPriceMathTestFactory.deploy()) as SqrtPriceMathTest + }) + + describe('#getNextSqrtPriceFromInput', () => { + it('fails if price is zero', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromInput(0, 0, expandTo18Decimals(1).div(10), false)).to.be.reverted + }) + + it('fails if liquidity is zero', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromInput(1, 0, expandTo18Decimals(1).div(10), true)).to.be.reverted + }) + + it('fails if input amount overflows the price', async () => { + const price = BigNumber.from(2).pow(160).sub(1) + const liquidity = 1024 + const amountIn = 1024 + await expect(sqrtPriceMath.getNextSqrtPriceFromInput(price, liquidity, amountIn, false)).to.be.reverted + }) + + it('any input amount cannot underflow the price', async () => { + const price = 1 + const liquidity = 1 + const amountIn = BigNumber.from(2).pow(255) + expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, liquidity, amountIn, true)).to.eq(1) + }) + + it('returns input price if amount in is zero and zeroForOne = true', async () => { + const price = encodePriceSqrt(1, 1) + expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, expandTo18Decimals(1).div(10), 0, true)).to.eq(price) + }) + + it('returns input price if amount in is zero and zeroForOne = false', async () => { + const price = encodePriceSqrt(1, 1) + expect(await sqrtPriceMath.getNextSqrtPriceFromInput(price, expandTo18Decimals(1).div(10), 0, false)).to.eq(price) + }) + + it('returns the minimum price for max inputs', async () => { + const sqrtP = BigNumber.from(2).pow(160).sub(1) + const liquidity = MaxUint128 + const maxAmountNoOverflow = MaxUint256.sub(liquidity.shl(96).div(sqrtP)) + expect(await sqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, maxAmountNoOverflow, true)).to.eq('1') + }) + + it('input amount of 0.1 token1', async () => { + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + false + ) + expect(sqrtQ).to.eq('87150978765690771352898345369') + }) + + it('input amount of 0.1 token0', async () => { + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + true + ) + expect(sqrtQ).to.eq('72025602285694852357767227579') + }) + + it('amountIn > type(uint96).max and zeroForOne = true', async () => { + expect( + await sqrtPriceMath.getNextSqrtPriceFromInput( + encodePriceSqrt(1, 1), + expandTo18Decimals(10), + BigNumber.from(2).pow(100), + true + ) + // perfect answer: + // https://www.wolframalpha.com/input/?i=624999999995069620+-+%28%281e19+*+1+%2F+%281e19+%2B+2%5E100+*+1%29%29+*+2%5E96%29 + ).to.eq('624999999995069620') + }) + + it('can return 1 with enough amountIn and zeroForOne = true', async () => { + expect( + await sqrtPriceMath.getNextSqrtPriceFromInput(encodePriceSqrt(1, 1), 1, constants.MaxUint256.div(2), true) + ).to.eq(1) + }) + + it('zeroForOne = true gas', async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromInput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + true + ) + ) + }) + + it('zeroForOne = false gas', async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromInput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + false + ) + ) + }) + }) + + describe('#getNextSqrtPriceFromOutput', () => { + it('fails if price is zero', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(0, 0, expandTo18Decimals(1).div(10), false)).to.be.reverted + }) + + it('fails if liquidity is zero', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(1, 0, expandTo18Decimals(1).div(10), true)).to.be.reverted + }) + + it('fails if output amount is exactly the virtual reserves of token0', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 4 + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted + }) + + it('fails if output amount is greater than virtual reserves of token0', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 5 + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted + }) + + it('fails if output amount is greater than virtual reserves of token1', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 262145 + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true)).to.be.reverted + }) + + it('fails if output amount is exactly the virtual reserves of token1', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 262144 + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true)).to.be.reverted + }) + + it('succeeds if output amount is just less than the virtual reserves of token1', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 262143 + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, true) + expect(sqrtQ).to.eq('77371252455336267181195264') + }) + + it('puzzling echidna test', async () => { + const price = '20282409603651670423947251286016' + const liquidity = 1024 + const amountOut = 4 + + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(price, liquidity, amountOut, false)).to.be.reverted + }) + + it('returns input price if amount in is zero and zeroForOne = true', async () => { + const price = encodePriceSqrt(1, 1) + expect(await sqrtPriceMath.getNextSqrtPriceFromOutput(price, expandTo18Decimals(1).div(10), 0, true)).to.eq(price) + }) + + it('returns input price if amount in is zero and zeroForOne = false', async () => { + const price = encodePriceSqrt(1, 1) + expect(await sqrtPriceMath.getNextSqrtPriceFromOutput(price, expandTo18Decimals(1).div(10), 0, false)).to.eq( + price + ) + }) + + it('output amount of 0.1 token1', async () => { + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + false + ) + expect(sqrtQ).to.eq('88031291682515930659493278152') + }) + + it('output amount of 0.1 token1', async () => { + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromOutput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + true + ) + expect(sqrtQ).to.eq('71305346262837903834189555302') + }) + + it('reverts if amountOut is impossible in zero for one direction', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(encodePriceSqrt(1, 1), 1, constants.MaxUint256, true)).to.be + .reverted + }) + + it('reverts if amountOut is impossible in one for zero direction', async () => { + await expect(sqrtPriceMath.getNextSqrtPriceFromOutput(encodePriceSqrt(1, 1), 1, constants.MaxUint256, false)).to + .be.reverted + }) + + it('zeroForOne = true gas', async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromOutput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + true + ) + ) + }) + + it('zeroForOne = false gas', async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetNextSqrtPriceFromOutput( + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + expandTo18Decimals(1).div(10), + false + ) + ) + }) + }) + + describe('#getAmount0Delta', () => { + it('returns 0 if liquidity is 0', async () => { + const amount0 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(2, 1), 0, true) + + expect(amount0).to.eq(0) + }) + it('returns 0 if prices are equal', async () => { + const amount0 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(1, 1), 0, true) + + expect(amount0).to.eq(0) + }) + + it('returns 0.1 amount1 for price of 1 to 1.21', async () => { + const amount0 = await sqrtPriceMath.getAmount0Delta( + encodePriceSqrt(1, 1), + encodePriceSqrt(121, 100), + expandTo18Decimals(1), + true + ) + expect(amount0).to.eq('90909090909090910') + + const amount0RoundedDown = await sqrtPriceMath.getAmount0Delta( + encodePriceSqrt(1, 1), + encodePriceSqrt(121, 100), + expandTo18Decimals(1), + false + ) + + expect(amount0RoundedDown).to.eq(amount0.sub(1)) + }) + + it('works for prices that overflow', async () => { + const amount0Up = await sqrtPriceMath.getAmount0Delta( + encodePriceSqrt(BigNumber.from(2).pow(90), 1), + encodePriceSqrt(BigNumber.from(2).pow(96), 1), + expandTo18Decimals(1), + true + ) + const amount0Down = await sqrtPriceMath.getAmount0Delta( + encodePriceSqrt(BigNumber.from(2).pow(90), 1), + encodePriceSqrt(BigNumber.from(2).pow(96), 1), + expandTo18Decimals(1), + false + ) + expect(amount0Up).to.eq(amount0Down.add(1)) + }) + + it(`gas cost for amount0 where roundUp = true`, async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetAmount0Delta( + encodePriceSqrt(100, 121), + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + true + ) + ) + }) + + it(`gas cost for amount0 where roundUp = true`, async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetAmount0Delta( + encodePriceSqrt(100, 121), + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + false + ) + ) + }) + }) + + describe('#getAmount1Delta', () => { + it('returns 0 if liquidity is 0', async () => { + const amount1 = await sqrtPriceMath.getAmount1Delta(encodePriceSqrt(1, 1), encodePriceSqrt(2, 1), 0, true) + + expect(amount1).to.eq(0) + }) + it('returns 0 if prices are equal', async () => { + const amount1 = await sqrtPriceMath.getAmount0Delta(encodePriceSqrt(1, 1), encodePriceSqrt(1, 1), 0, true) + + expect(amount1).to.eq(0) + }) + + it('returns 0.1 amount1 for price of 1 to 1.21', async () => { + const amount1 = await sqrtPriceMath.getAmount1Delta( + encodePriceSqrt(1, 1), + encodePriceSqrt(121, 100), + expandTo18Decimals(1), + true + ) + + expect(amount1).to.eq('100000000000000000') + const amount1RoundedDown = await sqrtPriceMath.getAmount1Delta( + encodePriceSqrt(1, 1), + encodePriceSqrt(121, 100), + expandTo18Decimals(1), + false + ) + + expect(amount1RoundedDown).to.eq(amount1.sub(1)) + }) + + it(`gas cost for amount0 where roundUp = true`, async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetAmount0Delta( + encodePriceSqrt(100, 121), + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + true + ) + ) + }) + + it(`gas cost for amount0 where roundUp = false`, async () => { + await snapshotGasCost( + sqrtPriceMath.getGasCostOfGetAmount0Delta( + encodePriceSqrt(100, 121), + encodePriceSqrt(1, 1), + expandTo18Decimals(1), + false + ) + ) + }) + }) + + describe('swap computation', () => { + it('sqrtP * sqrtQ overflows', async () => { + // getNextSqrtPriceInvariants(1025574284609383690408304870162715216695788925244,50015962439936049619261659728067971248,406,true) + const sqrtP = '1025574284609383690408304870162715216695788925244' + const liquidity = '50015962439936049619261659728067971248' + const zeroForOne = true + const amountIn = '406' + + const sqrtQ = await sqrtPriceMath.getNextSqrtPriceFromInput(sqrtP, liquidity, amountIn, zeroForOne) + expect(sqrtQ).to.eq('1025574284609383582644711336373707553698163132913') + + const amount0Delta = await sqrtPriceMath.getAmount0Delta(sqrtQ, sqrtP, liquidity, true) + expect(amount0Delta).to.eq('406') + }) + }) +}) diff --git a/lib/v3-core/test/SwapMath.spec.ts b/lib/v3-core/test/SwapMath.spec.ts new file mode 100644 index 0000000..2dbd920 --- /dev/null +++ b/lib/v3-core/test/SwapMath.spec.ts @@ -0,0 +1,324 @@ +import { BigNumber } from 'ethers' +import { ethers } from 'hardhat' +import { SwapMathTest } from '../typechain/SwapMathTest' + +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' +import { encodePriceSqrt, expandTo18Decimals } from './shared/utilities' +import { SqrtPriceMathTest } from '../typechain/SqrtPriceMathTest' + +describe('SwapMath', () => { + let swapMath: SwapMathTest + let sqrtPriceMath: SqrtPriceMathTest + before(async () => { + const swapMathTestFactory = await ethers.getContractFactory('SwapMathTest') + const sqrtPriceMathTestFactory = await ethers.getContractFactory('SqrtPriceMathTest') + swapMath = (await swapMathTestFactory.deploy()) as SwapMathTest + sqrtPriceMath = (await sqrtPriceMathTestFactory.deploy()) as SqrtPriceMathTest + }) + + describe('#computeSwapStep', () => { + it('exact amount in that gets capped at price target in one for zero', async () => { + const price = encodePriceSqrt(1, 1) + const priceTarget = encodePriceSqrt(101, 100) + const liquidity = expandTo18Decimals(2) + const amount = expandTo18Decimals(1) + const fee = 600 + const zeroForOne = false + + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + price, + priceTarget, + liquidity, + amount, + fee + ) + + expect(amountIn).to.eq('9975124224178055') + expect(feeAmount).to.eq('5988667735148') + expect(amountOut).to.eq('9925619580021728') + expect(amountIn.add(feeAmount), 'entire amount is not used').to.lt(amount) + + const priceAfterWholeInputAmount = await sqrtPriceMath.getNextSqrtPriceFromInput( + price, + liquidity, + amount, + zeroForOne + ) + + expect(sqrtQ, 'price is capped at price target').to.eq(priceTarget) + expect(sqrtQ, 'price is less than price after whole input amount').to.lt(priceAfterWholeInputAmount) + }) + + it('exact amount out that gets capped at price target in one for zero', async () => { + const price = encodePriceSqrt(1, 1) + const priceTarget = encodePriceSqrt(101, 100) + const liquidity = expandTo18Decimals(2) + const amount = expandTo18Decimals(1).mul(-1) + const fee = 600 + const zeroForOne = false + + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + price, + priceTarget, + liquidity, + amount, + fee + ) + + expect(amountIn).to.eq('9975124224178055') + expect(feeAmount).to.eq('5988667735148') + expect(amountOut).to.eq('9925619580021728') + expect(amountOut, 'entire amount out is not returned').to.lt(amount.mul(-1)) + + const priceAfterWholeOutputAmount = await sqrtPriceMath.getNextSqrtPriceFromOutput( + price, + liquidity, + amount.mul(-1), + zeroForOne + ) + + expect(sqrtQ, 'price is capped at price target').to.eq(priceTarget) + expect(sqrtQ, 'price is less than price after whole output amount').to.lt(priceAfterWholeOutputAmount) + }) + + it('exact amount in that is fully spent in one for zero', async () => { + const price = encodePriceSqrt(1, 1) + const priceTarget = encodePriceSqrt(1000, 100) + const liquidity = expandTo18Decimals(2) + const amount = expandTo18Decimals(1) + const fee = 600 + const zeroForOne = false + + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + price, + priceTarget, + liquidity, + amount, + fee + ) + + expect(amountIn).to.eq('999400000000000000') + expect(feeAmount).to.eq('600000000000000') + expect(amountOut).to.eq('666399946655997866') + expect(amountIn.add(feeAmount), 'entire amount is used').to.eq(amount) + + const priceAfterWholeInputAmountLessFee = await sqrtPriceMath.getNextSqrtPriceFromInput( + price, + liquidity, + amount.sub(feeAmount), + zeroForOne + ) + + expect(sqrtQ, 'price does not reach price target').to.be.lt(priceTarget) + expect(sqrtQ, 'price is equal to price after whole input amount').to.eq(priceAfterWholeInputAmountLessFee) + }) + + it('exact amount out that is fully received in one for zero', async () => { + const price = encodePriceSqrt(1, 1) + const priceTarget = encodePriceSqrt(10000, 100) + const liquidity = expandTo18Decimals(2) + const amount = expandTo18Decimals(1).mul(-1) + const fee = 600 + const zeroForOne = false + + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + price, + priceTarget, + liquidity, + amount, + fee + ) + + expect(amountIn).to.eq('2000000000000000000') + expect(feeAmount).to.eq('1200720432259356') + expect(amountOut).to.eq(amount.mul(-1)) + + const priceAfterWholeOutputAmount = await sqrtPriceMath.getNextSqrtPriceFromOutput( + price, + liquidity, + amount.mul(-1), + zeroForOne + ) + + expect(sqrtQ, 'price does not reach price target').to.be.lt(priceTarget) + expect(sqrtQ, 'price is less than price after whole output amount').to.eq(priceAfterWholeOutputAmount) + }) + + it('amount out is capped at the desired amount out', async () => { + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + BigNumber.from('417332158212080721273783715441582'), + BigNumber.from('1452870262520218020823638996'), + '159344665391607089467575320103', + '-1', + 1 + ) + expect(amountIn).to.eq('1') + expect(feeAmount).to.eq('1') + expect(amountOut).to.eq('1') // would be 2 if not capped + expect(sqrtQ).to.eq('417332158212080721273783715441581') + }) + + it('target price of 1 uses partial input amount', async () => { + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + BigNumber.from('2'), + BigNumber.from('1'), + '1', + '3915081100057732413702495386755767', + 1 + ) + expect(amountIn).to.eq('39614081257132168796771975168') + expect(feeAmount).to.eq('39614120871253040049813') + expect(amountIn.add(feeAmount)).to.be.lte('3915081100057732413702495386755767') + expect(amountOut).to.eq('0') + expect(sqrtQ).to.eq('1') + }) + + it('entire input amount taken as fee', async () => { + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + '2413', + '79887613182836312', + '1985041575832132834610021537970', + '10', + 1872 + ) + expect(amountIn).to.eq('0') + expect(feeAmount).to.eq('10') + expect(amountOut).to.eq('0') + expect(sqrtQ).to.eq('2413') + }) + + it('handles intermediate insufficient liquidity in zero for one exact output case', async () => { + const sqrtP = BigNumber.from('20282409603651670423947251286016') + const sqrtPTarget = sqrtP.mul(11).div(10) + const liquidity = 1024 + // virtual reserves of one are only 4 + // https://www.wolframalpha.com/input/?i=1024+%2F+%2820282409603651670423947251286016+%2F+2**96%29 + const amountRemaining = -4 + const feePips = 3000 + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + sqrtP, + sqrtPTarget, + liquidity, + amountRemaining, + feePips + ) + expect(amountOut).to.eq(0) + expect(sqrtQ).to.eq(sqrtPTarget) + expect(amountIn).to.eq(26215) + expect(feeAmount).to.eq(79) + }) + + it('handles intermediate insufficient liquidity in one for zero exact output case', async () => { + const sqrtP = BigNumber.from('20282409603651670423947251286016') + const sqrtPTarget = sqrtP.mul(9).div(10) + const liquidity = 1024 + // virtual reserves of zero are only 262144 + // https://www.wolframalpha.com/input/?i=1024+*+%2820282409603651670423947251286016+%2F+2**96%29 + const amountRemaining = -263000 + const feePips = 3000 + const { amountIn, amountOut, sqrtQ, feeAmount } = await swapMath.computeSwapStep( + sqrtP, + sqrtPTarget, + liquidity, + amountRemaining, + feePips + ) + expect(amountOut).to.eq(26214) + expect(sqrtQ).to.eq(sqrtPTarget) + expect(amountIn).to.eq(1) + expect(feeAmount).to.eq(1) + }) + + describe('gas', () => { + it('swap one for zero exact in capped', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(101, 100), + expandTo18Decimals(2), + expandTo18Decimals(1), + 600 + ) + ) + }) + it('swap zero for one exact in capped', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(99, 100), + expandTo18Decimals(2), + expandTo18Decimals(1), + 600 + ) + ) + }) + it('swap one for zero exact out capped', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(101, 100), + expandTo18Decimals(2), + expandTo18Decimals(1).mul(-1), + 600 + ) + ) + }) + it('swap zero for one exact out capped', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(99, 100), + expandTo18Decimals(2), + expandTo18Decimals(1).mul(-1), + 600 + ) + ) + }) + it('swap one for zero exact in partial', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(1010, 100), + expandTo18Decimals(2), + 1000, + 600 + ) + ) + }) + it('swap zero for one exact in partial', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(99, 1000), + expandTo18Decimals(2), + 1000, + 600 + ) + ) + }) + it('swap one for zero exact out partial', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(1010, 100), + expandTo18Decimals(2), + 1000, + 600 + ) + ) + }) + it('swap zero for one exact out partial', async () => { + await snapshotGasCost( + swapMath.getGasCostOfComputeSwapStep( + encodePriceSqrt(1, 1), + encodePriceSqrt(99, 1000), + expandTo18Decimals(2), + 1000, + 600 + ) + ) + }) + }) + }) +}) diff --git a/lib/v3-core/test/Tick.spec.ts b/lib/v3-core/test/Tick.spec.ts new file mode 100644 index 0000000..f4b04dc --- /dev/null +++ b/lib/v3-core/test/Tick.spec.ts @@ -0,0 +1,329 @@ +import { ethers } from 'hardhat' +import { BigNumber } from 'ethers' +import { TickTest } from '../typechain/TickTest' +import { expect } from './shared/expect' +import { FeeAmount, getMaxLiquidityPerTick, TICK_SPACINGS } from './shared/utilities' + +const MaxUint128 = BigNumber.from(2).pow(128).sub(1) + +const { constants } = ethers + +describe('Tick', () => { + let tickTest: TickTest + + beforeEach('deploy TickTest', async () => { + const tickTestFactory = await ethers.getContractFactory('TickTest') + tickTest = (await tickTestFactory.deploy()) as TickTest + }) + + describe('#tickSpacingToMaxLiquidityPerTick', () => { + it('returns the correct value for low fee', async () => { + const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.LOW]) + expect(maxLiquidityPerTick).to.eq('1917569901783203986719870431555990') // 110.8 bits + expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.LOW])) + }) + it('returns the correct value for medium fee', async () => { + const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM]) + expect(maxLiquidityPerTick).to.eq('11505743598341114571880798222544994') // 113.1 bits + expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + }) + it('returns the correct value for high fee', async () => { + const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.HIGH]) + expect(maxLiquidityPerTick).to.eq('38350317471085141830651933667504588') // 114.7 bits + expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.HIGH])) + }) + it('returns the correct value for entire range', async () => { + const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(887272) + expect(maxLiquidityPerTick).to.eq(MaxUint128.div(3)) // 126 bits + expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(887272)) + }) + it('returns the correct value for 2302', async () => { + const maxLiquidityPerTick = await tickTest.tickSpacingToMaxLiquidityPerTick(2302) + expect(maxLiquidityPerTick).to.eq('441351967472034323558203122479595605') // 118 bits + expect(maxLiquidityPerTick).to.eq(getMaxLiquidityPerTick(2302)) + }) + }) + + describe('#getFeeGrowthInside', () => { + it('returns all for two uninitialized ticks if tick is inside', async () => { + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) + expect(feeGrowthInside0X128).to.eq(15) + expect(feeGrowthInside1X128).to.eq(15) + }) + it('returns 0 for two uninitialized ticks if tick is above', async () => { + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 4, 15, 15) + expect(feeGrowthInside0X128).to.eq(0) + expect(feeGrowthInside1X128).to.eq(0) + }) + it('returns 0 for two uninitialized ticks if tick is below', async () => { + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, -4, 15, 15) + expect(feeGrowthInside0X128).to.eq(0) + expect(feeGrowthInside1X128).to.eq(0) + }) + + it('subtracts upper tick if below', async () => { + await tickTest.setTick(2, { + feeGrowthOutside0X128: 2, + feeGrowthOutside1X128: 3, + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) + expect(feeGrowthInside0X128).to.eq(13) + expect(feeGrowthInside1X128).to.eq(12) + }) + + it('subtracts lower tick if above', async () => { + await tickTest.setTick(-2, { + feeGrowthOutside0X128: 2, + feeGrowthOutside1X128: 3, + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) + expect(feeGrowthInside0X128).to.eq(13) + expect(feeGrowthInside1X128).to.eq(12) + }) + + it('subtracts upper and lower tick if inside', async () => { + await tickTest.setTick(-2, { + feeGrowthOutside0X128: 2, + feeGrowthOutside1X128: 3, + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + await tickTest.setTick(2, { + feeGrowthOutside0X128: 4, + feeGrowthOutside1X128: 1, + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) + expect(feeGrowthInside0X128).to.eq(9) + expect(feeGrowthInside1X128).to.eq(11) + }) + + it('works correctly with overflow on inside tick', async () => { + await tickTest.setTick(-2, { + feeGrowthOutside0X128: constants.MaxUint256.sub(3), + feeGrowthOutside1X128: constants.MaxUint256.sub(2), + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + await tickTest.setTick(2, { + feeGrowthOutside0X128: 3, + feeGrowthOutside1X128: 5, + liquidityGross: 0, + liquidityNet: 0, + secondsPerLiquidityOutsideX128: 0, + tickCumulativeOutside: 0, + secondsOutside: 0, + initialized: true, + }) + const { feeGrowthInside0X128, feeGrowthInside1X128 } = await tickTest.getFeeGrowthInside(-2, 2, 0, 15, 15) + expect(feeGrowthInside0X128).to.eq(16) + expect(feeGrowthInside1X128).to.eq(13) + }) + }) + + describe('#update', async () => { + it('flips from zero to nonzero', async () => { + expect(await tickTest.callStatic.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.eq(true) + }) + it('does not flip from nonzero to greater nonzero', async () => { + await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3) + expect(await tickTest.callStatic.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) + }) + it('flips from nonzero to zero', async () => { + await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3) + expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(true) + }) + it('does not flip from nonzero to lesser nonzero', async () => { + await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) + expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) + }) + it('does not flip from nonzero to lesser nonzero', async () => { + await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) + expect(await tickTest.callStatic.update(0, 0, -1, 0, 0, 0, 0, 0, false, 3)).to.eq(false) + }) + it('reverts if total liquidity gross is greater than max', async () => { + await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 3) + await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, true, 3) + await expect(tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 3)).to.be.revertedWith('LO') + }) + it('nets the liquidity based on upper flag', async () => { + await tickTest.update(0, 0, 2, 0, 0, 0, 0, 0, false, 10) + await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, true, 10) + await tickTest.update(0, 0, 3, 0, 0, 0, 0, 0, true, 10) + await tickTest.update(0, 0, 1, 0, 0, 0, 0, 0, false, 10) + const { liquidityGross, liquidityNet } = await tickTest.ticks(0) + expect(liquidityGross).to.eq(2 + 1 + 3 + 1) + expect(liquidityNet).to.eq(2 - 1 - 3 + 1) + }) + it('reverts on overflow liquidity gross', async () => { + await tickTest.update(0, 0, MaxUint128.div(2).sub(1), 0, 0, 0, 0, 0, false, MaxUint128) + await expect(tickTest.update(0, 0, MaxUint128.div(2).sub(1), 0, 0, 0, 0, 0, false, MaxUint128)).to.be.reverted + }) + it('assumes all growth happens below ticks lte current tick', async () => { + await tickTest.update(1, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + secondsPerLiquidityOutsideX128, + tickCumulativeOutside, + initialized, + } = await tickTest.ticks(1) + expect(feeGrowthOutside0X128).to.eq(1) + expect(feeGrowthOutside1X128).to.eq(2) + expect(secondsPerLiquidityOutsideX128).to.eq(3) + expect(tickCumulativeOutside).to.eq(4) + expect(secondsOutside).to.eq(5) + expect(initialized).to.eq(true) + }) + it('does not set any growth fields if tick is already initialized', async () => { + await tickTest.update(1, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) + await tickTest.update(1, 1, 1, 6, 7, 8, 9, 10, false, MaxUint128) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + secondsPerLiquidityOutsideX128, + tickCumulativeOutside, + initialized, + } = await tickTest.ticks(1) + expect(feeGrowthOutside0X128).to.eq(1) + expect(feeGrowthOutside1X128).to.eq(2) + expect(secondsPerLiquidityOutsideX128).to.eq(3) + expect(tickCumulativeOutside).to.eq(4) + expect(secondsOutside).to.eq(5) + expect(initialized).to.eq(true) + }) + it('does not set any growth fields for ticks gt current tick', async () => { + await tickTest.update(2, 1, 1, 1, 2, 3, 4, 5, false, MaxUint128) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + secondsPerLiquidityOutsideX128, + tickCumulativeOutside, + initialized, + } = await tickTest.ticks(2) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + expect(secondsPerLiquidityOutsideX128).to.eq(0) + expect(tickCumulativeOutside).to.eq(0) + expect(secondsOutside).to.eq(0) + expect(initialized).to.eq(true) + }) + }) + + // this is skipped because the presence of the method causes slither to fail + describe('#clear', async () => { + it('deletes all the data in the tick', async () => { + await tickTest.setTick(2, { + feeGrowthOutside0X128: 1, + feeGrowthOutside1X128: 2, + liquidityGross: 3, + liquidityNet: 4, + secondsPerLiquidityOutsideX128: 5, + tickCumulativeOutside: 6, + secondsOutside: 7, + initialized: true, + }) + await tickTest.clear(2) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + secondsPerLiquidityOutsideX128, + liquidityGross, + tickCumulativeOutside, + liquidityNet, + initialized, + } = await tickTest.ticks(2) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + expect(secondsOutside).to.eq(0) + expect(secondsPerLiquidityOutsideX128).to.eq(0) + expect(tickCumulativeOutside).to.eq(0) + expect(liquidityGross).to.eq(0) + expect(liquidityNet).to.eq(0) + expect(initialized).to.eq(false) + }) + }) + + describe('#cross', () => { + it('flips the growth variables', async () => { + await tickTest.setTick(2, { + feeGrowthOutside0X128: 1, + feeGrowthOutside1X128: 2, + liquidityGross: 3, + liquidityNet: 4, + secondsPerLiquidityOutsideX128: 5, + tickCumulativeOutside: 6, + secondsOutside: 7, + initialized: true, + }) + await tickTest.cross(2, 7, 9, 8, 15, 10) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + tickCumulativeOutside, + secondsPerLiquidityOutsideX128, + } = await tickTest.ticks(2) + expect(feeGrowthOutside0X128).to.eq(6) + expect(feeGrowthOutside1X128).to.eq(7) + expect(secondsPerLiquidityOutsideX128).to.eq(3) + expect(tickCumulativeOutside).to.eq(9) + expect(secondsOutside).to.eq(3) + }) + it('two flips are no op', async () => { + await tickTest.setTick(2, { + feeGrowthOutside0X128: 1, + feeGrowthOutside1X128: 2, + liquidityGross: 3, + liquidityNet: 4, + secondsPerLiquidityOutsideX128: 5, + tickCumulativeOutside: 6, + secondsOutside: 7, + initialized: true, + }) + await tickTest.cross(2, 7, 9, 8, 15, 10) + await tickTest.cross(2, 7, 9, 8, 15, 10) + const { + feeGrowthOutside0X128, + feeGrowthOutside1X128, + secondsOutside, + tickCumulativeOutside, + secondsPerLiquidityOutsideX128, + } = await tickTest.ticks(2) + expect(feeGrowthOutside0X128).to.eq(1) + expect(feeGrowthOutside1X128).to.eq(2) + expect(secondsPerLiquidityOutsideX128).to.eq(5) + expect(tickCumulativeOutside).to.eq(6) + expect(secondsOutside).to.eq(7) + }) + }) +}) diff --git a/lib/v3-core/test/TickBitmap.spec.ts b/lib/v3-core/test/TickBitmap.spec.ts new file mode 100644 index 0000000..6c50779 --- /dev/null +++ b/lib/v3-core/test/TickBitmap.spec.ts @@ -0,0 +1,227 @@ +import { ethers } from 'hardhat' +import { TickBitmapTest } from '../typechain/TickBitmapTest' +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('TickBitmap', () => { + let tickBitmap: TickBitmapTest + + beforeEach('deploy TickBitmapTest', async () => { + const tickBitmapTestFactory = await ethers.getContractFactory('TickBitmapTest') + tickBitmap = (await tickBitmapTestFactory.deploy()) as TickBitmapTest + }) + + async function initTicks(ticks: number[]): Promise { + for (const tick of ticks) { + await tickBitmap.flipTick(tick) + } + } + + describe('#isInitialized', () => { + it('is false at first', async () => { + expect(await tickBitmap.isInitialized(1)).to.eq(false) + }) + it('is flipped by #flipTick', async () => { + await tickBitmap.flipTick(1) + expect(await tickBitmap.isInitialized(1)).to.eq(true) + }) + it('is flipped back by #flipTick', async () => { + await tickBitmap.flipTick(1) + await tickBitmap.flipTick(1) + expect(await tickBitmap.isInitialized(1)).to.eq(false) + }) + it('is not changed by another flip to a different tick', async () => { + await tickBitmap.flipTick(2) + expect(await tickBitmap.isInitialized(1)).to.eq(false) + }) + it('is not changed by another flip to a different tick on another word', async () => { + await tickBitmap.flipTick(1 + 256) + expect(await tickBitmap.isInitialized(257)).to.eq(true) + expect(await tickBitmap.isInitialized(1)).to.eq(false) + }) + }) + + describe('#flipTick', () => { + it('flips only the specified tick', async () => { + await tickBitmap.flipTick(-230) + expect(await tickBitmap.isInitialized(-230)).to.eq(true) + expect(await tickBitmap.isInitialized(-231)).to.eq(false) + expect(await tickBitmap.isInitialized(-229)).to.eq(false) + expect(await tickBitmap.isInitialized(-230 + 256)).to.eq(false) + expect(await tickBitmap.isInitialized(-230 - 256)).to.eq(false) + await tickBitmap.flipTick(-230) + expect(await tickBitmap.isInitialized(-230)).to.eq(false) + expect(await tickBitmap.isInitialized(-231)).to.eq(false) + expect(await tickBitmap.isInitialized(-229)).to.eq(false) + expect(await tickBitmap.isInitialized(-230 + 256)).to.eq(false) + expect(await tickBitmap.isInitialized(-230 - 256)).to.eq(false) + }) + + it('reverts only itself', async () => { + await tickBitmap.flipTick(-230) + await tickBitmap.flipTick(-259) + await tickBitmap.flipTick(-229) + await tickBitmap.flipTick(500) + await tickBitmap.flipTick(-259) + await tickBitmap.flipTick(-229) + await tickBitmap.flipTick(-259) + + expect(await tickBitmap.isInitialized(-259)).to.eq(true) + expect(await tickBitmap.isInitialized(-229)).to.eq(false) + }) + + it('gas cost of flipping first tick in word to initialized', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(1)) + }) + it('gas cost of flipping second tick in word to initialized', async () => { + await tickBitmap.flipTick(0) + await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(1)) + }) + it('gas cost of flipping a tick that results in deleting a word', async () => { + await tickBitmap.flipTick(0) + await snapshotGasCost(await tickBitmap.getGasCostOfFlipTick(0)) + }) + }) + + describe('#nextInitializedTickWithinOneWord', () => { + beforeEach('set up some ticks', async () => { + // word boundaries are at multiples of 256 + await initTicks([-200, -55, -4, 70, 78, 84, 139, 240, 535]) + }) + + describe('lte = false', async () => { + it('returns tick to right if at initialized tick', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(78, false) + expect(next).to.eq(84) + expect(initialized).to.eq(true) + }) + it('returns tick to right if at initialized tick', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-55, false) + expect(next).to.eq(-4) + expect(initialized).to.eq(true) + }) + + it('returns the tick directly to the right', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(77, false) + expect(next).to.eq(78) + expect(initialized).to.eq(true) + }) + it('returns the tick directly to the right', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-56, false) + expect(next).to.eq(-55) + expect(initialized).to.eq(true) + }) + + it('returns the next words initialized tick if on the right boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(255, false) + expect(next).to.eq(511) + expect(initialized).to.eq(false) + }) + it('returns the next words initialized tick if on the right boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-257, false) + expect(next).to.eq(-200) + expect(initialized).to.eq(true) + }) + + it('returns the next initialized tick from the next word', async () => { + await tickBitmap.flipTick(340) + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(328, false) + expect(next).to.eq(340) + expect(initialized).to.eq(true) + }) + it('does not exceed boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(508, false) + expect(next).to.eq(511) + expect(initialized).to.eq(false) + }) + it('skips entire word', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(255, false) + expect(next).to.eq(511) + expect(initialized).to.eq(false) + }) + it('skips half word', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(383, false) + expect(next).to.eq(511) + expect(initialized).to.eq(false) + }) + + it('gas cost on boundary', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(255, false)) + }) + it('gas cost just below boundary', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(254, false)) + }) + it('gas cost for entire word', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(768, false)) + }) + }) + + describe('lte = true', () => { + it('returns same tick if initialized', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(78, true) + + expect(next).to.eq(78) + expect(initialized).to.eq(true) + }) + it('returns tick directly to the left of input tick if not initialized', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(79, true) + + expect(next).to.eq(78) + expect(initialized).to.eq(true) + }) + it('will not exceed the word boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(258, true) + + expect(next).to.eq(256) + expect(initialized).to.eq(false) + }) + it('at the word boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(256, true) + + expect(next).to.eq(256) + expect(initialized).to.eq(false) + }) + it('word boundary less 1 (next initialized tick in next word)', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(72, true) + + expect(next).to.eq(70) + expect(initialized).to.eq(true) + }) + it('word boundary', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(-257, true) + + expect(next).to.eq(-512) + expect(initialized).to.eq(false) + }) + it('entire empty word', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(1023, true) + + expect(next).to.eq(768) + expect(initialized).to.eq(false) + }) + it('halfway through empty word', async () => { + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(900, true) + + expect(next).to.eq(768) + expect(initialized).to.eq(false) + }) + it('boundary is initialized', async () => { + await tickBitmap.flipTick(329) + const { next, initialized } = await tickBitmap.nextInitializedTickWithinOneWord(456, true) + + expect(next).to.eq(329) + expect(initialized).to.eq(true) + }) + + it('gas cost on boundary', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(256, true)) + }) + it('gas cost just below boundary', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(255, true)) + }) + it('gas cost for entire word', async () => { + await snapshotGasCost(await tickBitmap.getGasCostOfNextInitializedTickWithinOneWord(1024, true)) + }) + }) + }) +}) diff --git a/lib/v3-core/test/TickMath.spec.ts b/lib/v3-core/test/TickMath.spec.ts new file mode 100644 index 0000000..8e03a60 --- /dev/null +++ b/lib/v3-core/test/TickMath.spec.ts @@ -0,0 +1,166 @@ +import { BigNumber } from 'ethers' +import { ethers } from 'hardhat' +import { TickMathTest } from '../typechain/TickMathTest' +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' +import { encodePriceSqrt, MIN_SQRT_RATIO, MAX_SQRT_RATIO } from './shared/utilities' +import Decimal from 'decimal.js' + +const MIN_TICK = -887272 +const MAX_TICK = 887272 + +Decimal.config({ toExpNeg: -500, toExpPos: 500 }) + +describe('TickMath', () => { + let tickMath: TickMathTest + + before('deploy TickMathTest', async () => { + const factory = await ethers.getContractFactory('TickMathTest') + tickMath = (await factory.deploy()) as TickMathTest + }) + + describe('#getSqrtRatioAtTick', () => { + it('throws for too low', async () => { + await expect(tickMath.getSqrtRatioAtTick(MIN_TICK - 1)).to.be.revertedWith('T') + }) + + it('throws for too low', async () => { + await expect(tickMath.getSqrtRatioAtTick(MAX_TICK + 1)).to.be.revertedWith('T') + }) + + it('min tick', async () => { + expect(await tickMath.getSqrtRatioAtTick(MIN_TICK)).to.eq('4295128739') + }) + + it('min tick +1', async () => { + expect(await tickMath.getSqrtRatioAtTick(MIN_TICK + 1)).to.eq('4295343490') + }) + + it('max tick - 1', async () => { + expect(await tickMath.getSqrtRatioAtTick(MAX_TICK - 1)).to.eq('1461373636630004318706518188784493106690254656249') + }) + + it('min tick ratio is less than js implementation', async () => { + expect(await tickMath.getSqrtRatioAtTick(MIN_TICK)).to.be.lt(encodePriceSqrt(1, BigNumber.from(2).pow(127))) + }) + + it('max tick ratio is greater than js implementation', async () => { + expect(await tickMath.getSqrtRatioAtTick(MAX_TICK)).to.be.gt(encodePriceSqrt(BigNumber.from(2).pow(127), 1)) + }) + + it('max tick', async () => { + expect(await tickMath.getSqrtRatioAtTick(MAX_TICK)).to.eq('1461446703485210103287273052203988822378723970342') + }) + + for (const absTick of [ + 50, + 100, + 250, + 500, + 1_000, + 2_500, + 3_000, + 4_000, + 5_000, + 50_000, + 150_000, + 250_000, + 500_000, + 738_203, + ]) { + for (const tick of [-absTick, absTick]) { + describe(`tick ${tick}`, () => { + it('is at most off by 1/100th of a bips', async () => { + const jsResult = new Decimal(1.0001).pow(tick).sqrt().mul(new Decimal(2).pow(96)) + const result = await tickMath.getSqrtRatioAtTick(tick) + const absDiff = new Decimal(result.toString()).sub(jsResult).abs() + expect(absDiff.div(jsResult).toNumber()).to.be.lt(0.000001) + }) + it('result', async () => { + expect((await tickMath.getSqrtRatioAtTick(tick)).toString()).to.matchSnapshot() + }) + it('gas', async () => { + await snapshotGasCost(tickMath.getGasCostOfGetSqrtRatioAtTick(tick)) + }) + }) + } + } + }) + + describe('#MIN_SQRT_RATIO', async () => { + it('equals #getSqrtRatioAtTick(MIN_TICK)', async () => { + const min = await tickMath.getSqrtRatioAtTick(MIN_TICK) + expect(min).to.eq(await tickMath.MIN_SQRT_RATIO()) + expect(min).to.eq(MIN_SQRT_RATIO) + }) + }) + + describe('#MAX_SQRT_RATIO', async () => { + it('equals #getSqrtRatioAtTick(MAX_TICK)', async () => { + const max = await tickMath.getSqrtRatioAtTick(MAX_TICK) + expect(max).to.eq(await tickMath.MAX_SQRT_RATIO()) + expect(max).to.eq(MAX_SQRT_RATIO) + }) + }) + + describe('#getTickAtSqrtRatio', () => { + it('throws for too low', async () => { + await expect(tickMath.getTickAtSqrtRatio(MIN_SQRT_RATIO.sub(1))).to.be.revertedWith('R') + }) + + it('throws for too high', async () => { + await expect(tickMath.getTickAtSqrtRatio(BigNumber.from(MAX_SQRT_RATIO))).to.be.revertedWith('R') + }) + + it('ratio of min tick', async () => { + expect(await tickMath.getTickAtSqrtRatio(MIN_SQRT_RATIO)).to.eq(MIN_TICK) + }) + it('ratio of min tick + 1', async () => { + expect(await tickMath.getTickAtSqrtRatio('4295343490')).to.eq(MIN_TICK + 1) + }) + it('ratio of max tick - 1', async () => { + expect(await tickMath.getTickAtSqrtRatio('1461373636630004318706518188784493106690254656249')).to.eq(MAX_TICK - 1) + }) + it('ratio closest to max tick', async () => { + expect(await tickMath.getTickAtSqrtRatio(MAX_SQRT_RATIO.sub(1))).to.eq(MAX_TICK - 1) + }) + + for (const ratio of [ + MIN_SQRT_RATIO, + encodePriceSqrt(BigNumber.from(10).pow(12), 1), + encodePriceSqrt(BigNumber.from(10).pow(6), 1), + encodePriceSqrt(1, 64), + encodePriceSqrt(1, 8), + encodePriceSqrt(1, 2), + encodePriceSqrt(1, 1), + encodePriceSqrt(2, 1), + encodePriceSqrt(8, 1), + encodePriceSqrt(64, 1), + encodePriceSqrt(1, BigNumber.from(10).pow(6)), + encodePriceSqrt(1, BigNumber.from(10).pow(12)), + MAX_SQRT_RATIO.sub(1), + ]) { + describe(`ratio ${ratio}`, () => { + it('is at most off by 1', async () => { + const jsResult = new Decimal(ratio.toString()).div(new Decimal(2).pow(96)).pow(2).log(1.0001).floor() + const result = await tickMath.getTickAtSqrtRatio(ratio) + const absDiff = new Decimal(result.toString()).sub(jsResult).abs() + expect(absDiff.toNumber()).to.be.lte(1) + }) + it('ratio is between the tick and tick+1', async () => { + const tick = await tickMath.getTickAtSqrtRatio(ratio) + const ratioOfTick = await tickMath.getSqrtRatioAtTick(tick) + const ratioOfTickPlusOne = await tickMath.getSqrtRatioAtTick(tick + 1) + expect(ratio).to.be.gte(ratioOfTick) + expect(ratio).to.be.lt(ratioOfTickPlusOne) + }) + it('result', async () => { + expect(await tickMath.getTickAtSqrtRatio(ratio)).to.matchSnapshot() + }) + it('gas', async () => { + await snapshotGasCost(tickMath.getGasCostOfGetTickAtSqrtRatio(ratio)) + }) + }) + } + }) +}) diff --git a/lib/v3-core/test/UniswapV3Factory.spec.ts b/lib/v3-core/test/UniswapV3Factory.spec.ts new file mode 100644 index 0000000..afdc922 --- /dev/null +++ b/lib/v3-core/test/UniswapV3Factory.spec.ts @@ -0,0 +1,177 @@ +import { Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { UniswapV3Factory } from '../typechain/UniswapV3Factory' +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' + +import { FeeAmount, getCreate2Address, TICK_SPACINGS } from './shared/utilities' + +const { constants } = ethers + +const TEST_ADDRESSES: [string, string] = [ + '0x1000000000000000000000000000000000000000', + '0x2000000000000000000000000000000000000000', +] + +const createFixtureLoader = waffle.createFixtureLoader + +describe('UniswapV3Factory', () => { + let wallet: Wallet, other: Wallet + + let factory: UniswapV3Factory + let poolBytecode: string + const fixture = async () => { + const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') + return (await factoryFactory.deploy()) as UniswapV3Factory + } + + let loadFixture: ReturnType + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + + loadFixture = createFixtureLoader([wallet, other]) + }) + + before('load pool bytecode', async () => { + poolBytecode = (await ethers.getContractFactory('UniswapV3Pool')).bytecode + }) + + beforeEach('deploy factory', async () => { + factory = await loadFixture(fixture) + }) + + it('owner is deployer', async () => { + expect(await factory.owner()).to.eq(wallet.address) + }) + + it('factory bytecode size', async () => { + expect(((await waffle.provider.getCode(factory.address)).length - 2) / 2).to.matchSnapshot() + }) + + it('pool bytecode size', async () => { + await factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM) + const poolAddress = getCreate2Address(factory.address, TEST_ADDRESSES, FeeAmount.MEDIUM, poolBytecode) + expect(((await waffle.provider.getCode(poolAddress)).length - 2) / 2).to.matchSnapshot() + }) + + it('initial enabled fee amounts', async () => { + expect(await factory.feeAmountTickSpacing(FeeAmount.LOW)).to.eq(TICK_SPACINGS[FeeAmount.LOW]) + expect(await factory.feeAmountTickSpacing(FeeAmount.MEDIUM)).to.eq(TICK_SPACINGS[FeeAmount.MEDIUM]) + expect(await factory.feeAmountTickSpacing(FeeAmount.HIGH)).to.eq(TICK_SPACINGS[FeeAmount.HIGH]) + }) + + async function createAndCheckPool( + tokens: [string, string], + feeAmount: FeeAmount, + tickSpacing: number = TICK_SPACINGS[feeAmount] + ) { + const create2Address = getCreate2Address(factory.address, tokens, feeAmount, poolBytecode) + const create = factory.createPool(tokens[0], tokens[1], feeAmount) + + await expect(create) + .to.emit(factory, 'PoolCreated') + .withArgs(TEST_ADDRESSES[0], TEST_ADDRESSES[1], feeAmount, tickSpacing, create2Address) + + await expect(factory.createPool(tokens[0], tokens[1], feeAmount)).to.be.reverted + await expect(factory.createPool(tokens[1], tokens[0], feeAmount)).to.be.reverted + expect(await factory.getPool(tokens[0], tokens[1], feeAmount), 'getPool in order').to.eq(create2Address) + expect(await factory.getPool(tokens[1], tokens[0], feeAmount), 'getPool in reverse').to.eq(create2Address) + + const poolContractFactory = await ethers.getContractFactory('UniswapV3Pool') + const pool = poolContractFactory.attach(create2Address) + expect(await pool.factory(), 'pool factory address').to.eq(factory.address) + expect(await pool.token0(), 'pool token0').to.eq(TEST_ADDRESSES[0]) + expect(await pool.token1(), 'pool token1').to.eq(TEST_ADDRESSES[1]) + expect(await pool.fee(), 'pool fee').to.eq(feeAmount) + expect(await pool.tickSpacing(), 'pool tick spacing').to.eq(tickSpacing) + } + + describe('#createPool', () => { + it('succeeds for low fee pool', async () => { + await createAndCheckPool(TEST_ADDRESSES, FeeAmount.LOW) + }) + + it('succeeds for medium fee pool', async () => { + await createAndCheckPool(TEST_ADDRESSES, FeeAmount.MEDIUM) + }) + it('succeeds for high fee pool', async () => { + await createAndCheckPool(TEST_ADDRESSES, FeeAmount.HIGH) + }) + + it('succeeds if tokens are passed in reverse', async () => { + await createAndCheckPool([TEST_ADDRESSES[1], TEST_ADDRESSES[0]], FeeAmount.MEDIUM) + }) + + it('fails if token a == token b', async () => { + await expect(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[0], FeeAmount.LOW)).to.be.reverted + }) + + it('fails if token a is 0 or token b is 0', async () => { + await expect(factory.createPool(TEST_ADDRESSES[0], constants.AddressZero, FeeAmount.LOW)).to.be.reverted + await expect(factory.createPool(constants.AddressZero, TEST_ADDRESSES[0], FeeAmount.LOW)).to.be.reverted + await expect(factory.createPool(constants.AddressZero, constants.AddressZero, FeeAmount.LOW)).to.be.revertedWith( + '' + ) + }) + + it('fails if fee amount is not enabled', async () => { + await expect(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], 250)).to.be.reverted + }) + + it('gas', async () => { + await snapshotGasCost(factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM)) + }) + }) + + describe('#setOwner', () => { + it('fails if caller is not owner', async () => { + await expect(factory.connect(other).setOwner(wallet.address)).to.be.reverted + }) + + it('updates owner', async () => { + await factory.setOwner(other.address) + expect(await factory.owner()).to.eq(other.address) + }) + + it('emits event', async () => { + await expect(factory.setOwner(other.address)) + .to.emit(factory, 'OwnerChanged') + .withArgs(wallet.address, other.address) + }) + + it('cannot be called by original owner', async () => { + await factory.setOwner(other.address) + await expect(factory.setOwner(wallet.address)).to.be.reverted + }) + }) + + describe('#enableFeeAmount', () => { + it('fails if caller is not owner', async () => { + await expect(factory.connect(other).enableFeeAmount(100, 2)).to.be.reverted + }) + it('fails if fee is too great', async () => { + await expect(factory.enableFeeAmount(1000000, 10)).to.be.reverted + }) + it('fails if tick spacing is too small', async () => { + await expect(factory.enableFeeAmount(500, 0)).to.be.reverted + }) + it('fails if tick spacing is too large', async () => { + await expect(factory.enableFeeAmount(500, 16834)).to.be.reverted + }) + it('fails if already initialized', async () => { + await factory.enableFeeAmount(100, 5) + await expect(factory.enableFeeAmount(100, 10)).to.be.reverted + }) + it('sets the fee amount in the mapping', async () => { + await factory.enableFeeAmount(100, 5) + expect(await factory.feeAmountTickSpacing(100)).to.eq(5) + }) + it('emits an event', async () => { + await expect(factory.enableFeeAmount(100, 5)).to.emit(factory, 'FeeAmountEnabled').withArgs(100, 5) + }) + it('enables pool creation', async () => { + await factory.enableFeeAmount(250, 15) + await createAndCheckPool([TEST_ADDRESSES[0], TEST_ADDRESSES[1]], 250, 15) + }) + }) +}) diff --git a/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts b/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts new file mode 100644 index 0000000..3c3de00 --- /dev/null +++ b/lib/v3-core/test/UniswapV3Pool.arbitrage.spec.ts @@ -0,0 +1,373 @@ +import Decimal from 'decimal.js' +import { BigNumber, BigNumberish, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' +import { TickMathTest } from '../typechain/TickMathTest' +import { UniswapV3PoolSwapTest } from '../typechain/UniswapV3PoolSwapTest' +import { expect } from './shared/expect' + +import { poolFixture } from './shared/fixtures' +import { formatPrice, formatTokenAmount } from './shared/format' + +import { + createPoolFunctions, + encodePriceSqrt, + expandTo18Decimals, + FeeAmount, + getMaxLiquidityPerTick, + getMaxTick, + getMinTick, + MAX_SQRT_RATIO, + MaxUint128, + MIN_SQRT_RATIO, + MintFunction, + SwapFunction, + TICK_SPACINGS, +} from './shared/utilities' + +const { + constants: { MaxUint256 }, +} = ethers + +const createFixtureLoader = waffle.createFixtureLoader + +Decimal.config({ toExpNeg: -500, toExpPos: 500 }) + +function applySqrtRatioBipsHundredthsDelta(sqrtRatio: BigNumber, bipsHundredths: number): BigNumber { + return BigNumber.from( + new Decimal( + sqrtRatio + .mul(sqrtRatio) + .mul(1e6 + bipsHundredths) + .div(1e6) + .toString() + ) + .sqrt() + .floor() + .toString() + ) +} + +describe('UniswapV3Pool arbitrage tests', () => { + let wallet: Wallet, arbitrageur: Wallet + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + ;[wallet, arbitrageur] = await (ethers as any).getSigners() + loadFixture = createFixtureLoader([wallet, arbitrageur]) + }) + + for (const feeProtocol of [0, 6]) { + describe(`protocol fee = ${feeProtocol};`, () => { + const startingPrice = encodePriceSqrt(1, 1) + const startingTick = 0 + const feeAmount = FeeAmount.MEDIUM + const tickSpacing = TICK_SPACINGS[feeAmount] + const minTick = getMinTick(tickSpacing) + const maxTick = getMaxTick(tickSpacing) + + for (const passiveLiquidity of [ + expandTo18Decimals(1).div(100), + expandTo18Decimals(1), + expandTo18Decimals(10), + expandTo18Decimals(100), + ]) { + describe(`passive liquidity of ${formatTokenAmount(passiveLiquidity)}`, () => { + const arbTestFixture = async ([wallet, arbitrageur]: Wallet[]) => { + const fix = await poolFixture([wallet], waffle.provider) + + const pool = await fix.createPool(feeAmount, tickSpacing) + + await fix.token0.transfer(arbitrageur.address, BigNumber.from(2).pow(254)) + await fix.token1.transfer(arbitrageur.address, BigNumber.from(2).pow(254)) + + const { + swapExact0For1, + swapToHigherPrice, + swapToLowerPrice, + swapExact1For0, + mint, + } = await createPoolFunctions({ + swapTarget: fix.swapTargetCallee, + token0: fix.token0, + token1: fix.token1, + pool, + }) + + const testerFactory = await ethers.getContractFactory('UniswapV3PoolSwapTest') + const tester = (await testerFactory.deploy()) as UniswapV3PoolSwapTest + + const tickMathFactory = await ethers.getContractFactory('TickMathTest') + const tickMath = (await tickMathFactory.deploy()) as TickMathTest + + await fix.token0.approve(tester.address, MaxUint256) + await fix.token1.approve(tester.address, MaxUint256) + + await pool.initialize(startingPrice) + if (feeProtocol != 0) await pool.setFeeProtocol(feeProtocol, feeProtocol) + await mint(wallet.address, minTick, maxTick, passiveLiquidity) + + expect((await pool.slot0()).tick).to.eq(startingTick) + expect((await pool.slot0()).sqrtPriceX96).to.eq(startingPrice) + + return { pool, swapExact0For1, mint, swapToHigherPrice, swapToLowerPrice, swapExact1For0, tester, tickMath } + } + + let swapExact0For1: SwapFunction + let swapToHigherPrice: SwapFunction + let swapToLowerPrice: SwapFunction + let swapExact1For0: SwapFunction + let pool: MockTimeUniswapV3Pool + let mint: MintFunction + let tester: UniswapV3PoolSwapTest + let tickMath: TickMathTest + + beforeEach('load the fixture', async () => { + ;({ + swapExact0For1, + pool, + mint, + swapToHigherPrice, + swapToLowerPrice, + swapExact1For0, + tester, + tickMath, + } = await loadFixture(arbTestFixture)) + }) + + async function simulateSwap( + zeroForOne: boolean, + amountSpecified: BigNumberish, + sqrtPriceLimitX96?: BigNumber + ): Promise<{ + executionPrice: BigNumber + nextSqrtRatio: BigNumber + amount0Delta: BigNumber + amount1Delta: BigNumber + }> { + const { amount0Delta, amount1Delta, nextSqrtRatio } = await tester.callStatic.getSwapResult( + pool.address, + zeroForOne, + amountSpecified, + sqrtPriceLimitX96 ?? (zeroForOne ? MIN_SQRT_RATIO.add(1) : MAX_SQRT_RATIO.sub(1)) + ) + + const executionPrice = zeroForOne + ? encodePriceSqrt(amount1Delta, amount0Delta.mul(-1)) + : encodePriceSqrt(amount1Delta.mul(-1), amount0Delta) + + return { executionPrice, nextSqrtRatio, amount0Delta, amount1Delta } + } + + for (const { zeroForOne, assumedTruePriceAfterSwap, inputAmount, description } of [ + { + description: 'exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98', + zeroForOne: true, + inputAmount: expandTo18Decimals(10), + assumedTruePriceAfterSwap: encodePriceSqrt(98, 100), + }, + { + description: 'exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01', + zeroForOne: true, + inputAmount: expandTo18Decimals(10), + assumedTruePriceAfterSwap: encodePriceSqrt(101, 100), + }, + ]) { + describe(description, () => { + function valueToken1(arbBalance0: BigNumber, arbBalance1: BigNumber) { + return assumedTruePriceAfterSwap + .mul(assumedTruePriceAfterSwap) + .mul(arbBalance0) + .div(BigNumber.from(2).pow(192)) + .add(arbBalance1) + } + + it('not sandwiched', async () => { + const { executionPrice, amount1Delta, amount0Delta } = await simulateSwap(zeroForOne, inputAmount) + zeroForOne + ? await swapExact0For1(inputAmount, wallet.address) + : await swapExact1For0(inputAmount, wallet.address) + + expect({ + executionPrice: formatPrice(executionPrice), + amount0Delta: formatTokenAmount(amount0Delta), + amount1Delta: formatTokenAmount(amount1Delta), + priceAfter: formatPrice((await pool.slot0()).sqrtPriceX96), + }).to.matchSnapshot() + }) + + it('sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity', async () => { + const { executionPrice } = await simulateSwap(zeroForOne, inputAmount) + + const firstTickAboveMarginalPrice = zeroForOne + ? Math.ceil( + (await tickMath.getTickAtSqrtRatio( + applySqrtRatioBipsHundredthsDelta(executionPrice, feeAmount) + )) / tickSpacing + ) * tickSpacing + : Math.floor( + (await tickMath.getTickAtSqrtRatio( + applySqrtRatioBipsHundredthsDelta(executionPrice, -feeAmount) + )) / tickSpacing + ) * tickSpacing + const tickAfterFirstTickAboveMarginPrice = zeroForOne + ? firstTickAboveMarginalPrice - tickSpacing + : firstTickAboveMarginalPrice + tickSpacing + + const priceSwapStart = await tickMath.getSqrtRatioAtTick(firstTickAboveMarginalPrice) + + let arbBalance0 = BigNumber.from(0) + let arbBalance1 = BigNumber.from(0) + + // first frontrun to the first tick before the execution price + const { + amount0Delta: frontrunDelta0, + amount1Delta: frontrunDelta1, + executionPrice: frontrunExecutionPrice, + } = await simulateSwap(zeroForOne, MaxUint256.div(2), priceSwapStart) + arbBalance0 = arbBalance0.sub(frontrunDelta0) + arbBalance1 = arbBalance1.sub(frontrunDelta1) + zeroForOne + ? await swapToLowerPrice(priceSwapStart, arbitrageur.address) + : await swapToHigherPrice(priceSwapStart, arbitrageur.address) + + const profitToken1AfterFrontRun = valueToken1(arbBalance0, arbBalance1) + + const tickLower = zeroForOne ? tickAfterFirstTickAboveMarginPrice : firstTickAboveMarginalPrice + const tickUpper = zeroForOne ? firstTickAboveMarginalPrice : tickAfterFirstTickAboveMarginPrice + + // deposit max liquidity at the tick + const mintReceipt = await ( + await mint(wallet.address, tickLower, tickUpper, getMaxLiquidityPerTick(tickSpacing)) + ).wait() + // sub the mint costs + const { amount0: amount0Mint, amount1: amount1Mint } = pool.interface.decodeEventLog( + pool.interface.events['Mint(address,address,int24,int24,uint128,uint256,uint256)'], + mintReceipt.events?.[2].data! + ) + arbBalance0 = arbBalance0.sub(amount0Mint) + arbBalance1 = arbBalance1.sub(amount1Mint) + + // execute the user's swap + const { executionPrice: executionPriceAfterFrontrun } = await simulateSwap(zeroForOne, inputAmount) + zeroForOne + ? await swapExact0For1(inputAmount, wallet.address) + : await swapExact1For0(inputAmount, wallet.address) + + // burn the arb's liquidity + const { amount0: amount0Burn, amount1: amount1Burn } = await pool.callStatic.burn( + tickLower, + tickUpper, + getMaxLiquidityPerTick(tickSpacing) + ) + await pool.burn(tickLower, tickUpper, getMaxLiquidityPerTick(tickSpacing)) + arbBalance0 = arbBalance0.add(amount0Burn) + arbBalance1 = arbBalance1.add(amount1Burn) + + // add the fees as well + const { + amount0: amount0CollectAndBurn, + amount1: amount1CollectAndBurn, + } = await pool.callStatic.collect(arbitrageur.address, tickLower, tickUpper, MaxUint128, MaxUint128) + const [amount0Collect, amount1Collect] = [ + amount0CollectAndBurn.sub(amount0Burn), + amount1CollectAndBurn.sub(amount1Burn), + ] + arbBalance0 = arbBalance0.add(amount0Collect) + arbBalance1 = arbBalance1.add(amount1Collect) + + const profitToken1AfterSandwich = valueToken1(arbBalance0, arbBalance1) + + // backrun the swap to true price, i.e. swap to the marginal price = true price + const priceToSwapTo = zeroForOne + ? applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, -feeAmount) + : applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, feeAmount) + const { + amount0Delta: backrunDelta0, + amount1Delta: backrunDelta1, + executionPrice: backrunExecutionPrice, + } = await simulateSwap(!zeroForOne, MaxUint256.div(2), priceToSwapTo) + await swapToHigherPrice(priceToSwapTo, wallet.address) + arbBalance0 = arbBalance0.sub(backrunDelta0) + arbBalance1 = arbBalance1.sub(backrunDelta1) + + expect({ + sandwichedPrice: formatPrice(executionPriceAfterFrontrun), + arbBalanceDelta0: formatTokenAmount(arbBalance0), + arbBalanceDelta1: formatTokenAmount(arbBalance1), + profit: { + final: formatTokenAmount(valueToken1(arbBalance0, arbBalance1)), + afterFrontrun: formatTokenAmount(profitToken1AfterFrontRun), + afterSandwich: formatTokenAmount(profitToken1AfterSandwich), + }, + backrun: { + executionPrice: formatPrice(backrunExecutionPrice), + delta0: formatTokenAmount(backrunDelta0), + delta1: formatTokenAmount(backrunDelta1), + }, + frontrun: { + executionPrice: formatPrice(frontrunExecutionPrice), + delta0: formatTokenAmount(frontrunDelta0), + delta1: formatTokenAmount(frontrunDelta1), + }, + collect: { + amount0: formatTokenAmount(amount0Collect), + amount1: formatTokenAmount(amount1Collect), + }, + burn: { + amount0: formatTokenAmount(amount0Burn), + amount1: formatTokenAmount(amount1Burn), + }, + mint: { + amount0: formatTokenAmount(amount0Mint), + amount1: formatTokenAmount(amount1Mint), + }, + finalPrice: formatPrice((await pool.slot0()).sqrtPriceX96), + }).to.matchSnapshot() + }) + + it('backrun to true price after swap only', async () => { + let arbBalance0 = BigNumber.from(0) + let arbBalance1 = BigNumber.from(0) + + zeroForOne + ? await swapExact0For1(inputAmount, wallet.address) + : await swapExact1For0(inputAmount, wallet.address) + + // swap to the marginal price = true price + const priceToSwapTo = zeroForOne + ? applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, -feeAmount) + : applySqrtRatioBipsHundredthsDelta(assumedTruePriceAfterSwap, feeAmount) + const { + amount0Delta: backrunDelta0, + amount1Delta: backrunDelta1, + executionPrice: backrunExecutionPrice, + } = await simulateSwap(!zeroForOne, MaxUint256.div(2), priceToSwapTo) + zeroForOne + ? await swapToHigherPrice(priceToSwapTo, wallet.address) + : await swapToLowerPrice(priceToSwapTo, wallet.address) + arbBalance0 = arbBalance0.sub(backrunDelta0) + arbBalance1 = arbBalance1.sub(backrunDelta1) + + expect({ + arbBalanceDelta0: formatTokenAmount(arbBalance0), + arbBalanceDelta1: formatTokenAmount(arbBalance1), + profit: { + final: formatTokenAmount(valueToken1(arbBalance0, arbBalance1)), + }, + backrun: { + executionPrice: formatPrice(backrunExecutionPrice), + delta0: formatTokenAmount(backrunDelta0), + delta1: formatTokenAmount(backrunDelta1), + }, + finalPrice: formatPrice((await pool.slot0()).sqrtPriceX96), + }).to.matchSnapshot() + }) + }) + } + }) + } + }) + } +}) diff --git a/lib/v3-core/test/UniswapV3Pool.gas.spec.ts b/lib/v3-core/test/UniswapV3Pool.gas.spec.ts new file mode 100644 index 0000000..877c181 --- /dev/null +++ b/lib/v3-core/test/UniswapV3Pool.gas.spec.ts @@ -0,0 +1,315 @@ +import { ethers, waffle } from 'hardhat' +import { Wallet } from 'ethers' +import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' +import { expect } from './shared/expect' + +import { poolFixture } from './shared/fixtures' +import snapshotGasCost from './shared/snapshotGasCost' + +import { + expandTo18Decimals, + FeeAmount, + getMinTick, + encodePriceSqrt, + TICK_SPACINGS, + createPoolFunctions, + SwapFunction, + MintFunction, + getMaxTick, + MaxUint128, + SwapToPriceFunction, + MAX_SQRT_RATIO, + MIN_SQRT_RATIO, +} from './shared/utilities' + +const createFixtureLoader = waffle.createFixtureLoader + +describe('UniswapV3Pool gas tests', () => { + let wallet: Wallet, other: Wallet + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + loadFixture = createFixtureLoader([wallet, other]) + }) + + for (const feeProtocol of [0, 6]) { + describe(feeProtocol > 0 ? 'fee is on' : 'fee is off', () => { + const startingPrice = encodePriceSqrt(100001, 100000) + const startingTick = 0 + const feeAmount = FeeAmount.MEDIUM + const tickSpacing = TICK_SPACINGS[feeAmount] + const minTick = getMinTick(tickSpacing) + const maxTick = getMaxTick(tickSpacing) + + const gasTestFixture = async ([wallet]: Wallet[]) => { + const fix = await poolFixture([wallet], waffle.provider) + + const pool = await fix.createPool(feeAmount, tickSpacing) + + const { swapExact0For1, swapToHigherPrice, mint, swapToLowerPrice } = await createPoolFunctions({ + swapTarget: fix.swapTargetCallee, + token0: fix.token0, + token1: fix.token1, + pool, + }) + + await pool.initialize(encodePriceSqrt(1, 1)) + await pool.setFeeProtocol(feeProtocol, feeProtocol) + await pool.increaseObservationCardinalityNext(4) + await pool.advanceTime(1) + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(2)) + + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await pool.advanceTime(1) + await swapToHigherPrice(startingPrice, wallet.address) + await pool.advanceTime(1) + expect((await pool.slot0()).tick).to.eq(startingTick) + expect((await pool.slot0()).sqrtPriceX96).to.eq(startingPrice) + + return { pool, swapExact0For1, mint, swapToHigherPrice, swapToLowerPrice } + } + + let swapExact0For1: SwapFunction + let swapToHigherPrice: SwapToPriceFunction + let swapToLowerPrice: SwapToPriceFunction + let pool: MockTimeUniswapV3Pool + let mint: MintFunction + + beforeEach('load the fixture', async () => { + ;({ swapExact0For1, pool, mint, swapToHigherPrice, swapToLowerPrice } = await loadFixture(gasTestFixture)) + }) + + describe('#swapExact0For1', () => { + it('first swap in block with no tick movement', async () => { + await snapshotGasCost(swapExact0For1(2000, wallet.address)) + expect((await pool.slot0()).sqrtPriceX96).to.not.eq(startingPrice) + expect((await pool.slot0()).tick).to.eq(startingTick) + }) + + it('first swap in block moves tick, no initialized crossings', async () => { + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address)) + expect((await pool.slot0()).tick).to.eq(startingTick - 1) + }) + + it('second swap in block with no tick movement', async () => { + await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) + expect((await pool.slot0()).tick).to.eq(startingTick - 1) + await snapshotGasCost(swapExact0For1(2000, wallet.address)) + expect((await pool.slot0()).tick).to.eq(startingTick - 1) + }) + + it('second swap in block moves tick, no initialized crossings', async () => { + await swapExact0For1(1000, wallet.address) + expect((await pool.slot0()).tick).to.eq(startingTick) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address)) + expect((await pool.slot0()).tick).to.eq(startingTick - 1) + }) + + it('first swap in block, large swap, no initialized crossings', async () => { + await snapshotGasCost(swapExact0For1(expandTo18Decimals(10), wallet.address)) + expect((await pool.slot0()).tick).to.eq(-35787) + }) + + it('first swap in block, large swap crossing several initialized ticks', async () => { + await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) + await mint( + wallet.address, + startingTick - 4 * tickSpacing, + startingTick - 2 * tickSpacing, + expandTo18Decimals(1) + ) + expect((await pool.slot0()).tick).to.eq(startingTick) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) // we crossed the last tick + }) + + it('first swap in block, large swap crossing a single initialized tick', async () => { + await mint(wallet.address, minTick, startingTick - 2 * tickSpacing, expandTo18Decimals(1)) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(startingTick - 2 * tickSpacing) // we crossed the last tick + }) + + it('second swap in block, large swap crossing several initialized ticks', async () => { + await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) + await mint( + wallet.address, + startingTick - 4 * tickSpacing, + startingTick - 2 * tickSpacing, + expandTo18Decimals(1) + ) + await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) + }) + + it('second swap in block, large swap crossing a single initialized tick', async () => { + await mint(wallet.address, minTick, startingTick - 2 * tickSpacing, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(10000), wallet.address) + expect((await pool.slot0()).tick).to.be.gt(startingTick - 2 * tickSpacing) // we didn't cross the initialized tick + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(startingTick - 2 * tickSpacing) // we crossed the last tick + }) + + it('large swap crossing several initialized ticks after some time passes', async () => { + await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) + await mint( + wallet.address, + startingTick - 4 * tickSpacing, + startingTick - 2 * tickSpacing, + expandTo18Decimals(1) + ) + await swapExact0For1(2, wallet.address) + await pool.advanceTime(1) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(startingTick - 4 * tickSpacing) + }) + + it('large swap crossing several initialized ticks second time after some time passes', async () => { + await mint(wallet.address, startingTick - 3 * tickSpacing, startingTick - tickSpacing, expandTo18Decimals(1)) + await mint( + wallet.address, + startingTick - 4 * tickSpacing, + startingTick - 2 * tickSpacing, + expandTo18Decimals(1) + ) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await swapToHigherPrice(startingPrice, wallet.address) + await pool.advanceTime(1) + await snapshotGasCost(swapExact0For1(expandTo18Decimals(1), wallet.address)) + expect((await pool.slot0()).tick).to.be.lt(tickSpacing * -4) + }) + }) + + describe('#mint', () => { + for (const { description, tickLower, tickUpper } of [ + { + description: 'around current price', + tickLower: startingTick - tickSpacing, + tickUpper: startingTick + tickSpacing, + }, + { + description: 'below current price', + tickLower: startingTick - 2 * tickSpacing, + tickUpper: startingTick - tickSpacing, + }, + { + description: 'above current price', + tickLower: startingTick + tickSpacing, + tickUpper: startingTick + 2 * tickSpacing, + }, + ]) { + describe(description, () => { + it('new position mint first in range', async () => { + await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) + }) + it('add to position existing', async () => { + await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) + await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) + }) + it('second position in same range', async () => { + await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) + await snapshotGasCost(mint(other.address, tickLower, tickUpper, expandTo18Decimals(1))) + }) + it('add to position after some time passes', async () => { + await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) + await pool.advanceTime(1) + await snapshotGasCost(mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1))) + }) + }) + } + }) + + describe('#burn', () => { + for (const { description, tickLower, tickUpper } of [ + { + description: 'around current price', + tickLower: startingTick - tickSpacing, + tickUpper: startingTick + tickSpacing, + }, + { + description: 'below current price', + tickLower: startingTick - 2 * tickSpacing, + tickUpper: startingTick - tickSpacing, + }, + { + description: 'above current price', + tickLower: startingTick + tickSpacing, + tickUpper: startingTick + 2 * tickSpacing, + }, + ]) { + describe(description, () => { + const liquidityAmount = expandTo18Decimals(1) + beforeEach('mint a position', async () => { + await mint(wallet.address, tickLower, tickUpper, liquidityAmount) + }) + + it('burn when only position using ticks', async () => { + await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) + }) + it('partial position burn', async () => { + await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1).div(2))) + }) + it('entire position burn but other positions are using the ticks', async () => { + await mint(other.address, tickLower, tickUpper, expandTo18Decimals(1)) + await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) + }) + it('burn entire position after some time passes', async () => { + await pool.advanceTime(1) + await snapshotGasCost(pool.burn(tickLower, tickUpper, expandTo18Decimals(1))) + }) + }) + } + }) + + describe('#poke', () => { + const tickLower = startingTick - tickSpacing + const tickUpper = startingTick + tickSpacing + + it('best case', async () => { + await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) + await pool.burn(tickLower, tickUpper, 0) + await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) + await snapshotGasCost(pool.burn(tickLower, tickUpper, 0)) + }) + }) + + describe('#collect', () => { + const tickLower = startingTick - tickSpacing + const tickUpper = startingTick + tickSpacing + + it('close to worst case', async () => { + await mint(wallet.address, tickLower, tickUpper, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(100), wallet.address) + await pool.burn(tickLower, tickUpper, 0) // poke to accumulate fees + await snapshotGasCost(pool.collect(wallet.address, tickLower, tickUpper, MaxUint128, MaxUint128)) + }) + }) + + describe('#increaseObservationCardinalityNext', () => { + it('grow by 1 slot', async () => { + await snapshotGasCost(pool.increaseObservationCardinalityNext(5)) + }) + it('no op', async () => { + await snapshotGasCost(pool.increaseObservationCardinalityNext(3)) + }) + }) + + describe('#snapshotCumulativesInside', () => { + it('tick inside', async () => { + await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) + }) + it('tick above', async () => { + await swapToHigherPrice(MAX_SQRT_RATIO.sub(1), wallet.address) + await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) + }) + it('tick below', async () => { + await swapToLowerPrice(MIN_SQRT_RATIO.add(1), wallet.address) + await snapshotGasCost(pool.estimateGas.snapshotCumulativesInside(minTick, maxTick)) + }) + }) + }) + } +}) diff --git a/lib/v3-core/test/UniswapV3Pool.spec.ts b/lib/v3-core/test/UniswapV3Pool.spec.ts new file mode 100644 index 0000000..a7eb75e --- /dev/null +++ b/lib/v3-core/test/UniswapV3Pool.spec.ts @@ -0,0 +1,2043 @@ +import { ethers, waffle } from 'hardhat' +import { BigNumber, BigNumberish, constants, Wallet } from 'ethers' +import { TestERC20 } from '../typechain/TestERC20' +import { UniswapV3Factory } from '../typechain/UniswapV3Factory' +import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' +import { TestUniswapV3SwapPay } from '../typechain/TestUniswapV3SwapPay' +import checkObservationEquals from './shared/checkObservationEquals' +import { expect } from './shared/expect' + +import { poolFixture, TEST_POOL_START_TIME } from './shared/fixtures' + +import { + expandTo18Decimals, + FeeAmount, + getPositionKey, + getMaxTick, + getMinTick, + encodePriceSqrt, + TICK_SPACINGS, + createPoolFunctions, + SwapFunction, + MintFunction, + getMaxLiquidityPerTick, + FlashFunction, + MaxUint128, + MAX_SQRT_RATIO, + MIN_SQRT_RATIO, + SwapToPriceFunction, +} from './shared/utilities' +import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' +import { TestUniswapV3ReentrantCallee } from '../typechain/TestUniswapV3ReentrantCallee' +import { TickMathTest } from '../typechain/TickMathTest' +import { SwapMathTest } from '../typechain/SwapMathTest' + +const createFixtureLoader = waffle.createFixtureLoader + +type ThenArg = T extends PromiseLike ? U : T + +describe('UniswapV3Pool', () => { + let wallet: Wallet, other: Wallet + + let token0: TestERC20 + let token1: TestERC20 + let token2: TestERC20 + + let factory: UniswapV3Factory + let pool: MockTimeUniswapV3Pool + + let swapTarget: TestUniswapV3Callee + + let swapToLowerPrice: SwapToPriceFunction + let swapToHigherPrice: SwapToPriceFunction + let swapExact0For1: SwapFunction + let swap0ForExact1: SwapFunction + let swapExact1For0: SwapFunction + let swap1ForExact0: SwapFunction + + let feeAmount: number + let tickSpacing: number + + let minTick: number + let maxTick: number + + let mint: MintFunction + let flash: FlashFunction + + let loadFixture: ReturnType + let createPool: ThenArg>['createPool'] + + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + loadFixture = createFixtureLoader([wallet, other]) + }) + + beforeEach('deploy fixture', async () => { + ;({ token0, token1, token2, factory, createPool, swapTargetCallee: swapTarget } = await loadFixture(poolFixture)) + + const oldCreatePool = createPool + createPool = async (_feeAmount, _tickSpacing) => { + const pool = await oldCreatePool(_feeAmount, _tickSpacing) + ;({ + swapToLowerPrice, + swapToHigherPrice, + swapExact0For1, + swap0ForExact1, + swapExact1For0, + swap1ForExact0, + mint, + flash, + } = createPoolFunctions({ + token0, + token1, + swapTarget, + pool, + })) + minTick = getMinTick(_tickSpacing) + maxTick = getMaxTick(_tickSpacing) + feeAmount = _feeAmount + tickSpacing = _tickSpacing + return pool + } + + // default to the 30 bips pool + pool = await createPool(FeeAmount.MEDIUM, TICK_SPACINGS[FeeAmount.MEDIUM]) + }) + + it('constructor initializes immutables', async () => { + expect(await pool.factory()).to.eq(factory.address) + expect(await pool.token0()).to.eq(token0.address) + expect(await pool.token1()).to.eq(token1.address) + expect(await pool.maxLiquidityPerTick()).to.eq(getMaxLiquidityPerTick(tickSpacing)) + }) + + describe('#initialize', () => { + it('fails if already initialized', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await expect(pool.initialize(encodePriceSqrt(1, 1))).to.be.reverted + }) + it('fails if starting price is too low', async () => { + await expect(pool.initialize(1)).to.be.revertedWith('R') + await expect(pool.initialize(MIN_SQRT_RATIO.sub(1))).to.be.revertedWith('R') + }) + it('fails if starting price is too high', async () => { + await expect(pool.initialize(MAX_SQRT_RATIO)).to.be.revertedWith('R') + await expect(pool.initialize(BigNumber.from(2).pow(160).sub(1))).to.be.revertedWith('R') + }) + it('can be initialized at MIN_SQRT_RATIO', async () => { + await pool.initialize(MIN_SQRT_RATIO) + expect((await pool.slot0()).tick).to.eq(getMinTick(1)) + }) + it('can be initialized at MAX_SQRT_RATIO - 1', async () => { + await pool.initialize(MAX_SQRT_RATIO.sub(1)) + expect((await pool.slot0()).tick).to.eq(getMaxTick(1) - 1) + }) + it('sets initial variables', async () => { + const price = encodePriceSqrt(1, 2) + await pool.initialize(price) + + const { sqrtPriceX96, observationIndex } = await pool.slot0() + expect(sqrtPriceX96).to.eq(price) + expect(observationIndex).to.eq(0) + expect((await pool.slot0()).tick).to.eq(-6932) + }) + it('initializes the first observations slot', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + checkObservationEquals(await pool.observations(0), { + secondsPerLiquidityCumulativeX128: 0, + initialized: true, + blockTimestamp: TEST_POOL_START_TIME, + tickCumulative: 0, + }) + }) + it('emits a Initialized event with the input tick', async () => { + const sqrtPriceX96 = encodePriceSqrt(1, 2) + await expect(pool.initialize(sqrtPriceX96)).to.emit(pool, 'Initialize').withArgs(sqrtPriceX96, -6932) + }) + }) + + describe('#increaseObservationCardinalityNext', () => { + it('can only be called after initialize', async () => { + await expect(pool.increaseObservationCardinalityNext(2)).to.be.revertedWith('LOK') + }) + it('emits an event including both old and new', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await expect(pool.increaseObservationCardinalityNext(2)) + .to.emit(pool, 'IncreaseObservationCardinalityNext') + .withArgs(1, 2) + }) + it('does not emit an event for no op call', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await pool.increaseObservationCardinalityNext(3) + await expect(pool.increaseObservationCardinalityNext(2)).to.not.emit(pool, 'IncreaseObservationCardinalityNext') + }) + it('does not change cardinality next if less than current', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await pool.increaseObservationCardinalityNext(3) + await pool.increaseObservationCardinalityNext(2) + expect((await pool.slot0()).observationCardinalityNext).to.eq(3) + }) + it('increases cardinality and cardinality next first time', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await pool.increaseObservationCardinalityNext(2) + const { observationCardinality, observationCardinalityNext } = await pool.slot0() + expect(observationCardinality).to.eq(1) + expect(observationCardinalityNext).to.eq(2) + }) + }) + + describe('#mint', () => { + it('fails if not initialized', async () => { + await expect(mint(wallet.address, -tickSpacing, tickSpacing, 1)).to.be.revertedWith('LOK') + }) + describe('after initialization', () => { + beforeEach('initialize the pool at price of 10:1', async () => { + await pool.initialize(encodePriceSqrt(1, 10)) + await mint(wallet.address, minTick, maxTick, 3161) + }) + + describe('failure cases', () => { + it('fails if tickLower greater than tickUpper', async () => { + // should be TLU but...hardhat + await expect(mint(wallet.address, 1, 0, 1)).to.be.reverted + }) + it('fails if tickLower less than min tick', async () => { + // should be TLM but...hardhat + await expect(mint(wallet.address, -887273, 0, 1)).to.be.reverted + }) + it('fails if tickUpper greater than max tick', async () => { + // should be TUM but...hardhat + await expect(mint(wallet.address, 0, 887273, 1)).to.be.reverted + }) + it('fails if amount exceeds the max', async () => { + // these should fail with 'LO' but hardhat is bugged + const maxLiquidityGross = await pool.maxLiquidityPerTick() + await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.add(1))).to + .be.reverted + await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross)).to.not.be + .reverted + }) + it('fails if total amount at tick exceeds the max', async () => { + // these should fail with 'LO' but hardhat is bugged + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 1000) + + const maxLiquidityGross = await pool.maxLiquidityPerTick() + await expect( + mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.sub(1000).add(1)) + ).to.be.reverted + await expect( + mint(wallet.address, minTick + tickSpacing * 2, maxTick - tickSpacing, maxLiquidityGross.sub(1000).add(1)) + ).to.be.reverted + await expect( + mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing * 2, maxLiquidityGross.sub(1000).add(1)) + ).to.be.reverted + await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, maxLiquidityGross.sub(1000))) + .to.not.be.reverted + }) + it('fails if amount is 0', async () => { + await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 0)).to.be.reverted + }) + }) + + describe('success cases', () => { + it('initial balances', async () => { + expect(await token0.balanceOf(pool.address)).to.eq(9996) + expect(await token1.balanceOf(pool.address)).to.eq(1000) + }) + + it('initial tick', async () => { + expect((await pool.slot0()).tick).to.eq(-23028) + }) + + describe('above current price', () => { + it('transfers token0 only', async () => { + await expect(mint(wallet.address, -22980, 0, 10000)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 21549) + .to.not.emit(token1, 'Transfer') + expect(await token0.balanceOf(pool.address)).to.eq(9996 + 21549) + expect(await token1.balanceOf(pool.address)).to.eq(1000) + }) + + it('max tick with max leverage', async () => { + await mint(wallet.address, maxTick - tickSpacing, maxTick, BigNumber.from(2).pow(102)) + expect(await token0.balanceOf(pool.address)).to.eq(9996 + 828011525) + expect(await token1.balanceOf(pool.address)).to.eq(1000) + }) + + it('works for max tick', async () => { + await expect(mint(wallet.address, -22980, maxTick, 10000)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 31549) + expect(await token0.balanceOf(pool.address)).to.eq(9996 + 31549) + expect(await token1.balanceOf(pool.address)).to.eq(1000) + }) + + it('removing works', async () => { + await mint(wallet.address, -240, 0, 10000) + await pool.burn(-240, 0, 10000) + const { amount0, amount1 } = await pool.callStatic.collect(wallet.address, -240, 0, MaxUint128, MaxUint128) + expect(amount0, 'amount0').to.eq(120) + expect(amount1, 'amount1').to.eq(0) + }) + + it('adds liquidity to liquidityGross', async () => { + await mint(wallet.address, -240, 0, 100) + expect((await pool.ticks(-240)).liquidityGross).to.eq(100) + expect((await pool.ticks(0)).liquidityGross).to.eq(100) + expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(0) + expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(0) + await mint(wallet.address, -240, tickSpacing, 150) + expect((await pool.ticks(-240)).liquidityGross).to.eq(250) + expect((await pool.ticks(0)).liquidityGross).to.eq(100) + expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(150) + expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(0) + await mint(wallet.address, 0, tickSpacing * 2, 60) + expect((await pool.ticks(-240)).liquidityGross).to.eq(250) + expect((await pool.ticks(0)).liquidityGross).to.eq(160) + expect((await pool.ticks(tickSpacing)).liquidityGross).to.eq(150) + expect((await pool.ticks(tickSpacing * 2)).liquidityGross).to.eq(60) + }) + + it('removes liquidity from liquidityGross', async () => { + await mint(wallet.address, -240, 0, 100) + await mint(wallet.address, -240, 0, 40) + await pool.burn(-240, 0, 90) + expect((await pool.ticks(-240)).liquidityGross).to.eq(50) + expect((await pool.ticks(0)).liquidityGross).to.eq(50) + }) + + it('clears tick lower if last position is removed', async () => { + await mint(wallet.address, -240, 0, 100) + await pool.burn(-240, 0, 100) + const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-240) + expect(liquidityGross).to.eq(0) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + }) + + it('clears tick upper if last position is removed', async () => { + await mint(wallet.address, -240, 0, 100) + await pool.burn(-240, 0, 100) + const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(0) + expect(liquidityGross).to.eq(0) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + }) + it('only clears the tick that is not used at all', async () => { + await mint(wallet.address, -240, 0, 100) + await mint(wallet.address, -tickSpacing, 0, 250) + await pool.burn(-240, 0, 100) + + let { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-240) + expect(liquidityGross).to.eq(0) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + ;({ liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128 } = await pool.ticks(-tickSpacing)) + expect(liquidityGross).to.eq(250) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + }) + + it('does not write an observation', async () => { + checkObservationEquals(await pool.observations(0), { + tickCumulative: 0, + blockTimestamp: TEST_POOL_START_TIME, + initialized: true, + secondsPerLiquidityCumulativeX128: 0, + }) + await pool.advanceTime(1) + await mint(wallet.address, -240, 0, 100) + checkObservationEquals(await pool.observations(0), { + tickCumulative: 0, + blockTimestamp: TEST_POOL_START_TIME, + initialized: true, + secondsPerLiquidityCumulativeX128: 0, + }) + }) + }) + + describe('including current price', () => { + it('price within range: transfers current price of both tokens', async () => { + await expect(mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 317) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 32) + expect(await token0.balanceOf(pool.address)).to.eq(9996 + 317) + expect(await token1.balanceOf(pool.address)).to.eq(1000 + 32) + }) + + it('initializes lower tick', async () => { + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) + const { liquidityGross } = await pool.ticks(minTick + tickSpacing) + expect(liquidityGross).to.eq(100) + }) + + it('initializes upper tick', async () => { + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) + const { liquidityGross } = await pool.ticks(maxTick - tickSpacing) + expect(liquidityGross).to.eq(100) + }) + + it('works for min/max tick', async () => { + await expect(mint(wallet.address, minTick, maxTick, 10000)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 31623) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 3163) + expect(await token0.balanceOf(pool.address)).to.eq(9996 + 31623) + expect(await token1.balanceOf(pool.address)).to.eq(1000 + 3163) + }) + + it('removing works', async () => { + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 100) + await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 100) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick + tickSpacing, + maxTick - tickSpacing, + MaxUint128, + MaxUint128 + ) + expect(amount0, 'amount0').to.eq(316) + expect(amount1, 'amount1').to.eq(31) + }) + + it('writes an observation', async () => { + checkObservationEquals(await pool.observations(0), { + tickCumulative: 0, + blockTimestamp: TEST_POOL_START_TIME, + initialized: true, + secondsPerLiquidityCumulativeX128: 0, + }) + await pool.advanceTime(1) + await mint(wallet.address, minTick, maxTick, 100) + checkObservationEquals(await pool.observations(0), { + tickCumulative: -23028, + blockTimestamp: TEST_POOL_START_TIME + 1, + initialized: true, + secondsPerLiquidityCumulativeX128: '107650226801941937191829992860413859', + }) + }) + }) + + describe('below current price', () => { + it('transfers token1 only', async () => { + await expect(mint(wallet.address, -46080, -23040, 10000)) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 2162) + .to.not.emit(token0, 'Transfer') + expect(await token0.balanceOf(pool.address)).to.eq(9996) + expect(await token1.balanceOf(pool.address)).to.eq(1000 + 2162) + }) + + it('min tick with max leverage', async () => { + await mint(wallet.address, minTick, minTick + tickSpacing, BigNumber.from(2).pow(102)) + expect(await token0.balanceOf(pool.address)).to.eq(9996) + expect(await token1.balanceOf(pool.address)).to.eq(1000 + 828011520) + }) + + it('works for min tick', async () => { + await expect(mint(wallet.address, minTick, -23040, 10000)) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 3161) + expect(await token0.balanceOf(pool.address)).to.eq(9996) + expect(await token1.balanceOf(pool.address)).to.eq(1000 + 3161) + }) + + it('removing works', async () => { + await mint(wallet.address, -46080, -46020, 10000) + await pool.burn(-46080, -46020, 10000) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + -46080, + -46020, + MaxUint128, + MaxUint128 + ) + expect(amount0, 'amount0').to.eq(0) + expect(amount1, 'amount1').to.eq(3) + }) + + it('does not write an observation', async () => { + checkObservationEquals(await pool.observations(0), { + tickCumulative: 0, + blockTimestamp: TEST_POOL_START_TIME, + initialized: true, + secondsPerLiquidityCumulativeX128: 0, + }) + await pool.advanceTime(1) + await mint(wallet.address, -46080, -23040, 100) + checkObservationEquals(await pool.observations(0), { + tickCumulative: 0, + blockTimestamp: TEST_POOL_START_TIME, + initialized: true, + secondsPerLiquidityCumulativeX128: 0, + }) + }) + }) + }) + + it('protocol fees accumulate as expected during swap', async () => { + await pool.setFeeProtocol(6, 6) + + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) + await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) + + let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq('50000000000000') + expect(token1ProtocolFees).to.eq('5000000000000') + }) + + it('positions are protected before protocol fee is turned on', async () => { + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) + await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) + + let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq(0) + expect(token1ProtocolFees).to.eq(0) + + await pool.setFeeProtocol(6, 6) + ;({ token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees()) + expect(token0ProtocolFees).to.eq(0) + expect(token1ProtocolFees).to.eq(0) + }) + + it('poke is not allowed on uninitialized position', async () => { + await mint(other.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1).div(10), wallet.address) + await swapExact1For0(expandTo18Decimals(1).div(100), wallet.address) + + // missing revert reason due to hardhat + await expect(pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 0)).to.be.reverted + + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, 1) + let { + liquidity, + feeGrowthInside0LastX128, + feeGrowthInside1LastX128, + tokensOwed1, + tokensOwed0, + } = await pool.positions(getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing)) + expect(liquidity).to.eq(1) + expect(feeGrowthInside0LastX128).to.eq('102084710076281216349243831104605583') + expect(feeGrowthInside1LastX128).to.eq('10208471007628121634924383110460558') + expect(tokensOwed0, 'tokens owed 0 before').to.eq(0) + expect(tokensOwed1, 'tokens owed 1 before').to.eq(0) + + await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 1) + ;({ + liquidity, + feeGrowthInside0LastX128, + feeGrowthInside1LastX128, + tokensOwed1, + tokensOwed0, + } = await pool.positions(getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing))) + expect(liquidity).to.eq(0) + expect(feeGrowthInside0LastX128).to.eq('102084710076281216349243831104605583') + expect(feeGrowthInside1LastX128).to.eq('10208471007628121634924383110460558') + expect(tokensOwed0, 'tokens owed 0 after').to.eq(3) + expect(tokensOwed1, 'tokens owed 1 after').to.eq(0) + }) + }) + }) + + describe('#burn', () => { + beforeEach('initialize at zero tick', () => initializeAtZeroTick(pool)) + + async function checkTickIsClear(tick: number) { + const { liquidityGross, feeGrowthOutside0X128, feeGrowthOutside1X128, liquidityNet } = await pool.ticks(tick) + expect(liquidityGross).to.eq(0) + expect(feeGrowthOutside0X128).to.eq(0) + expect(feeGrowthOutside1X128).to.eq(0) + expect(liquidityNet).to.eq(0) + } + + async function checkTickIsNotClear(tick: number) { + const { liquidityGross } = await pool.ticks(tick) + expect(liquidityGross).to.not.eq(0) + } + + it('does not clear the position fee growth snapshot if no more liquidity', async () => { + // some activity that would make the ticks non-zero + await pool.advanceTime(10) + await mint(other.address, minTick, maxTick, expandTo18Decimals(1)) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await swapExact1For0(expandTo18Decimals(1), wallet.address) + await pool.connect(other).burn(minTick, maxTick, expandTo18Decimals(1)) + const { + liquidity, + tokensOwed0, + tokensOwed1, + feeGrowthInside0LastX128, + feeGrowthInside1LastX128, + } = await pool.positions(getPositionKey(other.address, minTick, maxTick)) + expect(liquidity).to.eq(0) + expect(tokensOwed0).to.not.eq(0) + expect(tokensOwed1).to.not.eq(0) + expect(feeGrowthInside0LastX128).to.eq('340282366920938463463374607431768211') + expect(feeGrowthInside1LastX128).to.eq('340282366920938576890830247744589365') + }) + + it('clears the tick if its the last position using it', async () => { + const tickLower = minTick + tickSpacing + const tickUpper = maxTick - tickSpacing + // some activity that would make the ticks non-zero + await pool.advanceTime(10) + await mint(wallet.address, tickLower, tickUpper, 1) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await pool.burn(tickLower, tickUpper, 1) + await checkTickIsClear(tickLower) + await checkTickIsClear(tickUpper) + }) + + it('clears only the lower tick if upper is still used', async () => { + const tickLower = minTick + tickSpacing + const tickUpper = maxTick - tickSpacing + // some activity that would make the ticks non-zero + await pool.advanceTime(10) + await mint(wallet.address, tickLower, tickUpper, 1) + await mint(wallet.address, tickLower + tickSpacing, tickUpper, 1) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await pool.burn(tickLower, tickUpper, 1) + await checkTickIsClear(tickLower) + await checkTickIsNotClear(tickUpper) + }) + + it('clears only the upper tick if lower is still used', async () => { + const tickLower = minTick + tickSpacing + const tickUpper = maxTick - tickSpacing + // some activity that would make the ticks non-zero + await pool.advanceTime(10) + await mint(wallet.address, tickLower, tickUpper, 1) + await mint(wallet.address, tickLower, tickUpper - tickSpacing, 1) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await pool.burn(tickLower, tickUpper, 1) + await checkTickIsNotClear(tickLower) + await checkTickIsClear(tickUpper) + }) + }) + + // the combined amount of liquidity that the pool is initialized with (including the 1 minimum liquidity that is burned) + const initializeLiquidityAmount = expandTo18Decimals(2) + async function initializeAtZeroTick(pool: MockTimeUniswapV3Pool): Promise { + await pool.initialize(encodePriceSqrt(1, 1)) + const tickSpacing = await pool.tickSpacing() + const [min, max] = [getMinTick(tickSpacing), getMaxTick(tickSpacing)] + await mint(wallet.address, min, max, initializeLiquidityAmount) + } + + describe('#observe', () => { + beforeEach(() => initializeAtZeroTick(pool)) + + // zero tick + it('current tick accumulator increases by tick over time', async () => { + let { + tickCumulatives: [tickCumulative], + } = await pool.observe([0]) + expect(tickCumulative).to.eq(0) + await pool.advanceTime(10) + ;({ + tickCumulatives: [tickCumulative], + } = await pool.observe([0])) + expect(tickCumulative).to.eq(0) + }) + + it('current tick accumulator after single swap', async () => { + // moves to tick -1 + await swapExact0For1(1000, wallet.address) + await pool.advanceTime(4) + let { + tickCumulatives: [tickCumulative], + } = await pool.observe([0]) + expect(tickCumulative).to.eq(-4) + }) + + it('current tick accumulator after two swaps', async () => { + await swapExact0For1(expandTo18Decimals(1).div(2), wallet.address) + expect((await pool.slot0()).tick).to.eq(-4452) + await pool.advanceTime(4) + await swapExact1For0(expandTo18Decimals(1).div(4), wallet.address) + expect((await pool.slot0()).tick).to.eq(-1558) + await pool.advanceTime(6) + let { + tickCumulatives: [tickCumulative], + } = await pool.observe([0]) + // -4452*4 + -1558*6 + expect(tickCumulative).to.eq(-27156) + }) + }) + + describe('miscellaneous mint tests', () => { + beforeEach('initialize at zero tick', async () => { + pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) + await initializeAtZeroTick(pool) + }) + + it('mint to the right of the current price', async () => { + const liquidityDelta = 1000 + const lowerTick = tickSpacing + const upperTick = tickSpacing * 2 + + const liquidityBefore = await pool.liquidity() + + const b0 = await token0.balanceOf(pool.address) + const b1 = await token1.balanceOf(pool.address) + + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + const liquidityAfter = await pool.liquidity() + expect(liquidityAfter).to.be.gte(liquidityBefore) + + expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(1) + expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(0) + }) + + it('mint to the left of the current price', async () => { + const liquidityDelta = 1000 + const lowerTick = -tickSpacing * 2 + const upperTick = -tickSpacing + + const liquidityBefore = await pool.liquidity() + + const b0 = await token0.balanceOf(pool.address) + const b1 = await token1.balanceOf(pool.address) + + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + const liquidityAfter = await pool.liquidity() + expect(liquidityAfter).to.be.gte(liquidityBefore) + + expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(0) + expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(1) + }) + + it('mint within the current price', async () => { + const liquidityDelta = 1000 + const lowerTick = -tickSpacing + const upperTick = tickSpacing + + const liquidityBefore = await pool.liquidity() + + const b0 = await token0.balanceOf(pool.address) + const b1 = await token1.balanceOf(pool.address) + + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + const liquidityAfter = await pool.liquidity() + expect(liquidityAfter).to.be.gte(liquidityBefore) + + expect((await token0.balanceOf(pool.address)).sub(b0)).to.eq(1) + expect((await token1.balanceOf(pool.address)).sub(b1)).to.eq(1) + }) + + it('cannot remove more than the entire position', async () => { + const lowerTick = -tickSpacing + const upperTick = tickSpacing + await mint(wallet.address, lowerTick, upperTick, expandTo18Decimals(1000)) + // should be 'LS', hardhat is bugged + await expect(pool.burn(lowerTick, upperTick, expandTo18Decimals(1001))).to.be.reverted + }) + + it('collect fees within the current price after swap', async () => { + const liquidityDelta = expandTo18Decimals(100) + const lowerTick = -tickSpacing * 100 + const upperTick = tickSpacing * 100 + + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + const liquidityBefore = await pool.liquidity() + + const amount0In = expandTo18Decimals(1) + await swapExact0For1(amount0In, wallet.address) + + const liquidityAfter = await pool.liquidity() + expect(liquidityAfter, 'k increases').to.be.gte(liquidityBefore) + + const token0BalanceBeforePool = await token0.balanceOf(pool.address) + const token1BalanceBeforePool = await token1.balanceOf(pool.address) + const token0BalanceBeforeWallet = await token0.balanceOf(wallet.address) + const token1BalanceBeforeWallet = await token1.balanceOf(wallet.address) + + await pool.burn(lowerTick, upperTick, 0) + await pool.collect(wallet.address, lowerTick, upperTick, MaxUint128, MaxUint128) + + await pool.burn(lowerTick, upperTick, 0) + const { amount0: fees0, amount1: fees1 } = await pool.callStatic.collect( + wallet.address, + lowerTick, + upperTick, + MaxUint128, + MaxUint128 + ) + expect(fees0).to.be.eq(0) + expect(fees1).to.be.eq(0) + + const token0BalanceAfterWallet = await token0.balanceOf(wallet.address) + const token1BalanceAfterWallet = await token1.balanceOf(wallet.address) + const token0BalanceAfterPool = await token0.balanceOf(pool.address) + const token1BalanceAfterPool = await token1.balanceOf(pool.address) + + expect(token0BalanceAfterWallet).to.be.gt(token0BalanceBeforeWallet) + expect(token1BalanceAfterWallet).to.be.eq(token1BalanceBeforeWallet) + + expect(token0BalanceAfterPool).to.be.lt(token0BalanceBeforePool) + expect(token1BalanceAfterPool).to.be.eq(token1BalanceBeforePool) + }) + }) + + describe('post-initialize at medium fee', () => { + describe('k (implicit)', () => { + it('returns 0 before initialization', async () => { + expect(await pool.liquidity()).to.eq(0) + }) + describe('post initialized', () => { + beforeEach(() => initializeAtZeroTick(pool)) + + it('returns initial liquidity', async () => { + expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) + }) + it('returns in supply in range', async () => { + await mint(wallet.address, -tickSpacing, tickSpacing, expandTo18Decimals(3)) + expect(await pool.liquidity()).to.eq(expandTo18Decimals(5)) + }) + it('excludes supply at tick above current tick', async () => { + await mint(wallet.address, tickSpacing, tickSpacing * 2, expandTo18Decimals(3)) + expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) + }) + it('excludes supply at tick below current tick', async () => { + await mint(wallet.address, -tickSpacing * 2, -tickSpacing, expandTo18Decimals(3)) + expect(await pool.liquidity()).to.eq(expandTo18Decimals(2)) + }) + it('updates correctly when exiting range', async () => { + const kBefore = await pool.liquidity() + expect(kBefore).to.be.eq(expandTo18Decimals(2)) + + // add liquidity at and above current tick + const liquidityDelta = expandTo18Decimals(1) + const lowerTick = 0 + const upperTick = tickSpacing + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + // ensure virtual supply has increased appropriately + const kAfter = await pool.liquidity() + expect(kAfter).to.be.eq(expandTo18Decimals(3)) + + // swap toward the left (just enough for the tick transition function to trigger) + await swapExact0For1(1, wallet.address) + const { tick } = await pool.slot0() + expect(tick).to.be.eq(-1) + + const kAfterSwap = await pool.liquidity() + expect(kAfterSwap).to.be.eq(expandTo18Decimals(2)) + }) + it('updates correctly when entering range', async () => { + const kBefore = await pool.liquidity() + expect(kBefore).to.be.eq(expandTo18Decimals(2)) + + // add liquidity below the current tick + const liquidityDelta = expandTo18Decimals(1) + const lowerTick = -tickSpacing + const upperTick = 0 + await mint(wallet.address, lowerTick, upperTick, liquidityDelta) + + // ensure virtual supply hasn't changed + const kAfter = await pool.liquidity() + expect(kAfter).to.be.eq(kBefore) + + // swap toward the left (just enough for the tick transition function to trigger) + await swapExact0For1(1, wallet.address) + const { tick } = await pool.slot0() + expect(tick).to.be.eq(-1) + + const kAfterSwap = await pool.liquidity() + expect(kAfterSwap).to.be.eq(expandTo18Decimals(3)) + }) + }) + }) + }) + + describe('limit orders', () => { + beforeEach('initialize at tick 0', () => initializeAtZeroTick(pool)) + + it('limit selling 0 for 1 at tick 0 thru 1', async () => { + await expect(mint(wallet.address, 0, 120, expandTo18Decimals(1))) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, '5981737760509663') + // somebody takes the limit order + await swapExact1For0(expandTo18Decimals(2), other.address) + await expect(pool.burn(0, 120, expandTo18Decimals(1))) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, 0, 120, expandTo18Decimals(1), 0, '6017734268818165') + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + await expect(pool.collect(wallet.address, 0, 120, MaxUint128, MaxUint128)) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('18107525382602')) // roughly 0.3% despite other liquidity + .to.not.emit(token0, 'Transfer') + expect((await pool.slot0()).tick).to.be.gte(120) + }) + it('limit selling 1 for 0 at tick 0 thru -1', async () => { + await expect(mint(wallet.address, -120, 0, expandTo18Decimals(1))) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, '5981737760509663') + // somebody takes the limit order + await swapExact0For1(expandTo18Decimals(2), other.address) + await expect(pool.burn(-120, 0, expandTo18Decimals(1))) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, -120, 0, expandTo18Decimals(1), '6017734268818165', 0) + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + await expect(pool.collect(wallet.address, -120, 0, MaxUint128, MaxUint128)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('18107525382602')) // roughly 0.3% despite other liquidity + expect((await pool.slot0()).tick).to.be.lt(-120) + }) + + describe('fee is on', () => { + beforeEach(() => pool.setFeeProtocol(6, 6)) + it('limit selling 0 for 1 at tick 0 thru 1', async () => { + await expect(mint(wallet.address, 0, 120, expandTo18Decimals(1))) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, '5981737760509663') + // somebody takes the limit order + await swapExact1For0(expandTo18Decimals(2), other.address) + await expect(pool.burn(0, 120, expandTo18Decimals(1))) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, 0, 120, expandTo18Decimals(1), 0, '6017734268818165') + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + await expect(pool.collect(wallet.address, 0, 120, MaxUint128, MaxUint128)) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('15089604485501')) // roughly 0.25% despite other liquidity + .to.not.emit(token0, 'Transfer') + expect((await pool.slot0()).tick).to.be.gte(120) + }) + it('limit selling 1 for 0 at tick 0 thru -1', async () => { + await expect(mint(wallet.address, -120, 0, expandTo18Decimals(1))) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, '5981737760509663') + // somebody takes the limit order + await swapExact0For1(expandTo18Decimals(2), other.address) + await expect(pool.burn(-120, 0, expandTo18Decimals(1))) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, -120, 0, expandTo18Decimals(1), '6017734268818165', 0) + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + await expect(pool.collect(wallet.address, -120, 0, MaxUint128, MaxUint128)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, wallet.address, BigNumber.from('6017734268818165').add('15089604485501')) // roughly 0.25% despite other liquidity + expect((await pool.slot0()).tick).to.be.lt(-120) + }) + }) + }) + + describe('#collect', () => { + beforeEach(async () => { + pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) + await pool.initialize(encodePriceSqrt(1, 1)) + }) + + it('works with multiple LPs', async () => { + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + await mint(wallet.address, minTick + tickSpacing, maxTick - tickSpacing, expandTo18Decimals(2)) + + await swapExact0For1(expandTo18Decimals(1), wallet.address) + + // poke positions + await pool.burn(minTick, maxTick, 0) + await pool.burn(minTick + tickSpacing, maxTick - tickSpacing, 0) + + const { tokensOwed0: tokensOwed0Position0 } = await pool.positions( + getPositionKey(wallet.address, minTick, maxTick) + ) + const { tokensOwed0: tokensOwed0Position1 } = await pool.positions( + getPositionKey(wallet.address, minTick + tickSpacing, maxTick - tickSpacing) + ) + + expect(tokensOwed0Position0).to.be.eq('166666666666667') + expect(tokensOwed0Position1).to.be.eq('333333333333334') + }) + + describe('works across large increases', () => { + beforeEach(async () => { + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + }) + + // type(uint128).max * 2**128 / 1e18 + // https://www.wolframalpha.com/input/?i=%282**128+-+1%29+*+2**128+%2F+1e18 + const magicNumber = BigNumber.from('115792089237316195423570985008687907852929702298719625575994') + + it('works just before the cap binds', async () => { + await pool.setFeeGrowthGlobal0X128(magicNumber) + await pool.burn(minTick, maxTick, 0) + + const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) + + expect(tokensOwed0).to.be.eq(MaxUint128.sub(1)) + expect(tokensOwed1).to.be.eq(0) + }) + + it('works just after the cap binds', async () => { + await pool.setFeeGrowthGlobal0X128(magicNumber.add(1)) + await pool.burn(minTick, maxTick, 0) + + const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) + + expect(tokensOwed0).to.be.eq(MaxUint128) + expect(tokensOwed1).to.be.eq(0) + }) + + it('works well after the cap binds', async () => { + await pool.setFeeGrowthGlobal0X128(constants.MaxUint256) + await pool.burn(minTick, maxTick, 0) + + const { tokensOwed0, tokensOwed1 } = await pool.positions(getPositionKey(wallet.address, minTick, maxTick)) + + expect(tokensOwed0).to.be.eq(MaxUint128) + expect(tokensOwed1).to.be.eq(0) + }) + }) + + describe('works across overflow boundaries', () => { + beforeEach(async () => { + await pool.setFeeGrowthGlobal0X128(constants.MaxUint256) + await pool.setFeeGrowthGlobal1X128(constants.MaxUint256) + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(10)) + }) + + it('token0', async () => { + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await pool.burn(minTick, maxTick, 0) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + expect(amount0).to.be.eq('499999999999999') + expect(amount1).to.be.eq(0) + }) + it('token1', async () => { + await swapExact1For0(expandTo18Decimals(1), wallet.address) + await pool.burn(minTick, maxTick, 0) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + expect(amount0).to.be.eq(0) + expect(amount1).to.be.eq('499999999999999') + }) + it('token0 and token1', async () => { + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await swapExact1For0(expandTo18Decimals(1), wallet.address) + await pool.burn(minTick, maxTick, 0) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + expect(amount0).to.be.eq('499999999999999') + expect(amount1).to.be.eq('500000000000000') + }) + }) + }) + + describe('#feeProtocol', () => { + const liquidityAmount = expandTo18Decimals(1000) + + beforeEach(async () => { + pool = await createPool(FeeAmount.LOW, TICK_SPACINGS[FeeAmount.LOW]) + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, liquidityAmount) + }) + + it('is initially set to 0', async () => { + expect((await pool.slot0()).feeProtocol).to.eq(0) + }) + + it('can be changed by the owner', async () => { + await pool.setFeeProtocol(6, 6) + expect((await pool.slot0()).feeProtocol).to.eq(102) + }) + + it('cannot be changed out of bounds', async () => { + await expect(pool.setFeeProtocol(3, 3)).to.be.reverted + await expect(pool.setFeeProtocol(11, 11)).to.be.reverted + }) + + it('cannot be changed by addresses that are not owner', async () => { + await expect(pool.connect(other).setFeeProtocol(6, 6)).to.be.reverted + }) + + async function swapAndGetFeesOwed({ + amount, + zeroForOne, + poke, + }: { + amount: BigNumberish + zeroForOne: boolean + poke: boolean + }) { + await (zeroForOne ? swapExact0For1(amount, wallet.address) : swapExact1For0(amount, wallet.address)) + + if (poke) await pool.burn(minTick, maxTick, 0) + + const { amount0: fees0, amount1: fees1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + + expect(fees0, 'fees owed in token0 are greater than 0').to.be.gte(0) + expect(fees1, 'fees owed in token1 are greater than 0').to.be.gte(0) + + return { token0Fees: fees0, token1Fees: fees1 } + } + + it('position owner gets full fees when protocol fee is off', async () => { + const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + // 6 bips * 1e18 + expect(token0Fees).to.eq('499999999999999') + expect(token1Fees).to.eq(0) + }) + + it('swap fees accumulate as expected (0 for 1)', async () => { + let token0Fees + let token1Fees + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + })) + expect(token0Fees).to.eq('499999999999999') + expect(token1Fees).to.eq(0) + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + })) + expect(token0Fees).to.eq('999999999999998') + expect(token1Fees).to.eq(0) + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + })) + expect(token0Fees).to.eq('1499999999999997') + expect(token1Fees).to.eq(0) + }) + + it('swap fees accumulate as expected (1 for 0)', async () => { + let token0Fees + let token1Fees + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: false, + poke: true, + })) + expect(token0Fees).to.eq(0) + expect(token1Fees).to.eq('499999999999999') + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: false, + poke: true, + })) + expect(token0Fees).to.eq(0) + expect(token1Fees).to.eq('999999999999998') + ;({ token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: false, + poke: true, + })) + expect(token0Fees).to.eq(0) + expect(token1Fees).to.eq('1499999999999997') + }) + + it('position owner gets partial fees when protocol fee is on', async () => { + await pool.setFeeProtocol(6, 6) + + const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + expect(token0Fees).to.be.eq('416666666666666') + expect(token1Fees).to.be.eq(0) + }) + + describe('#collectProtocol', () => { + it('returns 0 if no fees', async () => { + await pool.setFeeProtocol(6, 6) + const { amount0, amount1 } = await pool.callStatic.collectProtocol(wallet.address, MaxUint128, MaxUint128) + expect(amount0).to.be.eq(0) + expect(amount1).to.be.eq(0) + }) + + it('can collect fees', async () => { + await pool.setFeeProtocol(6, 6) + + await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + await expect(pool.collectProtocol(other.address, MaxUint128, MaxUint128)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, other.address, '83333333333332') + }) + + it('fees collected can differ between token0 and token1', async () => { + await pool.setFeeProtocol(8, 5) + + await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: false, + }) + await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: false, + poke: false, + }) + + await expect(pool.collectProtocol(other.address, MaxUint128, MaxUint128)) + .to.emit(token0, 'Transfer') + // more token0 fees because it's 1/5th the swap fees + .withArgs(pool.address, other.address, '62499999999999') + .to.emit(token1, 'Transfer') + // less token1 fees because it's 1/8th the swap fees + .withArgs(pool.address, other.address, '99999999999998') + }) + }) + + it('fees collected by lp after two swaps should be double one swap', async () => { + await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + // 6 bips * 2e18 + expect(token0Fees).to.eq('999999999999998') + expect(token1Fees).to.eq(0) + }) + + it('fees collected after two swaps with fee turned on in middle are fees from last swap (not confiscatory)', async () => { + await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: false, + }) + + await pool.setFeeProtocol(6, 6) + + const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + expect(token0Fees).to.eq('916666666666666') + expect(token1Fees).to.eq(0) + }) + + it('fees collected by lp after two swaps with intermediate withdrawal', async () => { + await pool.setFeeProtocol(6, 6) + + const { token0Fees, token1Fees } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: true, + }) + + expect(token0Fees).to.eq('416666666666666') + expect(token1Fees).to.eq(0) + + // collect the fees + await pool.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) + + const { token0Fees: token0FeesNext, token1Fees: token1FeesNext } = await swapAndGetFeesOwed({ + amount: expandTo18Decimals(1), + zeroForOne: true, + poke: false, + }) + + expect(token0FeesNext).to.eq(0) + expect(token1FeesNext).to.eq(0) + + let { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq('166666666666666') + expect(token1ProtocolFees).to.eq(0) + + await pool.burn(minTick, maxTick, 0) // poke to update fees + await expect(pool.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, wallet.address, '416666666666666') + ;({ token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees()) + expect(token0ProtocolFees).to.eq('166666666666666') + expect(token1ProtocolFees).to.eq(0) + }) + }) + + describe('#tickSpacing', () => { + describe('tickSpacing = 12', () => { + beforeEach('deploy pool', async () => { + pool = await createPool(FeeAmount.MEDIUM, 12) + }) + describe('post initialize', () => { + beforeEach('initialize pool', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + }) + it('mint can only be called for multiples of 12', async () => { + await expect(mint(wallet.address, -6, 0, 1)).to.be.reverted + await expect(mint(wallet.address, 0, 6, 1)).to.be.reverted + }) + it('mint can be called with multiples of 12', async () => { + await mint(wallet.address, 12, 24, 1) + await mint(wallet.address, -144, -120, 1) + }) + it('swapping across gaps works in 1 for 0 direction', async () => { + const liquidityAmount = expandTo18Decimals(1).div(4) + await mint(wallet.address, 120000, 121200, liquidityAmount) + await swapExact1For0(expandTo18Decimals(1), wallet.address) + await expect(pool.burn(120000, 121200, liquidityAmount)) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, 120000, 121200, liquidityAmount, '30027458295511', '996999999999999999') + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + expect((await pool.slot0()).tick).to.eq(120196) + }) + it('swapping across gaps works in 0 for 1 direction', async () => { + const liquidityAmount = expandTo18Decimals(1).div(4) + await mint(wallet.address, -121200, -120000, liquidityAmount) + await swapExact0For1(expandTo18Decimals(1), wallet.address) + await expect(pool.burn(-121200, -120000, liquidityAmount)) + .to.emit(pool, 'Burn') + .withArgs(wallet.address, -121200, -120000, liquidityAmount, '996999999999999999', '30027458295511') + .to.not.emit(token0, 'Transfer') + .to.not.emit(token1, 'Transfer') + expect((await pool.slot0()).tick).to.eq(-120197) + }) + }) + }) + }) + + // https://github.com/Uniswap/uniswap-v3-core/issues/214 + it('tick transition cannot run twice if zero for one swap ends at fractional price just below tick', async () => { + pool = await createPool(FeeAmount.MEDIUM, 1) + const sqrtTickMath = (await (await ethers.getContractFactory('TickMathTest')).deploy()) as TickMathTest + const swapMath = (await (await ethers.getContractFactory('SwapMathTest')).deploy()) as SwapMathTest + const p0 = (await sqrtTickMath.getSqrtRatioAtTick(-24081)).add(1) + // initialize at a price of ~0.3 token1/token0 + // meaning if you swap in 2 token0, you should end up getting 0 token1 + await pool.initialize(p0) + expect(await pool.liquidity(), 'current pool liquidity is 1').to.eq(0) + expect((await pool.slot0()).tick, 'pool tick is -24081').to.eq(-24081) + + // add a bunch of liquidity around current price + const liquidity = expandTo18Decimals(1000) + await mint(wallet.address, -24082, -24080, liquidity) + expect(await pool.liquidity(), 'current pool liquidity is now liquidity + 1').to.eq(liquidity) + + await mint(wallet.address, -24082, -24081, liquidity) + expect(await pool.liquidity(), 'current pool liquidity is still liquidity + 1').to.eq(liquidity) + + // check the math works out to moving the price down 1, sending no amount out, and having some amount remaining + { + const { feeAmount, amountIn, amountOut, sqrtQ } = await swapMath.computeSwapStep( + p0, + p0.sub(1), + liquidity, + 3, + FeeAmount.MEDIUM + ) + expect(sqrtQ, 'price moves').to.eq(p0.sub(1)) + expect(feeAmount, 'fee amount is 1').to.eq(1) + expect(amountIn, 'amount in is 1').to.eq(1) + expect(amountOut, 'zero amount out').to.eq(0) + } + + // swap 2 amount in, should get 0 amount out + await expect(swapExact0For1(3, wallet.address)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 3) + .to.not.emit(token1, 'Transfer') + + const { tick, sqrtPriceX96 } = await pool.slot0() + + expect(tick, 'pool is at the next tick').to.eq(-24082) + expect(sqrtPriceX96, 'pool price is still on the p0 boundary').to.eq(p0.sub(1)) + expect(await pool.liquidity(), 'pool has run tick transition and liquidity changed').to.eq(liquidity.mul(2)) + }) + + describe('#flash', () => { + it('fails if not initialized', async () => { + await expect(flash(100, 200, other.address)).to.be.reverted + await expect(flash(100, 0, other.address)).to.be.reverted + await expect(flash(0, 200, other.address)).to.be.reverted + }) + it('fails if no liquidity', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await expect(flash(100, 200, other.address)).to.be.revertedWith('L') + await expect(flash(100, 0, other.address)).to.be.revertedWith('L') + await expect(flash(0, 200, other.address)).to.be.revertedWith('L') + }) + describe('after liquidity added', () => { + let balance0: BigNumber + let balance1: BigNumber + beforeEach('add some tokens', async () => { + await initializeAtZeroTick(pool) + ;[balance0, balance1] = await Promise.all([token0.balanceOf(pool.address), token1.balanceOf(pool.address)]) + }) + + describe('fee off', () => { + it('emits an event', async () => { + await expect(flash(1001, 2001, other.address)) + .to.emit(pool, 'Flash') + .withArgs(swapTarget.address, other.address, 1001, 2001, 4, 7) + }) + + it('transfers the amount0 to the recipient', async () => { + await expect(flash(100, 200, other.address)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, other.address, 100) + }) + it('transfers the amount1 to the recipient', async () => { + await expect(flash(100, 200, other.address)) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, other.address, 200) + }) + it('can flash only token0', async () => { + await expect(flash(101, 0, other.address)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, other.address, 101) + .to.not.emit(token1, 'Transfer') + }) + it('can flash only token1', async () => { + await expect(flash(0, 102, other.address)) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, other.address, 102) + .to.not.emit(token0, 'Transfer') + }) + it('can flash entire token balance', async () => { + await expect(flash(balance0, balance1, other.address)) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, other.address, balance0) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, other.address, balance1) + }) + it('no-op if both amounts are 0', async () => { + await expect(flash(0, 0, other.address)).to.not.emit(token0, 'Transfer').to.not.emit(token1, 'Transfer') + }) + it('fails if flash amount is greater than token balance', async () => { + await expect(flash(balance0.add(1), balance1, other.address)).to.be.reverted + await expect(flash(balance0, balance1.add(1), other.address)).to.be.reverted + }) + it('calls the flash callback on the sender with correct fee amounts', async () => { + await expect(flash(1001, 2002, other.address)).to.emit(swapTarget, 'FlashCallback').withArgs(4, 7) + }) + it('increases the fee growth by the expected amount', async () => { + await flash(1001, 2002, other.address) + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(4).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(7).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('fails if original balance not returned in either token', async () => { + await expect(flash(1000, 0, other.address, 999, 0)).to.be.reverted + await expect(flash(0, 1000, other.address, 0, 999)).to.be.reverted + }) + it('fails if underpays either token', async () => { + await expect(flash(1000, 0, other.address, 1002, 0)).to.be.reverted + await expect(flash(0, 1000, other.address, 0, 1002)).to.be.reverted + }) + it('allows donating token0', async () => { + await expect(flash(0, 0, constants.AddressZero, 567, 0)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 567) + .to.not.emit(token1, 'Transfer') + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(567).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('allows donating token1', async () => { + await expect(flash(0, 0, constants.AddressZero, 0, 678)) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 678) + .to.not.emit(token0, 'Transfer') + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(678).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('allows donating token0 and token1 together', async () => { + await expect(flash(0, 0, constants.AddressZero, 789, 1234)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 789) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 1234) + + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(789).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(1234).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + }) + + describe('fee on', () => { + beforeEach('turn protocol fee on', async () => { + await pool.setFeeProtocol(6, 6) + }) + + it('emits an event', async () => { + await expect(flash(1001, 2001, other.address)) + .to.emit(pool, 'Flash') + .withArgs(swapTarget.address, other.address, 1001, 2001, 4, 7) + }) + + it('increases the fee growth by the expected amount', async () => { + await flash(2002, 4004, other.address) + + const { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq(1) + expect(token1ProtocolFees).to.eq(2) + + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(6).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(11).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('allows donating token0', async () => { + await expect(flash(0, 0, constants.AddressZero, 567, 0)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 567) + .to.not.emit(token1, 'Transfer') + + const { token0: token0ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq(94) + + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(473).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('allows donating token1', async () => { + await expect(flash(0, 0, constants.AddressZero, 0, 678)) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 678) + .to.not.emit(token0, 'Transfer') + + const { token1: token1ProtocolFees } = await pool.protocolFees() + expect(token1ProtocolFees).to.eq(113) + + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(565).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + it('allows donating token0 and token1 together', async () => { + await expect(flash(0, 0, constants.AddressZero, 789, 1234)) + .to.emit(token0, 'Transfer') + .withArgs(wallet.address, pool.address, 789) + .to.emit(token1, 'Transfer') + .withArgs(wallet.address, pool.address, 1234) + + const { token0: token0ProtocolFees, token1: token1ProtocolFees } = await pool.protocolFees() + expect(token0ProtocolFees).to.eq(131) + expect(token1ProtocolFees).to.eq(205) + + expect(await pool.feeGrowthGlobal0X128()).to.eq( + BigNumber.from(658).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + expect(await pool.feeGrowthGlobal1X128()).to.eq( + BigNumber.from(1029).mul(BigNumber.from(2).pow(128)).div(expandTo18Decimals(2)) + ) + }) + }) + }) + }) + + describe('#increaseObservationCardinalityNext', () => { + it('cannot be called before initialization', async () => { + await expect(pool.increaseObservationCardinalityNext(2)).to.be.reverted + }) + describe('after initialization', () => { + beforeEach('initialize the pool', () => pool.initialize(encodePriceSqrt(1, 1))) + it('oracle starting state after initialization', async () => { + const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() + expect(observationCardinality).to.eq(1) + expect(observationIndex).to.eq(0) + expect(observationCardinalityNext).to.eq(1) + const { + secondsPerLiquidityCumulativeX128, + tickCumulative, + initialized, + blockTimestamp, + } = await pool.observations(0) + expect(secondsPerLiquidityCumulativeX128).to.eq(0) + expect(tickCumulative).to.eq(0) + expect(initialized).to.eq(true) + expect(blockTimestamp).to.eq(TEST_POOL_START_TIME) + }) + it('increases observation cardinality next', async () => { + await pool.increaseObservationCardinalityNext(2) + const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() + expect(observationCardinality).to.eq(1) + expect(observationIndex).to.eq(0) + expect(observationCardinalityNext).to.eq(2) + }) + it('is no op if target is already exceeded', async () => { + await pool.increaseObservationCardinalityNext(5) + await pool.increaseObservationCardinalityNext(3) + const { observationCardinality, observationIndex, observationCardinalityNext } = await pool.slot0() + expect(observationCardinality).to.eq(1) + expect(observationIndex).to.eq(0) + expect(observationCardinalityNext).to.eq(5) + }) + }) + }) + + describe('#setFeeProtocol', () => { + beforeEach('initialize the pool', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + }) + + it('can only be called by factory owner', async () => { + await expect(pool.connect(other).setFeeProtocol(5, 5)).to.be.reverted + }) + it('fails if fee is lt 4 or gt 10', async () => { + await expect(pool.setFeeProtocol(3, 3)).to.be.reverted + await expect(pool.setFeeProtocol(6, 3)).to.be.reverted + await expect(pool.setFeeProtocol(3, 6)).to.be.reverted + await expect(pool.setFeeProtocol(11, 11)).to.be.reverted + await expect(pool.setFeeProtocol(6, 11)).to.be.reverted + await expect(pool.setFeeProtocol(11, 6)).to.be.reverted + }) + it('succeeds for fee of 4', async () => { + await pool.setFeeProtocol(4, 4) + }) + it('succeeds for fee of 10', async () => { + await pool.setFeeProtocol(10, 10) + }) + it('sets protocol fee', async () => { + await pool.setFeeProtocol(7, 7) + expect((await pool.slot0()).feeProtocol).to.eq(119) + }) + it('can change protocol fee', async () => { + await pool.setFeeProtocol(7, 7) + await pool.setFeeProtocol(5, 8) + expect((await pool.slot0()).feeProtocol).to.eq(133) + }) + it('can turn off protocol fee', async () => { + await pool.setFeeProtocol(4, 4) + await pool.setFeeProtocol(0, 0) + expect((await pool.slot0()).feeProtocol).to.eq(0) + }) + it('emits an event when turned on', async () => { + await expect(pool.setFeeProtocol(7, 7)).to.be.emit(pool, 'SetFeeProtocol').withArgs(0, 0, 7, 7) + }) + it('emits an event when turned off', async () => { + await pool.setFeeProtocol(7, 5) + await expect(pool.setFeeProtocol(0, 0)).to.be.emit(pool, 'SetFeeProtocol').withArgs(7, 5, 0, 0) + }) + it('emits an event when changed', async () => { + await pool.setFeeProtocol(4, 10) + await expect(pool.setFeeProtocol(6, 8)).to.be.emit(pool, 'SetFeeProtocol').withArgs(4, 10, 6, 8) + }) + it('emits an event when unchanged', async () => { + await pool.setFeeProtocol(5, 9) + await expect(pool.setFeeProtocol(5, 9)).to.be.emit(pool, 'SetFeeProtocol').withArgs(5, 9, 5, 9) + }) + }) + + describe('#lock', () => { + beforeEach('initialize the pool', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + }) + + it('cannot reenter from swap callback', async () => { + const reentrant = (await ( + await ethers.getContractFactory('TestUniswapV3ReentrantCallee') + ).deploy()) as TestUniswapV3ReentrantCallee + + // the tests happen in solidity + await expect(reentrant.swapToReenter(pool.address)).to.be.revertedWith('Unable to reenter') + }) + }) + + describe('#snapshotCumulativesInside', () => { + const tickLower = -TICK_SPACINGS[FeeAmount.MEDIUM] + const tickUpper = TICK_SPACINGS[FeeAmount.MEDIUM] + const tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] + beforeEach(async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, tickLower, tickUpper, 10) + }) + it('throws if ticks are in reverse order', async () => { + await expect(pool.snapshotCumulativesInside(tickUpper, tickLower)).to.be.reverted + }) + it('throws if ticks are the same', async () => { + await expect(pool.snapshotCumulativesInside(tickUpper, tickUpper)).to.be.reverted + }) + it('throws if tick lower is too low', async () => { + await expect(pool.snapshotCumulativesInside(getMinTick(tickSpacing) - 1, tickUpper)).be.reverted + }) + it('throws if tick upper is too high', async () => { + await expect(pool.snapshotCumulativesInside(tickLower, getMaxTick(tickSpacing) + 1)).be.reverted + }) + it('throws if tick lower is not initialized', async () => { + await expect(pool.snapshotCumulativesInside(tickLower - tickSpacing, tickUpper)).to.be.reverted + }) + it('throws if tick upper is not initialized', async () => { + await expect(pool.snapshotCumulativesInside(tickLower, tickUpper + tickSpacing)).to.be.reverted + }) + it('is zero immediately after initialize', async () => { + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(0) + expect(tickCumulativeInside).to.eq(0) + expect(secondsInside).to.eq(0) + }) + it('increases by expected amount when time elapses in the range', async () => { + await pool.advanceTime(5) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) + expect(secondsInside).to.eq(5) + }) + it('does not account for time increase above range', async () => { + await pool.advanceTime(5) + await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) + await pool.advanceTime(7) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) + expect(secondsInside).to.eq(5) + }) + it('does not account for time increase below range', async () => { + await pool.advanceTime(5) + await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) + await pool.advanceTime(7) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(10)) + // tick is 0 for 5 seconds, then not in range + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) + expect(secondsInside).to.eq(5) + }) + it('time increase below range is not counted', async () => { + await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) + await pool.advanceTime(5) + await swapToHigherPrice(encodePriceSqrt(1, 1), wallet.address) + await pool.advanceTime(7) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(7).shl(128).div(10)) + // tick is not in range then tick is 0 for 7 seconds + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) + expect(secondsInside).to.eq(7) + }) + it('time increase above range is not counted', async () => { + await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) + await pool.advanceTime(5) + await swapToLowerPrice(encodePriceSqrt(1, 1), wallet.address) + await pool.advanceTime(7) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(7).shl(128).div(10)) + expect((await pool.slot0()).tick).to.eq(-1) // justify the -7 tick cumulative inside value + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(-7) + expect(secondsInside).to.eq(7) + }) + it('positions minted after time spent', async () => { + await pool.advanceTime(5) + await mint(wallet.address, tickUpper, getMaxTick(tickSpacing), 15) + await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) + await pool.advanceTime(8) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickUpper, getMaxTick(tickSpacing)) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(8).shl(128).div(15)) + // the tick of 2/1 is 6931 + // 8 seconds * 6931 = 55448 + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(55448) + expect(secondsInside).to.eq(8) + }) + it('overlapping liquidity is aggregated', async () => { + await mint(wallet.address, tickLower, getMaxTick(tickSpacing), 15) + await pool.advanceTime(5) + await swapToHigherPrice(encodePriceSqrt(2, 1), wallet.address) + await pool.advanceTime(8) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(tickLower, tickUpper) + expect(secondsPerLiquidityInsideX128).to.eq(BigNumber.from(5).shl(128).div(25)) + expect(tickCumulativeInside, 'tickCumulativeInside').to.eq(0) + expect(secondsInside).to.eq(5) + }) + it('relative behavior of snapshots', async () => { + await pool.advanceTime(5) + await mint(wallet.address, getMinTick(tickSpacing), tickLower, 15) + const { + secondsPerLiquidityInsideX128: secondsPerLiquidityInsideX128Start, + tickCumulativeInside: tickCumulativeInsideStart, + secondsInside: secondsInsideStart, + } = await pool.snapshotCumulativesInside(getMinTick(tickSpacing), tickLower) + await pool.advanceTime(8) + // 13 seconds in starting range, then 3 seconds in newly minted range + await swapToLowerPrice(encodePriceSqrt(1, 2), wallet.address) + await pool.advanceTime(3) + const { + secondsPerLiquidityInsideX128, + tickCumulativeInside, + secondsInside, + } = await pool.snapshotCumulativesInside(getMinTick(tickSpacing), tickLower) + const expectedDiffSecondsPerLiquidity = BigNumber.from(3).shl(128).div(15) + expect(secondsPerLiquidityInsideX128.sub(secondsPerLiquidityInsideX128Start)).to.eq( + expectedDiffSecondsPerLiquidity + ) + expect(secondsPerLiquidityInsideX128).to.not.eq(expectedDiffSecondsPerLiquidity) + // the tick is the one corresponding to the price of 1/2, or log base 1.0001 of 0.5 + // this is -6932, and 3 seconds have passed, so the cumulative computed from the diff equals 6932 * 3 + expect(tickCumulativeInside.sub(tickCumulativeInsideStart), 'tickCumulativeInside').to.eq(-20796) + expect(secondsInside - secondsInsideStart).to.eq(3) + expect(secondsInside).to.not.eq(3) + }) + }) + + describe('fees overflow scenarios', async () => { + it('up to max uint 128', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, MaxUint128, MaxUint128) + + const [feeGrowthGlobal0X128, feeGrowthGlobal1X128] = await Promise.all([ + pool.feeGrowthGlobal0X128(), + pool.feeGrowthGlobal1X128(), + ]) + // all 1s in first 128 bits + expect(feeGrowthGlobal0X128).to.eq(MaxUint128.shl(128)) + expect(feeGrowthGlobal1X128).to.eq(MaxUint128.shl(128)) + await pool.burn(minTick, maxTick, 0) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + expect(amount0).to.eq(MaxUint128) + expect(amount1).to.eq(MaxUint128) + }) + + it('overflow max uint 128', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, MaxUint128, MaxUint128) + await flash(0, 0, wallet.address, 1, 1) + + const [feeGrowthGlobal0X128, feeGrowthGlobal1X128] = await Promise.all([ + pool.feeGrowthGlobal0X128(), + pool.feeGrowthGlobal1X128(), + ]) + // all 1s in first 128 bits + expect(feeGrowthGlobal0X128).to.eq(0) + expect(feeGrowthGlobal1X128).to.eq(0) + await pool.burn(minTick, maxTick, 0) + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + // fees burned + expect(amount0).to.eq(0) + expect(amount1).to.eq(0) + }) + + it('overflow max uint 128 after poke burns fees owed to 0', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, MaxUint128, MaxUint128) + await pool.burn(minTick, maxTick, 0) + await flash(0, 0, wallet.address, 1, 1) + await pool.burn(minTick, maxTick, 0) + + const { amount0, amount1 } = await pool.callStatic.collect( + wallet.address, + minTick, + maxTick, + MaxUint128, + MaxUint128 + ) + // fees burned + expect(amount0).to.eq(0) + expect(amount1).to.eq(0) + }) + + it('two positions at the same snapshot', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, 1) + await mint(other.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, MaxUint128, 0) + await flash(0, 0, wallet.address, MaxUint128, 0) + const feeGrowthGlobal0X128 = await pool.feeGrowthGlobal0X128() + expect(feeGrowthGlobal0X128).to.eq(MaxUint128.shl(128)) + await flash(0, 0, wallet.address, 2, 0) + await pool.burn(minTick, maxTick, 0) + await pool.connect(other).burn(minTick, maxTick, 0) + let { amount0 } = await pool.callStatic.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) + expect(amount0, 'amount0 of wallet').to.eq(0) + ;({ amount0 } = await pool + .connect(other) + .callStatic.collect(other.address, minTick, maxTick, MaxUint128, MaxUint128)) + expect(amount0, 'amount0 of other').to.eq(0) + }) + + it('two positions 1 wei of fees apart overflows exactly once', async () => { + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, 1, 0) + await mint(other.address, minTick, maxTick, 1) + await flash(0, 0, wallet.address, MaxUint128, 0) + await flash(0, 0, wallet.address, MaxUint128, 0) + const feeGrowthGlobal0X128 = await pool.feeGrowthGlobal0X128() + expect(feeGrowthGlobal0X128).to.eq(0) + await flash(0, 0, wallet.address, 2, 0) + await pool.burn(minTick, maxTick, 0) + await pool.connect(other).burn(minTick, maxTick, 0) + let { amount0 } = await pool.callStatic.collect(wallet.address, minTick, maxTick, MaxUint128, MaxUint128) + expect(amount0, 'amount0 of wallet').to.eq(1) + ;({ amount0 } = await pool + .connect(other) + .callStatic.collect(other.address, minTick, maxTick, MaxUint128, MaxUint128)) + expect(amount0, 'amount0 of other').to.eq(0) + }) + }) + + describe('swap underpayment tests', () => { + let underpay: TestUniswapV3SwapPay + beforeEach('deploy swap test', async () => { + const underpayFactory = await ethers.getContractFactory('TestUniswapV3SwapPay') + underpay = (await underpayFactory.deploy()) as TestUniswapV3SwapPay + await token0.approve(underpay.address, constants.MaxUint256) + await token1.approve(underpay.address, constants.MaxUint256) + await pool.initialize(encodePriceSqrt(1, 1)) + await mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + }) + + it('underpay zero for one and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 1, 0) + ).to.be.revertedWith('IIA') + }) + it('pay in the wrong token zero for one and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 0, 2000) + ).to.be.revertedWith('IIA') + }) + it('overpay zero for one and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), 1000, 2000, 0) + ).to.not.be.revertedWith('IIA') + }) + it('underpay zero for one and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 1, 0) + ).to.be.revertedWith('IIA') + }) + it('pay in the wrong token zero for one and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 0, 2000) + ).to.be.revertedWith('IIA') + }) + it('overpay zero for one and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, true, MIN_SQRT_RATIO.add(1), -1000, 2000, 0) + ).to.not.be.revertedWith('IIA') + }) + it('underpay one for zero and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 0, 1) + ).to.be.revertedWith('IIA') + }) + it('pay in the wrong token one for zero and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 2000, 0) + ).to.be.revertedWith('IIA') + }) + it('overpay one for zero and exact in', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), 1000, 0, 2000) + ).to.not.be.revertedWith('IIA') + }) + it('underpay one for zero and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 0, 1) + ).to.be.revertedWith('IIA') + }) + it('pay in the wrong token one for zero and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 2000, 0) + ).to.be.revertedWith('IIA') + }) + it('overpay one for zero and exact out', async () => { + await expect( + underpay.swap(pool.address, wallet.address, false, MAX_SQRT_RATIO.sub(1), -1000, 0, 2000) + ).to.not.be.revertedWith('IIA') + }) + }) +}) diff --git a/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts b/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts new file mode 100644 index 0000000..da4be19 --- /dev/null +++ b/lib/v3-core/test/UniswapV3Pool.swaps.spec.ts @@ -0,0 +1,588 @@ +import { Decimal } from 'decimal.js' +import { BigNumber, BigNumberish, ContractTransaction, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' +import { TestERC20 } from '../typechain/TestERC20' + +import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' +import { expect } from './shared/expect' +import { poolFixture } from './shared/fixtures' +import { formatPrice, formatTokenAmount } from './shared/format' +import { + createPoolFunctions, + encodePriceSqrt, + expandTo18Decimals, + FeeAmount, + getMaxLiquidityPerTick, + getMaxTick, + getMinTick, + MAX_SQRT_RATIO, + MaxUint128, + MIN_SQRT_RATIO, + TICK_SPACINGS, +} from './shared/utilities' + +Decimal.config({ toExpNeg: -500, toExpPos: 500 }) + +const createFixtureLoader = waffle.createFixtureLoader +const { constants } = ethers + +interface BaseSwapTestCase { + zeroForOne: boolean + sqrtPriceLimit?: BigNumber +} +interface SwapExact0For1TestCase extends BaseSwapTestCase { + zeroForOne: true + exactOut: false + amount0: BigNumberish + sqrtPriceLimit?: BigNumber +} +interface SwapExact1For0TestCase extends BaseSwapTestCase { + zeroForOne: false + exactOut: false + amount1: BigNumberish + sqrtPriceLimit?: BigNumber +} +interface Swap0ForExact1TestCase extends BaseSwapTestCase { + zeroForOne: true + exactOut: true + amount1: BigNumberish + sqrtPriceLimit?: BigNumber +} +interface Swap1ForExact0TestCase extends BaseSwapTestCase { + zeroForOne: false + exactOut: true + amount0: BigNumberish + sqrtPriceLimit?: BigNumber +} +interface SwapToHigherPrice extends BaseSwapTestCase { + zeroForOne: false + sqrtPriceLimit: BigNumber +} +interface SwapToLowerPrice extends BaseSwapTestCase { + zeroForOne: true + sqrtPriceLimit: BigNumber +} +type SwapTestCase = + | SwapExact0For1TestCase + | Swap0ForExact1TestCase + | SwapExact1For0TestCase + | Swap1ForExact0TestCase + | SwapToHigherPrice + | SwapToLowerPrice + +function swapCaseToDescription(testCase: SwapTestCase): string { + const priceClause = testCase?.sqrtPriceLimit ? ` to price ${formatPrice(testCase.sqrtPriceLimit)}` : '' + if ('exactOut' in testCase) { + if (testCase.exactOut) { + if (testCase.zeroForOne) { + return `swap token0 for exactly ${formatTokenAmount(testCase.amount1)} token1${priceClause}` + } else { + return `swap token1 for exactly ${formatTokenAmount(testCase.amount0)} token0${priceClause}` + } + } else { + if (testCase.zeroForOne) { + return `swap exactly ${formatTokenAmount(testCase.amount0)} token0 for token1${priceClause}` + } else { + return `swap exactly ${formatTokenAmount(testCase.amount1)} token1 for token0${priceClause}` + } + } + } else { + if (testCase.zeroForOne) { + return `swap token0 for token1${priceClause}` + } else { + return `swap token1 for token0${priceClause}` + } + } +} + +type PoolFunctions = ReturnType + +// can't use address zero because the ERC20 token does not allow it +const SWAP_RECIPIENT_ADDRESS = constants.AddressZero.slice(0, -1) + '1' +const POSITION_PROCEEDS_OUTPUT_ADDRESS = constants.AddressZero.slice(0, -1) + '2' + +async function executeSwap( + pool: MockTimeUniswapV3Pool, + testCase: SwapTestCase, + poolFunctions: PoolFunctions +): Promise { + let swap: ContractTransaction + if ('exactOut' in testCase) { + if (testCase.exactOut) { + if (testCase.zeroForOne) { + swap = await poolFunctions.swap0ForExact1(testCase.amount1, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) + } else { + swap = await poolFunctions.swap1ForExact0(testCase.amount0, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) + } + } else { + if (testCase.zeroForOne) { + swap = await poolFunctions.swapExact0For1(testCase.amount0, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) + } else { + swap = await poolFunctions.swapExact1For0(testCase.amount1, SWAP_RECIPIENT_ADDRESS, testCase.sqrtPriceLimit) + } + } + } else { + if (testCase.zeroForOne) { + swap = await poolFunctions.swapToLowerPrice(testCase.sqrtPriceLimit, SWAP_RECIPIENT_ADDRESS) + } else { + swap = await poolFunctions.swapToHigherPrice(testCase.sqrtPriceLimit, SWAP_RECIPIENT_ADDRESS) + } + } + return swap +} + +const DEFAULT_POOL_SWAP_TESTS: SwapTestCase[] = [ + // swap large amounts in/out + { + zeroForOne: true, + exactOut: false, + amount0: expandTo18Decimals(1), + }, + { + zeroForOne: false, + exactOut: false, + amount1: expandTo18Decimals(1), + }, + { + zeroForOne: true, + exactOut: true, + amount1: expandTo18Decimals(1), + }, + { + zeroForOne: false, + exactOut: true, + amount0: expandTo18Decimals(1), + }, + // swap large amounts in/out with a price limit + { + zeroForOne: true, + exactOut: false, + amount0: expandTo18Decimals(1), + sqrtPriceLimit: encodePriceSqrt(50, 100), + }, + { + zeroForOne: false, + exactOut: false, + amount1: expandTo18Decimals(1), + sqrtPriceLimit: encodePriceSqrt(200, 100), + }, + { + zeroForOne: true, + exactOut: true, + amount1: expandTo18Decimals(1), + sqrtPriceLimit: encodePriceSqrt(50, 100), + }, + { + zeroForOne: false, + exactOut: true, + amount0: expandTo18Decimals(1), + sqrtPriceLimit: encodePriceSqrt(200, 100), + }, + // swap small amounts in/out + { + zeroForOne: true, + exactOut: false, + amount0: 1000, + }, + { + zeroForOne: false, + exactOut: false, + amount1: 1000, + }, + { + zeroForOne: true, + exactOut: true, + amount1: 1000, + }, + { + zeroForOne: false, + exactOut: true, + amount0: 1000, + }, + // swap arbitrary input to price + { + sqrtPriceLimit: encodePriceSqrt(5, 2), + zeroForOne: false, + }, + { + sqrtPriceLimit: encodePriceSqrt(2, 5), + zeroForOne: true, + }, + { + sqrtPriceLimit: encodePriceSqrt(5, 2), + zeroForOne: true, + }, + { + sqrtPriceLimit: encodePriceSqrt(2, 5), + zeroForOne: false, + }, +] + +interface Position { + tickLower: number + tickUpper: number + liquidity: BigNumberish +} + +interface PoolTestCase { + description: string + feeAmount: number + tickSpacing: number + startingPrice: BigNumber + positions: Position[] + swapTests?: SwapTestCase[] +} + +const TEST_POOLS: PoolTestCase[] = [ + { + description: 'low fee, 1:1 price, 2e18 max range liquidity', + feeAmount: FeeAmount.LOW, + tickSpacing: TICK_SPACINGS[FeeAmount.LOW], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.LOW]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.LOW]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, 1:1 price, 2e18 max range liquidity', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'high fee, 1:1 price, 2e18 max range liquidity', + feeAmount: FeeAmount.HIGH, + tickSpacing: TICK_SPACINGS[FeeAmount.HIGH], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.HIGH]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.HIGH]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, 10:1 price, 2e18 max range liquidity', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(10, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, 1:10 price, 2e18 max range liquidity', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 10), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, 1:1 price, 0 liquidity, all liquidity around current price', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: -TICK_SPACINGS[FeeAmount.MEDIUM], + liquidity: expandTo18Decimals(2), + }, + { + tickLower: TICK_SPACINGS[FeeAmount.MEDIUM], + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, 1:1 price, additional liquidity around current price', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: -TICK_SPACINGS[FeeAmount.MEDIUM], + liquidity: expandTo18Decimals(2), + }, + { + tickLower: TICK_SPACINGS[FeeAmount.MEDIUM], + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'low fee, large liquidity around current price (stable swap)', + feeAmount: FeeAmount.LOW, + tickSpacing: TICK_SPACINGS[FeeAmount.LOW], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: -TICK_SPACINGS[FeeAmount.LOW], + tickUpper: TICK_SPACINGS[FeeAmount.LOW], + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, token0 liquidity only', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: 0, + tickUpper: 2000 * TICK_SPACINGS[FeeAmount.MEDIUM], + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'medium fee, token1 liquidity only', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: -2000 * TICK_SPACINGS[FeeAmount.MEDIUM], + tickUpper: 0, + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'close to max price', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(BigNumber.from(2).pow(127), 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'close to min price', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, BigNumber.from(2).pow(127)), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'max full range liquidity at 1:1 price with default fee', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: encodePriceSqrt(1, 1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: getMaxLiquidityPerTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + }, + ], + }, + { + description: 'initialized at the max ratio', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: MAX_SQRT_RATIO.sub(1), + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, + { + description: 'initialized at the min ratio', + feeAmount: FeeAmount.MEDIUM, + tickSpacing: TICK_SPACINGS[FeeAmount.MEDIUM], + startingPrice: MIN_SQRT_RATIO, + positions: [ + { + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + liquidity: expandTo18Decimals(2), + }, + ], + }, +] + +describe('UniswapV3Pool swap tests', () => { + let wallet: Wallet, other: Wallet + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + + loadFixture = createFixtureLoader([wallet]) + }) + + for (const poolCase of TEST_POOLS) { + describe(poolCase.description, () => { + const poolCaseFixture = async () => { + const { createPool, token0, token1, swapTargetCallee: swapTarget } = await poolFixture( + [wallet], + waffle.provider + ) + const pool = await createPool(poolCase.feeAmount, poolCase.tickSpacing) + const poolFunctions = createPoolFunctions({ swapTarget, token0, token1, pool }) + await pool.initialize(poolCase.startingPrice) + // mint all positions + for (const position of poolCase.positions) { + await poolFunctions.mint(wallet.address, position.tickLower, position.tickUpper, position.liquidity) + } + + const [poolBalance0, poolBalance1] = await Promise.all([ + token0.balanceOf(pool.address), + token1.balanceOf(pool.address), + ]) + + return { token0, token1, pool, poolFunctions, poolBalance0, poolBalance1, swapTarget } + } + + let token0: TestERC20 + let token1: TestERC20 + + let poolBalance0: BigNumber + let poolBalance1: BigNumber + + let pool: MockTimeUniswapV3Pool + let swapTarget: TestUniswapV3Callee + let poolFunctions: PoolFunctions + + beforeEach('load fixture', async () => { + ;({ token0, token1, pool, poolFunctions, poolBalance0, poolBalance1, swapTarget } = await loadFixture( + poolCaseFixture + )) + }) + + afterEach('check can burn positions', async () => { + for (const { liquidity, tickUpper, tickLower } of poolCase.positions) { + await pool.burn(tickLower, tickUpper, liquidity) + await pool.collect(POSITION_PROCEEDS_OUTPUT_ADDRESS, tickLower, tickUpper, MaxUint128, MaxUint128) + } + }) + + for (const testCase of poolCase.swapTests ?? DEFAULT_POOL_SWAP_TESTS) { + it(swapCaseToDescription(testCase), async () => { + const slot0 = await pool.slot0() + const tx = executeSwap(pool, testCase, poolFunctions) + try { + await tx + } catch (error) { + expect({ + swapError: error.message, + poolBalance0: poolBalance0.toString(), + poolBalance1: poolBalance1.toString(), + poolPriceBefore: formatPrice(slot0.sqrtPriceX96), + tickBefore: slot0.tick, + }).to.matchSnapshot('swap error') + return + } + const [ + poolBalance0After, + poolBalance1After, + slot0After, + liquidityAfter, + feeGrowthGlobal0X128, + feeGrowthGlobal1X128, + ] = await Promise.all([ + token0.balanceOf(pool.address), + token1.balanceOf(pool.address), + pool.slot0(), + pool.liquidity(), + pool.feeGrowthGlobal0X128(), + pool.feeGrowthGlobal1X128(), + ]) + const poolBalance0Delta = poolBalance0After.sub(poolBalance0) + const poolBalance1Delta = poolBalance1After.sub(poolBalance1) + + // check all the events were emitted corresponding to balance changes + if (poolBalance0Delta.eq(0)) await expect(tx).to.not.emit(token0, 'Transfer') + else if (poolBalance0Delta.lt(0)) + await expect(tx) + .to.emit(token0, 'Transfer') + .withArgs(pool.address, SWAP_RECIPIENT_ADDRESS, poolBalance0Delta.mul(-1)) + else await expect(tx).to.emit(token0, 'Transfer').withArgs(wallet.address, pool.address, poolBalance0Delta) + + if (poolBalance1Delta.eq(0)) await expect(tx).to.not.emit(token1, 'Transfer') + else if (poolBalance1Delta.lt(0)) + await expect(tx) + .to.emit(token1, 'Transfer') + .withArgs(pool.address, SWAP_RECIPIENT_ADDRESS, poolBalance1Delta.mul(-1)) + else await expect(tx).to.emit(token1, 'Transfer').withArgs(wallet.address, pool.address, poolBalance1Delta) + + // check that the swap event was emitted too + await expect(tx) + .to.emit(pool, 'Swap') + .withArgs( + swapTarget.address, + SWAP_RECIPIENT_ADDRESS, + poolBalance0Delta, + poolBalance1Delta, + slot0After.sqrtPriceX96, + liquidityAfter, + slot0After.tick + ) + + const executionPrice = new Decimal(poolBalance1Delta.toString()).div(poolBalance0Delta.toString()).mul(-1) + + expect({ + amount0Before: poolBalance0.toString(), + amount1Before: poolBalance1.toString(), + amount0Delta: poolBalance0Delta.toString(), + amount1Delta: poolBalance1Delta.toString(), + feeGrowthGlobal0X128Delta: feeGrowthGlobal0X128.toString(), + feeGrowthGlobal1X128Delta: feeGrowthGlobal1X128.toString(), + tickBefore: slot0.tick, + poolPriceBefore: formatPrice(slot0.sqrtPriceX96), + tickAfter: slot0After.tick, + poolPriceAfter: formatPrice(slot0After.sqrtPriceX96), + executionPrice: executionPrice.toPrecision(5), + }).to.matchSnapshot('balances') + }) + } + }) + } +}) diff --git a/lib/v3-core/test/UniswapV3Router.spec.ts b/lib/v3-core/test/UniswapV3Router.spec.ts new file mode 100644 index 0000000..09af949 --- /dev/null +++ b/lib/v3-core/test/UniswapV3Router.spec.ts @@ -0,0 +1,133 @@ +import { Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { TestERC20 } from '../typechain/TestERC20' +import { UniswapV3Factory } from '../typechain/UniswapV3Factory' +import { MockTimeUniswapV3Pool } from '../typechain/MockTimeUniswapV3Pool' +import { expect } from './shared/expect' + +import { poolFixture } from './shared/fixtures' + +import { + FeeAmount, + TICK_SPACINGS, + createPoolFunctions, + PoolFunctions, + createMultiPoolFunctions, + encodePriceSqrt, + getMinTick, + getMaxTick, + expandTo18Decimals, +} from './shared/utilities' +import { TestUniswapV3Router } from '../typechain/TestUniswapV3Router' +import { TestUniswapV3Callee } from '../typechain/TestUniswapV3Callee' + +const feeAmount = FeeAmount.MEDIUM +const tickSpacing = TICK_SPACINGS[feeAmount] + +const createFixtureLoader = waffle.createFixtureLoader + +type ThenArg = T extends PromiseLike ? U : T + +describe('UniswapV3Pool', () => { + let wallet: Wallet, other: Wallet + + let token0: TestERC20 + let token1: TestERC20 + let token2: TestERC20 + let factory: UniswapV3Factory + let pool0: MockTimeUniswapV3Pool + let pool1: MockTimeUniswapV3Pool + + let pool0Functions: PoolFunctions + let pool1Functions: PoolFunctions + + let minTick: number + let maxTick: number + + let swapTargetCallee: TestUniswapV3Callee + let swapTargetRouter: TestUniswapV3Router + + let loadFixture: ReturnType + let createPool: ThenArg>['createPool'] + + before('create fixture loader', async () => { + ;[wallet, other] = await (ethers as any).getSigners() + + loadFixture = createFixtureLoader([wallet, other]) + }) + + beforeEach('deploy first fixture', async () => { + ;({ token0, token1, token2, factory, createPool, swapTargetCallee, swapTargetRouter } = await loadFixture( + poolFixture + )) + + const createPoolWrapped = async ( + amount: number, + spacing: number, + firstToken: TestERC20, + secondToken: TestERC20 + ): Promise<[MockTimeUniswapV3Pool, any]> => { + const pool = await createPool(amount, spacing, firstToken, secondToken) + const poolFunctions = createPoolFunctions({ + swapTarget: swapTargetCallee, + token0: firstToken, + token1: secondToken, + pool, + }) + minTick = getMinTick(spacing) + maxTick = getMaxTick(spacing) + return [pool, poolFunctions] + } + + // default to the 30 bips pool + ;[pool0, pool0Functions] = await createPoolWrapped(feeAmount, tickSpacing, token0, token1) + ;[pool1, pool1Functions] = await createPoolWrapped(feeAmount, tickSpacing, token1, token2) + }) + + it('constructor initializes immutables', async () => { + expect(await pool0.factory()).to.eq(factory.address) + expect(await pool0.token0()).to.eq(token0.address) + expect(await pool0.token1()).to.eq(token1.address) + expect(await pool1.factory()).to.eq(factory.address) + expect(await pool1.token0()).to.eq(token1.address) + expect(await pool1.token1()).to.eq(token2.address) + }) + + describe('multi-swaps', () => { + let inputToken: TestERC20 + let outputToken: TestERC20 + + beforeEach('initialize both pools', async () => { + inputToken = token0 + outputToken = token2 + + await pool0.initialize(encodePriceSqrt(1, 1)) + await pool1.initialize(encodePriceSqrt(1, 1)) + + await pool0Functions.mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + await pool1Functions.mint(wallet.address, minTick, maxTick, expandTo18Decimals(1)) + }) + + it('multi-swap', async () => { + const token0OfPoolOutput = await pool1.token0() + const ForExact0 = outputToken.address === token0OfPoolOutput + + const { swapForExact0Multi, swapForExact1Multi } = createMultiPoolFunctions({ + inputToken: token0, + swapTarget: swapTargetRouter, + poolInput: pool0, + poolOutput: pool1, + }) + + const method = ForExact0 ? swapForExact0Multi : swapForExact1Multi + + await expect(method(100, wallet.address)) + .to.emit(outputToken, 'Transfer') + .withArgs(pool1.address, wallet.address, 100) + .to.emit(token1, 'Transfer') + .withArgs(pool0.address, pool1.address, 102) + .to.emit(inputToken, 'Transfer') + .withArgs(wallet.address, pool0.address, 104) + }) + }) +}) diff --git a/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap b/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap new file mode 100644 index 0000000..fe68ee6 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/BitMath.spec.ts.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BitMath #leastSignificantBit gas cost of max uint128 1`] = `431`; + +exports[`BitMath #leastSignificantBit gas cost of max uint256 1`] = `431`; + +exports[`BitMath #leastSignificantBit gas cost of smaller number 1`] = `429`; + +exports[`BitMath #mostSignificantBit gas cost of max uint128 1`] = `367`; + +exports[`BitMath #mostSignificantBit gas cost of max uint256 1`] = `385`; + +exports[`BitMath #mostSignificantBit gas cost of smaller number 1`] = `295`; diff --git a/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap b/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap new file mode 100644 index 0000000..6b942a3 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LiquidityMath #addDelta gas add 1`] = `162`; + +exports[`LiquidityMath #addDelta gas sub 1`] = `176`; diff --git a/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap b/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap new file mode 100644 index 0000000..636990a --- /dev/null +++ b/lib/v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NoDelegateCall runtime overhead 1`] = `30`; diff --git a/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap b/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap new file mode 100644 index 0000000..cd67254 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/Oracle.spec.ts.snap @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Oracle #grow gas for growing by 1 slot when index != cardinality - 1 1`] = `49081`; + +exports[`Oracle #grow gas for growing by 1 slot when index == cardinality - 1 1`] = `49081`; + +exports[`Oracle #grow gas for growing by 10 slots when index != cardinality - 1 1`] = `249223`; + +exports[`Oracle #grow gas for growing by 10 slots when index == cardinality - 1 1`] = `249223`; + +exports[`Oracle #initialize gas 1`] = `67770`; + +exports[`Oracle #observe before initialization gas for observe since most recent 1`] = `4746`; + +exports[`Oracle #observe before initialization gas for single observation at current time 1`] = `3565`; + +exports[`Oracle #observe before initialization gas for single observation at current time counterfactually computed 1`] = `4067`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 fetch many values 1`] = ` +Object { + "secondsPerLiquidityCumulativeX128s": Array [ + "544451787073501541541399371890829138329", + "799663562264205389138930327464655296921", + "1045423049484883168306923099498710116305", + "1423514568285925905488450441089563684590", + "2152691068830794041481396028443352709138", + "2347138135642758877746181518404363115684", + "2395749902345750086812377890894615717321", + ], + "tickCumulatives": Array [ + -13, + -31, + -43, + -37, + -15, + 9, + 15, + ], +} +`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas all of last 20 seconds 1`] = `91193`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas between oldest and oldest + 1 1`] = `15811`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas latest equal 1`] = `3565`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas latest transform 1`] = `4067`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas middle 1`] = `13986`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 5 gas oldest 1`] = `15538`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 fetch many values 1`] = ` +Object { + "secondsPerLiquidityCumulativeX128s": Array [ + "544451787073501541541399371890829138329", + "799663562264205389138930327464655296921", + "1045423049484883168306923099498710116305", + "1423514568285925905488450441089563684590", + "2152691068830794041481396028443352709138", + "2347138135642758877746181518404363115684", + "2395749902345750086812377890894615717321", + ], + "tickCumulatives": Array [ + -13, + -31, + -43, + -37, + -15, + 9, + 15, + ], +} +`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas all of last 20 seconds 1`] = `91193`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas between oldest and oldest + 1 1`] = `15811`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas latest equal 1`] = `3565`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas latest transform 1`] = `4067`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas middle 1`] = `13986`; + +exports[`Oracle #observe initialized with 5 observations with starting time of 4294967291 gas oldest 1`] = `15538`; diff --git a/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap b/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap new file mode 100644 index 0000000..11308cc --- /dev/null +++ b/lib/v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 1`] = `610`; + +exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 2`] = `478`; + +exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = false 1`] = `478`; + +exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = true 1`] = `610`; + +exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = false gas 1`] = `536`; + +exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = true gas 1`] = `753`; + +exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = false gas 1`] = `848`; + +exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = true gas 1`] = `441`; diff --git a/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap b/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap new file mode 100644 index 0000000..df10cbd --- /dev/null +++ b/lib/v3-core/test/__snapshots__/SwapMath.spec.ts.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SwapMath #computeSwapStep gas swap one for zero exact in capped 1`] = `2103`; + +exports[`SwapMath #computeSwapStep gas swap one for zero exact in partial 1`] = `2802`; + +exports[`SwapMath #computeSwapStep gas swap one for zero exact out capped 1`] = `1855`; + +exports[`SwapMath #computeSwapStep gas swap one for zero exact out partial 1`] = `2802`; + +exports[`SwapMath #computeSwapStep gas swap zero for one exact in capped 1`] = `2104`; + +exports[`SwapMath #computeSwapStep gas swap zero for one exact in partial 1`] = `3106`; + +exports[`SwapMath #computeSwapStep gas swap zero for one exact out capped 1`] = `1856`; + +exports[`SwapMath #computeSwapStep gas swap zero for one exact out partial 1`] = `3106`; diff --git a/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap b/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap new file mode 100644 index 0000000..9d040d1 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/TickBitmap.spec.ts.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TickBitmap #flipTick gas cost of flipping a tick that results in deleting a word 1`] = `13427`; + +exports[`TickBitmap #flipTick gas cost of flipping first tick in word to initialized 1`] = `43965`; + +exports[`TickBitmap #flipTick gas cost of flipping second tick in word to initialized 1`] = `26865`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost for entire word 1`] = `2627`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost just below boundary 1`] = `2627`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = false gas cost on boundary 1`] = `2627`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost for entire word 1`] = `2618`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost just below boundary 1`] = `2928`; + +exports[`TickBitmap #nextInitializedTickWithinOneWord lte = true gas cost on boundary 1`] = `2618`; diff --git a/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap b/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap new file mode 100644 index 0000000..57e13fd --- /dev/null +++ b/lib/v3-core/test/__snapshots__/TickMath.spec.ts.snap @@ -0,0 +1,165 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TickMath #getSqrtRatioAtTick tick -50 gas 1`] = `823`; + +exports[`TickMath #getSqrtRatioAtTick tick -50 result 1`] = `"79030349367926598376800521322"`; + +exports[`TickMath #getSqrtRatioAtTick tick -100 gas 1`] = `823`; + +exports[`TickMath #getSqrtRatioAtTick tick -100 result 1`] = `"78833030112140176575862854579"`; + +exports[`TickMath #getSqrtRatioAtTick tick -250 gas 1`] = `865`; + +exports[`TickMath #getSqrtRatioAtTick tick -250 result 1`] = `"78244023372248365697264290337"`; + +exports[`TickMath #getSqrtRatioAtTick tick -500 gas 1`] = `865`; + +exports[`TickMath #getSqrtRatioAtTick tick -500 result 1`] = `"77272108795590369356373805297"`; + +exports[`TickMath #getSqrtRatioAtTick tick -1000 gas 1`] = `865`; + +exports[`TickMath #getSqrtRatioAtTick tick -1000 result 1`] = `"75364347830767020784054125655"`; + +exports[`TickMath #getSqrtRatioAtTick tick -2500 gas 1`] = `851`; + +exports[`TickMath #getSqrtRatioAtTick tick -2500 result 1`] = `"69919044979842180277688105136"`; + +exports[`TickMath #getSqrtRatioAtTick tick -3000 gas 1`] = `879`; + +exports[`TickMath #getSqrtRatioAtTick tick -3000 result 1`] = `"68192822843687888778582228483"`; + +exports[`TickMath #getSqrtRatioAtTick tick -4000 gas 1`] = `865`; + +exports[`TickMath #getSqrtRatioAtTick tick -4000 result 1`] = `"64867181785621769311890333195"`; + +exports[`TickMath #getSqrtRatioAtTick tick -5000 gas 1`] = `851`; + +exports[`TickMath #getSqrtRatioAtTick tick -5000 result 1`] = `"61703726247759831737814779831"`; + +exports[`TickMath #getSqrtRatioAtTick tick -50000 gas 1`] = `865`; + +exports[`TickMath #getSqrtRatioAtTick tick -50000 result 1`] = `"6504256538020985011912221507"`; + +exports[`TickMath #getSqrtRatioAtTick tick -150000 gas 1`] = `893`; + +exports[`TickMath #getSqrtRatioAtTick tick -150000 result 1`] = `"43836292794701720435367485"`; + +exports[`TickMath #getSqrtRatioAtTick tick -250000 gas 1`] = `879`; + +exports[`TickMath #getSqrtRatioAtTick tick -250000 result 1`] = `"295440463448801648376846"`; + +exports[`TickMath #getSqrtRatioAtTick tick -500000 gas 1`] = `879`; + +exports[`TickMath #getSqrtRatioAtTick tick -500000 result 1`] = `"1101692437043807371"`; + +exports[`TickMath #getSqrtRatioAtTick tick -738203 gas 1`] = `911`; + +exports[`TickMath #getSqrtRatioAtTick tick -738203 result 1`] = `"7409801140451"`; + +exports[`TickMath #getSqrtRatioAtTick tick 50 gas 1`] = `863`; + +exports[`TickMath #getSqrtRatioAtTick tick 50 result 1`] = `"79426470787362580746886972461"`; + +exports[`TickMath #getSqrtRatioAtTick tick 100 gas 1`] = `863`; + +exports[`TickMath #getSqrtRatioAtTick tick 100 result 1`] = `"79625275426524748796330556128"`; + +exports[`TickMath #getSqrtRatioAtTick tick 250 gas 1`] = `905`; + +exports[`TickMath #getSqrtRatioAtTick tick 250 result 1`] = `"80224679980005306637834519095"`; + +exports[`TickMath #getSqrtRatioAtTick tick 500 gas 1`] = `905`; + +exports[`TickMath #getSqrtRatioAtTick tick 500 result 1`] = `"81233731461783161732293370115"`; + +exports[`TickMath #getSqrtRatioAtTick tick 1000 gas 1`] = `905`; + +exports[`TickMath #getSqrtRatioAtTick tick 1000 result 1`] = `"83290069058676223003182343270"`; + +exports[`TickMath #getSqrtRatioAtTick tick 2500 gas 1`] = `891`; + +exports[`TickMath #getSqrtRatioAtTick tick 2500 result 1`] = `"89776708723587163891445672585"`; + +exports[`TickMath #getSqrtRatioAtTick tick 3000 gas 1`] = `919`; + +exports[`TickMath #getSqrtRatioAtTick tick 3000 result 1`] = `"92049301871182272007977902845"`; + +exports[`TickMath #getSqrtRatioAtTick tick 4000 gas 1`] = `905`; + +exports[`TickMath #getSqrtRatioAtTick tick 4000 result 1`] = `"96768528593268422080558758223"`; + +exports[`TickMath #getSqrtRatioAtTick tick 5000 gas 1`] = `891`; + +exports[`TickMath #getSqrtRatioAtTick tick 5000 result 1`] = `"101729702841318637793976746270"`; + +exports[`TickMath #getSqrtRatioAtTick tick 50000 gas 1`] = `905`; + +exports[`TickMath #getSqrtRatioAtTick tick 50000 result 1`] = `"965075977353221155028623082916"`; + +exports[`TickMath #getSqrtRatioAtTick tick 150000 gas 1`] = `933`; + +exports[`TickMath #getSqrtRatioAtTick tick 150000 result 1`] = `"143194173941309278083010301478497"`; + +exports[`TickMath #getSqrtRatioAtTick tick 250000 gas 1`] = `919`; + +exports[`TickMath #getSqrtRatioAtTick tick 250000 result 1`] = `"21246587762933397357449903968194344"`; + +exports[`TickMath #getSqrtRatioAtTick tick 500000 gas 1`] = `919`; + +exports[`TickMath #getSqrtRatioAtTick tick 500000 result 1`] = `"5697689776495288729098254600827762987878"`; + +exports[`TickMath #getSqrtRatioAtTick tick 738203 gas 1`] = `951`; + +exports[`TickMath #getSqrtRatioAtTick tick 738203 result 1`] = `"847134979253254120489401328389043031315994541"`; + +exports[`TickMath #getTickAtSqrtRatio ratio 4295128739 gas 1`] = `2371`; + +exports[`TickMath #getTickAtSqrtRatio ratio 4295128739 result 1`] = `-887272`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543 gas 1`] = `2367`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543 result 1`] = `-276325`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950 gas 1`] = `2367`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950 result 1`] = `-138163`; + +exports[`TickMath #getTickAtSqrtRatio ratio 9903520314283042199192993792 gas 1`] = `1389`; + +exports[`TickMath #getTickAtSqrtRatio ratio 9903520314283042199192993792 result 1`] = `-41591`; + +exports[`TickMath #getTickAtSqrtRatio ratio 28011385487393069959365969113 gas 1`] = `2329`; + +exports[`TickMath #getTickAtSqrtRatio ratio 28011385487393069959365969113 result 1`] = `-20796`; + +exports[`TickMath #getTickAtSqrtRatio ratio 56022770974786139918731938227 gas 1`] = `2315`; + +exports[`TickMath #getTickAtSqrtRatio ratio 56022770974786139918731938227 result 1`] = `-6932`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336 gas 1`] = `2235`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336 result 1`] = `0`; + +exports[`TickMath #getTickAtSqrtRatio ratio 112045541949572279837463876454 gas 1`] = `2355`; + +exports[`TickMath #getTickAtSqrtRatio ratio 112045541949572279837463876454 result 1`] = `6931`; + +exports[`TickMath #getTickAtSqrtRatio ratio 224091083899144559674927752909 gas 1`] = `2369`; + +exports[`TickMath #getTickAtSqrtRatio ratio 224091083899144559674927752909 result 1`] = `20795`; + +exports[`TickMath #getTickAtSqrtRatio ratio 633825300114114700748351602688 gas 1`] = `2393`; + +exports[`TickMath #getTickAtSqrtRatio ratio 633825300114114700748351602688 result 1`] = `41590`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000 gas 1`] = `2407`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000 result 1`] = `138162`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000000 gas 1`] = `2407`; + +exports[`TickMath #getTickAtSqrtRatio ratio 79228162514264337593543950336000000 result 1`] = `276324`; + +exports[`TickMath #getTickAtSqrtRatio ratio 1461446703485210103287273052203988822378723970341 gas 1`] = `2431`; + +exports[`TickMath #getTickAtSqrtRatio ratio 1461446703485210103287273052203988822378723970341 result 1`] = `887271`; diff --git a/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap b/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap new file mode 100644 index 0000000..109b0c9 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UniswapV3Factory #createPool gas 1`] = `4557092`; + +exports[`UniswapV3Factory factory bytecode size 1`] = `24535`; + +exports[`UniswapV3Factory pool bytecode size 1`] = `22142`; diff --git a/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap b/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap new file mode 100644 index 0000000..2e4e465 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap @@ -0,0 +1,977 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9699", + "arbBalanceDelta1": "-0.0099043", + "backrun": Object { + "delta0": "-9.9699", + "delta1": "0.0099043", + "executionPrice": "0.00099342", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "9.7606", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.0099900", + "executionPrice": "0.00099900", + "priceAfter": "0.0000010040", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9990", + "arbBalanceDelta1": "-0.0099044", + "backrun": Object { + "delta0": "-0.30578", + "delta1": "0.0095969", + "executionPrice": "0.031385", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0910e+12", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "0.30682", + "delta1": "-0.0096834", + "executionPrice": "0.031561", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0910e+12", + }, + "profit": Object { + "afterFrontrun": "-0.29100", + "afterSandwich": "9.4990", + "final": "9.7891", + }, + "sandwichedPrice": "0.00099910", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9700", + "arbBalanceDelta1": "-0.010055", + "backrun": Object { + "delta0": "-9.9700", + "delta1": "0.010055", + "executionPrice": "0.0010085", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "10.060", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.0099900", + "executionPrice": "0.00099900", + "priceAfter": "0.0000010040", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9991", + "arbBalanceDelta1": "-0.010055", + "backrun": Object { + "delta0": "-0.30593", + "delta1": "0.0097475", + "executionPrice": "0.031862", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0910e+12", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "0.30682", + "delta1": "-0.0096834", + "executionPrice": "0.031561", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0910e+12", + }, + "profit": Object { + "afterFrontrun": "-0.30020", + "afterSandwich": "9.7898", + "final": "10.089", + }, + "sandwichedPrice": "0.00099910", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9583", + "arbBalanceDelta1": "-0.90001", + "backrun": Object { + "delta0": "-9.9583", + "delta1": "0.90001", + "executionPrice": "0.090377", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "8.8592", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.90884", + "executionPrice": "0.090884", + "priceAfter": "0.0083097", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9814", + "arbBalanceDelta1": "-0.90054", + "backrun": Object { + "delta0": "-2.2983", + "delta1": "0.68841", + "executionPrice": "0.29953", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0412e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "2.3169", + "delta1": "-0.69788", + "executionPrice": "0.30121", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0412e+13", + }, + "profit": Object { + "afterFrontrun": "-1.5727", + "afterSandwich": "7.3173", + "final": "8.8812", + }, + "sandwichedPrice": "0.091001", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9735", + "arbBalanceDelta1": "-0.91507", + "backrun": Object { + "delta0": "-9.9735", + "delta1": "0.91507", + "executionPrice": "0.091750", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "9.1581", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.90884", + "executionPrice": "0.090884", + "priceAfter": "0.0083097", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9965", + "arbBalanceDelta1": "-0.91560", + "backrun": Object { + "delta0": "-2.3134", + "delta1": "0.70347", + "executionPrice": "0.30408", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0412e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "2.3169", + "delta1": "-0.69788", + "executionPrice": "0.30121", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0412e+13", + }, + "profit": Object { + "afterFrontrun": "-1.6422", + "afterSandwich": "7.5478", + "final": "9.1809", + }, + "sandwichedPrice": "0.091001", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.8533", + "arbBalanceDelta1": "-4.8918", + "backrun": Object { + "delta0": "-9.8533", + "delta1": "4.8918", + "executionPrice": "0.49646", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "4.7644", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-4.9925", + "executionPrice": "0.49925", + "priceAfter": "0.25075", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.8709", + "arbBalanceDelta1": "-4.8940", + "backrun": Object { + "delta0": "-4.0029", + "delta1": "2.8107", + "executionPrice": "0.70217", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "2.4408e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "4.1321", + "delta1": "-2.9177", + "executionPrice": "0.70611", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "2.4408e+13", + }, + "profit": Object { + "afterFrontrun": "-1.1317", + "afterSandwich": "3.6674", + "final": "4.7795", + }, + "sandwichedPrice": "0.50009", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "10.005", + "arbBalanceDelta1": "-5.0424", + "backrun": Object { + "delta0": "-10.005", + "delta1": "5.0424", + "executionPrice": "0.50401", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "5.0623", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-4.9925", + "executionPrice": "0.49925", + "priceAfter": "0.25075", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "10.022", + "arbBalanceDelta1": "-5.0446", + "backrun": Object { + "delta0": "-4.1543", + "delta1": "2.9613", + "executionPrice": "0.71283", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "2.4408e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "4.1321", + "delta1": "-2.9177", + "executionPrice": "0.70611", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "2.4408e+13", + }, + "profit": Object { + "afterFrontrun": "-1.2557", + "afterSandwich": "3.8434", + "final": "5.0779", + }, + "sandwichedPrice": "0.50009", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "8.8029", + "arbBalanceDelta1": "-7.9363", + "backrun": Object { + "delta0": "-8.8029", + "delta1": "7.9363", + "executionPrice": "0.90155", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "0.69056", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-9.0661", + "executionPrice": "0.90661", + "priceAfter": "0.82690", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "8.8190", + "arbBalanceDelta1": "-7.9680", + "backrun": Object { + "delta0": "-3.4354", + "delta1": "3.2562", + "executionPrice": "0.94781", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "3.2947e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "4.6164", + "delta1": "-4.4000", + "executionPrice": "0.95313", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "3.2947e+13", + }, + "profit": Object { + "afterFrontrun": "-0.12404", + "afterSandwich": "0.56403", + "final": "0.67460", + }, + "sandwichedPrice": "0.91119", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "10.317", + "arbBalanceDelta1": "-9.4423", + "backrun": Object { + "delta0": "-10.317", + "delta1": "9.4423", + "executionPrice": "0.91525", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "0.97752", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-9.0661", + "executionPrice": "0.90661", + "priceAfter": "0.82690", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 0; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "10.333", + "arbBalanceDelta1": "-9.4741", + "backrun": Object { + "delta0": "-4.9492", + "delta1": "4.7622", + "executionPrice": "0.96221", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "3.2947e+13", + }, + "collect": Object { + "amount0": "0.030000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "4.6164", + "delta1": "-4.4000", + "executionPrice": "0.95313", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "3.2947e+13", + }, + "profit": Object { + "afterFrontrun": "-0.26253", + "afterSandwich": "0.72554", + "final": "0.96205", + }, + "sandwichedPrice": "0.91119", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9699", + "arbBalanceDelta1": "-0.0099043", + "backrun": Object { + "delta0": "-9.9699", + "delta1": "0.0099043", + "executionPrice": "0.00099342", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "9.7606", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.0099900", + "executionPrice": "0.00099900", + "priceAfter": "0.0000010040", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9940", + "arbBalanceDelta1": "-0.0099044", + "backrun": Object { + "delta0": "-0.30578", + "delta1": "0.0095969", + "executionPrice": "0.031385", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0910e+12", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "0.30682", + "delta1": "-0.0096834", + "executionPrice": "0.031561", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0910e+12", + }, + "profit": Object { + "afterFrontrun": "-0.29100", + "afterSandwich": "9.4941", + "final": "9.7842", + }, + "sandwichedPrice": "0.00099910", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9700", + "arbBalanceDelta1": "-0.010055", + "backrun": Object { + "delta0": "-9.9700", + "delta1": "0.010055", + "executionPrice": "0.0010085", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "10.060", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.0099900", + "executionPrice": "0.00099900", + "priceAfter": "0.0000010040", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 0.010000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9941", + "arbBalanceDelta1": "-0.010055", + "backrun": Object { + "delta0": "-0.30593", + "delta1": "0.0097475", + "executionPrice": "0.031862", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0910e+12", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "0.30682", + "delta1": "-0.0096834", + "executionPrice": "0.031561", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0910e+12", + }, + "profit": Object { + "afterFrontrun": "-0.30020", + "afterSandwich": "9.7848", + "final": "10.084", + }, + "sandwichedPrice": "0.00099910", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9583", + "arbBalanceDelta1": "-0.90001", + "backrun": Object { + "delta0": "-9.9583", + "delta1": "0.90001", + "executionPrice": "0.090377", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "8.8592", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.90884", + "executionPrice": "0.090884", + "priceAfter": "0.0083097", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9764", + "arbBalanceDelta1": "-0.90054", + "backrun": Object { + "delta0": "-2.2983", + "delta1": "0.68841", + "executionPrice": "0.29953", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0412e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "2.3169", + "delta1": "-0.69788", + "executionPrice": "0.30121", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0412e+13", + }, + "profit": Object { + "afterFrontrun": "-1.5727", + "afterSandwich": "7.3124", + "final": "8.8763", + }, + "sandwichedPrice": "0.091001", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.9735", + "arbBalanceDelta1": "-0.91507", + "backrun": Object { + "delta0": "-9.9735", + "delta1": "0.91507", + "executionPrice": "0.091750", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "9.1581", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-0.90884", + "executionPrice": "0.090884", + "priceAfter": "0.0083097", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 1.0000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.9915", + "arbBalanceDelta1": "-0.91560", + "backrun": Object { + "delta0": "-2.3134", + "delta1": "0.70347", + "executionPrice": "0.30408", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "1.0412e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "2.3169", + "delta1": "-0.69788", + "executionPrice": "0.30121", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "1.0412e+13", + }, + "profit": Object { + "afterFrontrun": "-1.6422", + "afterSandwich": "7.5427", + "final": "9.1758", + }, + "sandwichedPrice": "0.091001", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "9.8533", + "arbBalanceDelta1": "-4.8918", + "backrun": Object { + "delta0": "-9.8533", + "delta1": "4.8918", + "executionPrice": "0.49646", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "4.7644", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-4.9925", + "executionPrice": "0.49925", + "priceAfter": "0.25075", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "9.8659", + "arbBalanceDelta1": "-4.8940", + "backrun": Object { + "delta0": "-4.0029", + "delta1": "2.8107", + "executionPrice": "0.70217", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "2.4408e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "4.1321", + "delta1": "-2.9177", + "executionPrice": "0.70611", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "2.4408e+13", + }, + "profit": Object { + "afterFrontrun": "-1.1317", + "afterSandwich": "3.6625", + "final": "4.7746", + }, + "sandwichedPrice": "0.50009", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "10.005", + "arbBalanceDelta1": "-5.0424", + "backrun": Object { + "delta0": "-10.005", + "delta1": "5.0424", + "executionPrice": "0.50401", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "5.0623", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-4.9925", + "executionPrice": "0.49925", + "priceAfter": "0.25075", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 10.000 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "10.017", + "arbBalanceDelta1": "-5.0446", + "backrun": Object { + "delta0": "-4.1543", + "delta1": "2.9613", + "executionPrice": "0.71283", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "2.4408e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "4.1321", + "delta1": "-2.9177", + "executionPrice": "0.70611", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "2.4408e+13", + }, + "profit": Object { + "afterFrontrun": "-1.2557", + "afterSandwich": "3.8384", + "final": "5.0729", + }, + "sandwichedPrice": "0.50009", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "8.8029", + "arbBalanceDelta1": "-7.9363", + "backrun": Object { + "delta0": "-8.8029", + "delta1": "7.9363", + "executionPrice": "0.90155", + }, + "finalPrice": "0.97706", + "profit": Object { + "final": "0.69056", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-9.0661", + "executionPrice": "0.90661", + "priceAfter": "0.82690", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 0.98 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "8.8140", + "arbBalanceDelta1": "-7.9680", + "backrun": Object { + "delta0": "-3.4354", + "delta1": "3.2562", + "executionPrice": "0.94781", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "3.2947e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "0.97706", + "frontrun": Object { + "delta0": "4.6164", + "delta1": "-4.4000", + "executionPrice": "0.95313", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "3.2947e+13", + }, + "profit": Object { + "afterFrontrun": "-0.12404", + "afterSandwich": "0.55913", + "final": "0.66970", + }, + "sandwichedPrice": "0.91119", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 backrun to true price after swap only 1`] = ` +Object { + "arbBalanceDelta0": "10.317", + "arbBalanceDelta1": "-9.4423", + "backrun": Object { + "delta0": "-10.317", + "delta1": "9.4423", + "executionPrice": "0.91525", + }, + "finalPrice": "1.0070", + "profit": Object { + "final": "0.97752", + }, +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 not sandwiched 1`] = ` +Object { + "amount0Delta": "10.000", + "amount1Delta": "-9.0661", + "executionPrice": "0.90661", + "priceAfter": "0.82690", +} +`; + +exports[`UniswapV3Pool arbitrage tests protocol fee = 6; passive liquidity of 100.00 exact input of 10e18 token0 with starting price of 1.0 and true price of 1.01 sandwiched with swap to execution price then mint max liquidity/target/burn max liquidity 1`] = ` +Object { + "arbBalanceDelta0": "10.328", + "arbBalanceDelta1": "-9.4741", + "backrun": Object { + "delta0": "-4.9492", + "delta1": "4.7622", + "executionPrice": "0.96221", + }, + "burn": Object { + "amount0": "9.9700", + "amount1": "3.2947e+13", + }, + "collect": Object { + "amount0": "0.025000", + "amount1": "0.0000", + }, + "finalPrice": "1.0070", + "frontrun": Object { + "delta0": "4.6164", + "delta1": "-4.4000", + "executionPrice": "0.95313", + }, + "mint": Object { + "amount0": "0.0000", + "amount1": "3.2947e+13", + }, + "profit": Object { + "afterFrontrun": "-0.26253", + "afterSandwich": "0.72049", + "final": "0.95700", + }, + "sandwichedPrice": "0.91119", +} +`; diff --git a/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap b/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap new file mode 100644 index 0000000..37bc657 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UniswapV3Pool gas tests fee is off #burn above current price burn entire position after some time passes 1`] = `58703`; + +exports[`UniswapV3Pool gas tests fee is off #burn above current price burn when only position using ticks 1`] = `58703`; + +exports[`UniswapV3Pool gas tests fee is off #burn above current price entire position burn but other positions are using the ticks 1`] = `82740`; + +exports[`UniswapV3Pool gas tests fee is off #burn above current price partial position burn 1`] = `97740`; + +exports[`UniswapV3Pool gas tests fee is off #burn around current price burn entire position after some time passes 1`] = `69498`; + +exports[`UniswapV3Pool gas tests fee is off #burn around current price burn when only position using ticks 1`] = `66309`; + +exports[`UniswapV3Pool gas tests fee is off #burn around current price entire position burn but other positions are using the ticks 1`] = `87551`; + +exports[`UniswapV3Pool gas tests fee is off #burn around current price partial position burn 1`] = `102551`; + +exports[`UniswapV3Pool gas tests fee is off #burn below current price burn entire position after some time passes 1`] = `64624`; + +exports[`UniswapV3Pool gas tests fee is off #burn below current price burn when only position using ticks 1`] = `64624`; + +exports[`UniswapV3Pool gas tests fee is off #burn below current price entire position burn but other positions are using the ticks 1`] = `83381`; + +exports[`UniswapV3Pool gas tests fee is off #burn below current price partial position burn 1`] = `98381`; + +exports[`UniswapV3Pool gas tests fee is off #collect close to worst case 1`] = `35816`; + +exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext grow by 1 slot 1`] = `51098`; + +exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext no op 1`] = `24677`; + +exports[`UniswapV3Pool gas tests fee is off #mint above current price add to position after some time passes 1`] = `109351`; + +exports[`UniswapV3Pool gas tests fee is off #mint above current price add to position existing 1`] = `109351`; + +exports[`UniswapV3Pool gas tests fee is off #mint above current price new position mint first in range 1`] = `228025`; + +exports[`UniswapV3Pool gas tests fee is off #mint above current price second position in same range 1`] = `126451`; + +exports[`UniswapV3Pool gas tests fee is off #mint around current price add to position after some time passes 1`] = `147718`; + +exports[`UniswapV3Pool gas tests fee is off #mint around current price add to position existing 1`] = `138539`; + +exports[`UniswapV3Pool gas tests fee is off #mint around current price new position mint first in range 1`] = `328848`; + +exports[`UniswapV3Pool gas tests fee is off #mint around current price second position in same range 1`] = `155639`; + +exports[`UniswapV3Pool gas tests fee is off #mint below current price add to position after some time passes 1`] = `109943`; + +exports[`UniswapV3Pool gas tests fee is off #mint below current price add to position existing 1`] = `109943`; + +exports[`UniswapV3Pool gas tests fee is off #mint below current price new position mint first in range 1`] = `309729`; + +exports[`UniswapV3Pool gas tests fee is off #mint below current price second position in same range 1`] = `127043`; + +exports[`UniswapV3Pool gas tests fee is off #poke best case 1`] = `52006`; + +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick above 1`] = `29643`; + +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick below 1`] = `29605`; + +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick inside 1`] = `37053`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block moves tick, no initialized crossings 1`] = `114858`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block with no tick movement 1`] = `99004`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap crossing a single initialized tick 1`] = `129871`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap crossing several initialized ticks 1`] = `152706`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 first swap in block, large swap, no initialized crossings 1`] = `129469`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 large swap crossing several initialized ticks after some time passes 1`] = `152706`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 large swap crossing several initialized ticks second time after some time passes 1`] = `212706`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block moves tick, no initialized crossings 1`] = `114858`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block with no tick movement 1`] = `99115`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block, large swap crossing a single initialized tick 1`] = `116454`; + +exports[`UniswapV3Pool gas tests fee is off #swapExact0For1 second swap in block, large swap crossing several initialized ticks 1`] = `139267`; + +exports[`UniswapV3Pool gas tests fee is on #burn above current price burn entire position after some time passes 1`] = `58703`; + +exports[`UniswapV3Pool gas tests fee is on #burn above current price burn when only position using ticks 1`] = `58703`; + +exports[`UniswapV3Pool gas tests fee is on #burn above current price entire position burn but other positions are using the ticks 1`] = `82740`; + +exports[`UniswapV3Pool gas tests fee is on #burn above current price partial position burn 1`] = `97740`; + +exports[`UniswapV3Pool gas tests fee is on #burn around current price burn entire position after some time passes 1`] = `69498`; + +exports[`UniswapV3Pool gas tests fee is on #burn around current price burn when only position using ticks 1`] = `66309`; + +exports[`UniswapV3Pool gas tests fee is on #burn around current price entire position burn but other positions are using the ticks 1`] = `87551`; + +exports[`UniswapV3Pool gas tests fee is on #burn around current price partial position burn 1`] = `102551`; + +exports[`UniswapV3Pool gas tests fee is on #burn below current price burn entire position after some time passes 1`] = `64624`; + +exports[`UniswapV3Pool gas tests fee is on #burn below current price burn when only position using ticks 1`] = `64624`; + +exports[`UniswapV3Pool gas tests fee is on #burn below current price entire position burn but other positions are using the ticks 1`] = `83381`; + +exports[`UniswapV3Pool gas tests fee is on #burn below current price partial position burn 1`] = `98381`; + +exports[`UniswapV3Pool gas tests fee is on #collect close to worst case 1`] = `35816`; + +exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext grow by 1 slot 1`] = `51098`; + +exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext no op 1`] = `24677`; + +exports[`UniswapV3Pool gas tests fee is on #mint above current price add to position after some time passes 1`] = `109363`; + +exports[`UniswapV3Pool gas tests fee is on #mint above current price add to position existing 1`] = `109363`; + +exports[`UniswapV3Pool gas tests fee is on #mint above current price new position mint first in range 1`] = `228037`; + +exports[`UniswapV3Pool gas tests fee is on #mint above current price second position in same range 1`] = `126463`; + +exports[`UniswapV3Pool gas tests fee is on #mint around current price add to position after some time passes 1`] = `147730`; + +exports[`UniswapV3Pool gas tests fee is on #mint around current price add to position existing 1`] = `138551`; + +exports[`UniswapV3Pool gas tests fee is on #mint around current price new position mint first in range 1`] = `328860`; + +exports[`UniswapV3Pool gas tests fee is on #mint around current price second position in same range 1`] = `155651`; + +exports[`UniswapV3Pool gas tests fee is on #mint below current price add to position after some time passes 1`] = `109955`; + +exports[`UniswapV3Pool gas tests fee is on #mint below current price add to position existing 1`] = `109955`; + +exports[`UniswapV3Pool gas tests fee is on #mint below current price new position mint first in range 1`] = `309741`; + +exports[`UniswapV3Pool gas tests fee is on #mint below current price second position in same range 1`] = `127055`; + +exports[`UniswapV3Pool gas tests fee is on #poke best case 1`] = `52006`; + +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick above 1`] = `29643`; + +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick below 1`] = `29605`; + +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick inside 1`] = `37053`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block moves tick, no initialized crossings 1`] = `120257`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block with no tick movement 1`] = `104256`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap crossing a single initialized tick 1`] = `135417`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap crossing several initialized ticks 1`] = `158693`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 first swap in block, large swap, no initialized crossings 1`] = `135162`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 large swap crossing several initialized ticks after some time passes 1`] = `158693`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 large swap crossing several initialized ticks second time after some time passes 1`] = `218693`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block moves tick, no initialized crossings 1`] = `120257`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block with no tick movement 1`] = `104367`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block, large swap crossing a single initialized tick 1`] = `121853`; + +exports[`UniswapV3Pool gas tests fee is on #swapExact0For1 second swap in block, large swap crossing several initialized ticks 1`] = `145107`; diff --git a/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap b/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap new file mode 100644 index 0000000..e36c7c0 --- /dev/null +++ b/lib/v3-core/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap @@ -0,0 +1,3541 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UniswapV3Pool swap tests close to max price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "1000", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-26083549850867114346332688477747755628", + "executionPrice": "2.6084e+34", + "feeGrowthGlobal0X128Delta": "2381976568446569244235", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.1734e+30", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 705098, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "0", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "1000", + "executionPrice": "-Infinity", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.7014e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 880340, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "1000000000000000000", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-26087635650665564420687107504180041533", + "executionPrice": "2.6088e+19", + "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.0241", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 13923, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "1000000000000000000", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-26087635650665564420687107504180041533", + "executionPrice": "2.6088e+19", + "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.0241", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 13923, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "0", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "1000000000000000000", + "executionPrice": "-Infinity", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "1.7014e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 880340, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "1", + "poolBalance1": "26087635650665564424699143612505016738", + "poolPriceBefore": "1.7014e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "2", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-1000", + "executionPrice": "500.00", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.7014e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 880340, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "2", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-1000000000000000000", + "executionPrice": "5.0000e+17", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.7014e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 880340, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "2", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-1000000000000000000", + "executionPrice": "5.0000e+17", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.7014e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 880340, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "3171793039286238109", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-26087635650665564423434232548437664977", + "executionPrice": "8.2249e+18", + "feeGrowthGlobal0X128Delta": "1618957864187523123655042148763283097", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.7014e+38", + "tickAfter": -9164, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token0 for token1 to price 2.5000 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "1268717215714495281", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "-26087635650665564421536865952336637378", + "executionPrice": "2.0562e+19", + "feeGrowthGlobal0X128Delta": "647583145675012618257449376796101507", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 9163, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "0", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "10740898373457544742072477595619363803", + "executionPrice": "-Infinity", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "5482407482066087054477299856254072312542046383926535301", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 887271, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "1", + "amount0Delta": "0", + "amount1Before": "26087635650665564424699143612505016738", + "amount1Delta": "10740898373457544742072477595619363803", + "executionPrice": "-Infinity", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "5482407482066087054477299856254072312542046383926535301", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.7014e+38", + "tickAfter": 887271, + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "1", + "poolBalance1": "26087635650665564424699143612505016738", + "poolPriceBefore": "1.7014e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "1", + "poolBalance1": "26087635650665564424699143612505016738", + "poolPriceBefore": "1.7014e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to max price swap token1 for token0 to price 2.5000 1`] = ` +Object { + "poolBalance0": "1", + "poolBalance1": "26087635650665564424699143612505016738", + "poolPriceBefore": "1.7014e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 880340, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "1000", + "amount1Before": "1", + "amount1Delta": "0", + "executionPrice": "0.0000", + "feeGrowthGlobal0X128Delta": "170141183460469231731687", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000059000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -880303, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-26033697540846965126433148994127431276", + "amount1Before": "1", + "amount1Delta": "1000", + "executionPrice": "0.000000000000000000000000000000000038412", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "2381976568446569244235", + "poolPriceAfter": "0.00000000000000000000000000000023974", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -705093, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "1000000000000000000", + "amount1Before": "1", + "amount1Delta": "0", + "executionPrice": "0.0000", + "feeGrowthGlobal0X128Delta": "170141183460469231731687303715884105728", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000059000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -880303, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "26037782196502120275425782622539039026", + "poolBalance1": "1", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-26037782196502120271413746514214063808", + "amount1Before": "1", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.000000000000000000038406", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", + "poolPriceAfter": "0.24850", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -13924, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-26037782196502120271413746514214063808", + "amount1Before": "1", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.000000000000000000038406", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", + "poolPriceAfter": "0.24850", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -13924, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "10790901831095468191587263901270792610", + "amount1Before": "1", + "amount1Delta": "0", + "executionPrice": "0.0000", + "feeGrowthGlobal0X128Delta": "5507930424444982259736347157352787128931407551935325049", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -887272, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "10790901831095468191587263901270792610", + "amount1Before": "1", + "amount1Delta": "0", + "executionPrice": "0.0000", + "feeGrowthGlobal0X128Delta": "5507930424444982259736347157352787128931407551935325049", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -887272, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "26037782196502120275425782622539039026", + "poolBalance1": "1", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token0 for token1 to price 0.40000 1`] = ` +Object { + "poolBalance0": "26037782196502120275425782622539039026", + "poolBalance1": "1", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "26037782196502120275425782622539039026", + "poolBalance1": "1", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-1000", + "amount1Before": "1", + "amount1Delta": "2", + "executionPrice": "0.0020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000059000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -880303, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-1000000000000000000", + "amount1Before": "1", + "amount1Delta": "2", + "executionPrice": "0.0000000000000000020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000059000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -880303, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-1000000000000000000", + "amount1Before": "1", + "amount1Delta": "2", + "executionPrice": "0.0000000000000000020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000059000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -880303, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-26037782196502120272263504962370659661", + "amount1Before": "1", + "amount1Delta": "1268717215714495283", + "executionPrice": "0.000000000000000000048726", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "647583145675012958539816297734564973", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": -9164, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests close to min price swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "26037782196502120275425782622539039026", + "amount0Delta": "-26037782196502120274160871558471687260", + "amount1Before": "1", + "amount1Delta": "3171793039286238112", + "executionPrice": "0.00000000000000000012182", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1618957864187523634078592530170978294", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "0.0000000000000000000000000000000000000059000", + "tickAfter": 9163, + "tickBefore": -880303, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-989", + "executionPrice": "0.98900", + "feeGrowthGlobal0X128Delta": "1701411834604692317316", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-989", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000", + "executionPrice": "1.0111", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1701411834604692317316", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-662207357859531772", + "executionPrice": "0.66221", + "feeGrowthGlobal0X128Delta": "1701411834604692317316873037158841057", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.44742", + "poolPriceBefore": "1.0000", + "tickAfter": -8043, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "836795075501202120", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70004", + "feeGrowthGlobal0X128Delta": "1423733044596672457631004491657125052", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-662207357859531772", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5101", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1701411834604692317316873037158841057", + "poolPriceAfter": "2.2350", + "poolPriceBefore": "1.0000", + "tickAfter": 8042, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904951", + "amount1Before": "2000000000000000000", + "amount1Delta": "836795075501202120", + "executionPrice": "1.4285", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1423733044596672457631004491657125052", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1012", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000", + "executionPrice": "0.98814", + "feeGrowthGlobal0X128Delta": "1871553018065161549048", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "2020202020202020203", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.49500", + "feeGrowthGlobal0X128Delta": "3437195625464025050172418213103875650", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.25000", + "poolPriceBefore": "1.0000", + "tickAfter": -13864, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "836795075501202120", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70004", + "feeGrowthGlobal0X128Delta": "1423733044596672457631004491657125052", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1174017838553918518", + "amount1Before": "2000000000000000000", + "amount1Delta": "-735088935932648267", + "executionPrice": "0.62613", + "feeGrowthGlobal0X128Delta": "1997487844552658120479227965844634309", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "1012", + "executionPrice": "1.0120", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1871553018065161549048", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "2020202020202020203", + "executionPrice": "2.0202", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "3437195625464025050172418213103875650", + "poolPriceAfter": "4.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 13863, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904951", + "amount1Before": "2000000000000000000", + "amount1Delta": "836795075501202120", + "executionPrice": "1.4285", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1423733044596672457631004491657125052", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests high fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-735088935932648267", + "amount1Before": "2000000000000000000", + "amount1Delta": "1174017838553918518", + "executionPrice": "1.5971", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1997487844552658120479227965844634309", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1000", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-36792225529204286454178948640580261338", + "executionPrice": "3.6792e+34", + "feeGrowthGlobal0X128Delta": "2381976568446569244235", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.1734e+30", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 705098, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1000000000000000000", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-36796311329002736528533367667012547243", + "executionPrice": "3.6796e+19", + "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.0241", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 13923, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1000000000000000000", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-36796311329002736528533367667012547243", + "executionPrice": "3.6796e+19", + "feeGrowthGlobal0X128Delta": "510423550381413479995299567101531162", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "4.0241", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 13923, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "2", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-1000", + "executionPrice": "500.00", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.3849e+38", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 887219, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "2", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-1000000000000000000", + "executionPrice": "5.0000e+17", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.3849e+38", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 887219, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "2", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-1000000000000000000", + "executionPrice": "5.0000e+17", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.3849e+38", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 887219, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "3171793039286238109", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-36796311329002736531280492711270170687", + "executionPrice": "1.1601e+19", + "feeGrowthGlobal0X128Delta": "1618957864187523123655042148763283097", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "3.4026e+38", + "tickAfter": -9164, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token0 for token1 to price 2.5000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1268717215714495281", + "amount1Before": "36796311329002736532545403775337522448", + "amount1Delta": "-36796311329002736529383126115169143088", + "executionPrice": "2.9003e+19", + "feeGrowthGlobal0X128Delta": "647583145675012618257449376796101507", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "3.4026e+38", + "tickAfter": 9163, + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the max ratio swap token1 for token0 to price 2.5000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "36796311329002736532545403775337522448", + "poolPriceBefore": "3.4026e+38", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 887271, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-36792226666449146913445651103694411508", + "amount1Before": "0", + "amount1Delta": "1000", + "executionPrice": "0.000000000000000000000000000000000027180", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "2381976568446569244235", + "poolPriceAfter": "0.00000000000000000000000000000023974", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -705093, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-36796311322104302058426248623781044040", + "amount1Before": "0", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.000000000000000000027177", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", + "poolPriceAfter": "0.24850", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -13924, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-36796311322104302058426248623781044040", + "amount1Before": "0", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.000000000000000000027177", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381413820277666488039994629", + "poolPriceAfter": "0.24850", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -13924, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for token1 to price 0.40000 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "36796311322104302062438284732106019258", + "poolBalance1": "0", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-1000", + "amount1Before": "0", + "amount1Delta": "2", + "executionPrice": "0.0020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000029543", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -887220, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-1000000000000000000", + "amount1Before": "0", + "amount1Delta": "2", + "executionPrice": "0.0000000000000000020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000029543", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -887220, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-1000000000000000000", + "amount1Before": "0", + "amount1Delta": "2", + "executionPrice": "0.0000000000000000020000", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.0000000000000000000000000000000000000029543", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -887220, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for token0 to price 0.40000 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-36796311322104302059276007071937639893", + "amount1Before": "0", + "amount1Delta": "1268717215714495283", + "executionPrice": "0.000000000000000000034479", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "647583145675012958539816297734564973", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": -9164, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests initialized at the min ratio swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "36796311322104302062438284732106019258", + "amount0Delta": "-36796311322104302061173373668038667492", + "amount1Before": "0", + "amount1Delta": "3171793039286238112", + "executionPrice": "0.000000000000000000086199", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1618957864187523634078592530170978294", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "0.0000000000000000000000000000000000000029390", + "tickAfter": 9163, + "tickBefore": -887272, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-998", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-998", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-666444407401233536", + "executionPrice": "0.66644", + "feeGrowthGlobal0X128Delta": "85070591730234956148210572796405514", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.44459", + "poolPriceBefore": "1.0000", + "tickAfter": -8107, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "828841545518949575", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904950", + "executionPrice": "0.70675", + "feeGrowthGlobal0X128Delta": "70510040727899606087499539976421836", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-666444407401233536", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5005", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85070591730234956148210572796405515", + "poolPriceAfter": "2.2493", + "poolPriceBefore": "1.0000", + "tickAfter": 8106, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904950", + "amount1Before": "2000000000000000000", + "amount1Delta": "828841545518949574", + "executionPrice": "1.4149", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "70510040727899435946316079507190105", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1002", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "2001000500250125077", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.49975", + "feeGrowthGlobal0X128Delta": "170226296608774038574344664756091446", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.25000", + "poolPriceBefore": "1.0000", + "tickAfter": -13864, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "828841545518949575", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904950", + "executionPrice": "0.70675", + "feeGrowthGlobal0X128Delta": "70510040727899606087499539976421836", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1162859089713235953", + "amount1Before": "2000000000000000000", + "amount1Delta": "-735088935932648266", + "executionPrice": "0.63214", + "feeGrowthGlobal0X128Delta": "98925110860787308007692432636113977", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "1002", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "2001000500250125079", + "executionPrice": "2.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170226296608774378856711585694554910", + "poolPriceAfter": "4.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 13863, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904950", + "amount1Before": "2000000000000000000", + "amount1Delta": "828841545518949574", + "executionPrice": "1.4149", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "70510040727899435946316079507190105", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-735088935932648266", + "amount1Before": "2000000000000000000", + "amount1Delta": "1162859089713235954", + "executionPrice": "1.5819", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "98925110860787308007692432636113978", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000", + "amount1Before": "999700069986003", + "amount1Delta": "-998", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-998", + "amount1Before": "999700069986003", + "amount1Delta": "1000", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1002", + "amount1Before": "999700069986003", + "amount1Delta": "-1000", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "999700069986003", + "poolBalance1": "999700069986003", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-1000", + "amount1Before": "999700069986003", + "amount1Delta": "1002", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "999700069986003", + "poolBalance1": "999700069986003", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "1000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "0", + "executionPrice": "0.0000", + "feeGrowthGlobal0X128Delta": "29575000", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "0", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "1000", + "executionPrice": "-Infinity", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "29575000", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "1000000000000000000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-996999999999999318", + "executionPrice": "0.99700", + "feeGrowthGlobal0X128Delta": "88725000000017597125", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "1000000000000000000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-996999999999999318", + "executionPrice": "0.99700", + "feeGrowthGlobal0X128Delta": "88725000000017597125", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-996999999999999232", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.0030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "88725000000020140575", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-996999999999999232", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.0030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "88725000000020140575", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "145660", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-1000", + "executionPrice": "0.0068653", + "feeGrowthGlobal0X128Delta": "12924275", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "1003009027081361181", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.99700", + "feeGrowthGlobal0X128Delta": "88991975927793784300", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "1003009027081361181", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.99700", + "feeGrowthGlobal0X128Delta": "88991975927793784300", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "6706554036096900675845906992672697", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "-4228872409409224753601131225116702", + "executionPrice": "0.63056", + "feeGrowthGlobal0X128Delta": "595039006852697512464428097924911949", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "11505743598341114571255423385623647", + "poolBalance1": "11505743598341114571255423385506404", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-1000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "145660", + "executionPrice": "145.66", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "12924275", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-1000000000000000000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "1003009027081361094", + "executionPrice": "1.0030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "88991975927793784300", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-1000000000000000000", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "1003009027081361094", + "executionPrice": "1.0030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "88991975927793784300", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "11505743598341114571255423385623647", + "poolBalance1": "11505743598341114571255423385506404", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "11505743598341114571255423385623647", + "amount0Delta": "-4228872409409224753601131224936259", + "amount1Before": "11505743598341114571255423385506404", + "amount1Delta": "6706554036096900675845906992220230", + "executionPrice": "1.5859", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697512464428097884749099", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "1000", + "amount1Before": "1994009290088178439", + "amount1Delta": "-991", + "executionPrice": "0.99100", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.99402", + "poolPriceBefore": "1.0000", + "tickAfter": -61, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-991", + "amount1Before": "1994009290088178439", + "amount1Delta": "1000", + "executionPrice": "1.0091", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0060", + "poolPriceBefore": "1.0000", + "tickAfter": 60, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "1000000000000000000", + "amount1Before": "1994009290088178439", + "amount1Delta": "-662011820624678025", + "executionPrice": "0.66201", + "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.44355", + "poolPriceBefore": "1.0000", + "tickAfter": -8130, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "824893095908431542", + "amount1Before": "1994009290088178439", + "amount1Delta": "-579795727715083389", + "executionPrice": "0.70287", + "feeGrowthGlobal0X128Delta": "421044862698692740725170743495410672", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-662011820624678025", + "amount1Before": "1994009290088178439", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5105", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "2.2545", + "poolPriceBefore": "1.0000", + "tickAfter": 8129, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-579795727715083389", + "amount1Before": "1994009290088178439", + "amount1Delta": "824893095908431542", + "executionPrice": "1.4227", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "421044862698692740725170743495410672", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "1011", + "amount1Before": "1994009290088178439", + "amount1Delta": "-1000", + "executionPrice": "0.98912", + "feeGrowthGlobal0X128Delta": "680564733841876926926", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.99402", + "poolPriceBefore": "1.0000", + "tickAfter": -61, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "2024171064311638316", + "amount1Before": "1994009290088178439", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.49403", + "feeGrowthGlobal0X128Delta": "1033184581225259164735720748018047287", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.24701", + "poolPriceBefore": "1.0000", + "tickAfter": -13984, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "824893095908431542", + "amount1Before": "1994009290088178439", + "amount1Delta": "-579795727715083389", + "executionPrice": "0.70287", + "feeGrowthGlobal0X128Delta": "421044862698692740725170743495410672", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "1159748196632793863", + "amount1Before": "1994009290088178439", + "amount1Delta": "-729098226020826705", + "executionPrice": "0.62867", + "feeGrowthGlobal0X128Delta": "591962792073745646583043420635066071", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "1994009290088178439", + "poolBalance1": "1994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-1000", + "amount1Before": "1994009290088178439", + "amount1Delta": "1011", + "executionPrice": "1.0110", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0060", + "poolPriceBefore": "1.0000", + "tickAfter": 60, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-1000000000000000000", + "amount1Before": "1994009290088178439", + "amount1Delta": "2024171064311638316", + "executionPrice": "2.0242", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1033184581225259164735720748018047287", + "poolPriceAfter": "4.0484", + "poolPriceBefore": "1.0000", + "tickAfter": 13983, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-579795727715083389", + "amount1Before": "1994009290088178439", + "amount1Delta": "824893095908431542", + "executionPrice": "1.4227", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "421044862698692740725170743495410672", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "1994009290088178439", + "poolBalance1": "1994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "1994009290088178439", + "amount0Delta": "-729098226020826705", + "amount1Before": "1994009290088178439", + "amount1Delta": "1159748196632793863", + "executionPrice": "1.5907", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "591962792073745646583043420635066071", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-996", + "executionPrice": "0.99600", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-996", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000", + "executionPrice": "1.0040", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "-665331998665331998", + "executionPrice": "0.66533", + "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.44533", + "poolPriceBefore": "1.0000", + "tickAfter": -8090, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "830919884399388263", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70499", + "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-665331998665331998", + "amount1Before": "2000000000000000000", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "2.2455", + "poolPriceBefore": "1.0000", + "tickAfter": 8089, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904951", + "amount1Before": "2000000000000000000", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1005", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000", + "executionPrice": "0.99502", + "feeGrowthGlobal0X128Delta": "680564733841876926926", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "2006018054162487463", + "amount1Before": "2000000000000000000", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.49850", + "feeGrowthGlobal0X128Delta": "1023918857334819954209013958517557896", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.25000", + "poolPriceBefore": "1.0000", + "tickAfter": -13864, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "830919884399388263", + "amount1Before": "2000000000000000000", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70499", + "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "1165774985123750584", + "amount1Before": "2000000000000000000", + "amount1Delta": "-735088935932648267", + "executionPrice": "0.63056", + "feeGrowthGlobal0X128Delta": "595039006852697554786973994761078087", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000", + "amount1Before": "2000000000000000000", + "amount1Delta": "1005", + "executionPrice": "1.0050", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-1000000000000000000", + "amount1Before": "2000000000000000000", + "amount1Delta": "2006018054162487463", + "executionPrice": "2.0060", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1023918857334819954209013958517557896", + "poolPriceAfter": "4.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 13863, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-585786437626904951", + "amount1Before": "2000000000000000000", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "2000000000000000000", + "poolBalance1": "2000000000000000000", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "2000000000000000000", + "amount0Delta": "-735088935932648267", + "amount1Before": "2000000000000000000", + "amount1Delta": "1165774985123750584", + "executionPrice": "1.5859", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697554786973994761078087", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-996", + "executionPrice": "0.99600", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-996", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000", + "executionPrice": "1.0040", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-795933705287758544", + "executionPrice": "0.79593", + "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.63923", + "poolPriceBefore": "1.0000", + "tickAfter": -4476, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-795933705287758544", + "executionPrice": "0.79593", + "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.63923", + "poolPriceBefore": "1.0000", + "tickAfter": -4476, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-795933705287758544", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.2564", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", + "poolPriceAfter": "1.5644", + "poolPriceBefore": "1.0000", + "tickAfter": 4475, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-795933705287758544", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.2564", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", + "poolPriceAfter": "1.5644", + "poolPriceBefore": "1.0000", + "tickAfter": 4475, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1005", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000", + "executionPrice": "0.99502", + "feeGrowthGlobal0X128Delta": "680564733841876926926", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1342022152495072924", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.74514", + "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.56026", + "poolPriceBefore": "1.0000", + "tickAfter": -5794, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1342022152495072924", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.74514", + "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.56026", + "poolPriceBefore": "1.0000", + "tickAfter": -5794, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "2325523181756544449", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1464187161953474971", + "executionPrice": "0.62962", + "feeGrowthGlobal0X128Delta": "595039006852697724928157455230309818", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "3994009290088178439", + "poolBalance1": "3994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1005", + "executionPrice": "1.0050", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1342022152495072924", + "executionPrice": "1.3420", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", + "poolPriceAfter": "1.7849", + "poolPriceBefore": "1.0000", + "tickAfter": 5793, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1342022152495072924", + "executionPrice": "1.3420", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", + "poolPriceAfter": "1.7849", + "poolPriceBefore": "1.0000", + "tickAfter": 5793, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "3994009290088178439", + "poolBalance1": "3994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1464187161953474971", + "amount1Before": "3994009290088178439", + "amount1Delta": "2325523181756544449", + "executionPrice": "1.5883", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697724928157455230309818", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "1000", + "amount1Before": "632455532033675867", + "amount1Delta": "-99", + "executionPrice": "0.099000", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.10000", + "poolPriceBefore": "0.10000", + "tickAfter": -23028, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-9969", + "amount1Before": "632455532033675867", + "amount1Delta": "1000", + "executionPrice": "0.10031", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "0.10000", + "poolPriceBefore": "0.10000", + "tickAfter": -23028, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "1000000000000000000", + "amount1Before": "632455532033675867", + "amount1Delta": "-86123526743846551", + "executionPrice": "0.086124", + "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.074620", + "poolPriceBefore": "0.10000", + "tickAfter": -25955, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "6324555320336758664", + "poolBalance1": "632455532033675867", + "poolPriceBefore": "0.10000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-3869747612262812753", + "amount1Before": "632455532033675867", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.25841", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407865336245371616884047", + "poolPriceAfter": "0.66378", + "poolPriceBefore": "0.10000", + "tickAfter": -4099, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-3869747612262812753", + "amount1Before": "632455532033675867", + "amount1Delta": "1000000000000000000", + "executionPrice": "0.25841", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407865336245371616884047", + "poolPriceAfter": "0.66378", + "poolPriceBefore": "0.10000", + "tickAfter": -4099, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "10032", + "amount1Before": "632455532033675867", + "amount1Delta": "-1000", + "executionPrice": "0.099681", + "feeGrowthGlobal0X128Delta": "5274376687274546183682", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.10000", + "poolPriceBefore": "0.10000", + "tickAfter": -23028, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "36907032419362389223785084665766560335", + "amount1Before": "632455532033675867", + "amount1Delta": "-632455532033675838", + "executionPrice": "0.000000000000000000017136", + "feeGrowthGlobal0X128Delta": "18838218521532665615644565874197034349094564536667752274", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "0.10000", + "tickAfter": -887272, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "poolBalance0": "6324555320336758664", + "poolBalance1": "632455532033675867", + "poolPriceBefore": "0.10000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` +Object { + "poolBalance0": "6324555320336758664", + "poolBalance1": "632455532033675867", + "poolPriceBefore": "0.10000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "6324555320336758664", + "poolBalance1": "632455532033675867", + "poolPriceBefore": "0.10000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-1000", + "amount1Before": "632455532033675867", + "amount1Delta": "102", + "executionPrice": "0.10200", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "0.10000", + "poolPriceBefore": "0.10000", + "tickAfter": -23028, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-1000000000000000000", + "amount1Before": "632455532033675867", + "amount1Delta": "119138326055954425", + "executionPrice": "0.11914", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "60811007371978153949466126675899993", + "poolPriceAfter": "0.14109", + "poolPriceBefore": "0.10000", + "tickAfter": -19585, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-1000000000000000000", + "amount1Before": "632455532033675867", + "amount1Delta": "119138326055954425", + "executionPrice": "0.11914", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "60811007371978153949466126675899993", + "poolPriceAfter": "0.14109", + "poolPriceBefore": "0.10000", + "tickAfter": -19585, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-3162277660168379331", + "amount1Before": "632455532033675867", + "amount1Delta": "634358607857247611", + "executionPrice": "0.20060", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "323791572837503501799197590655727195", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "0.10000", + "tickAfter": -9164, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "6324555320336758664", + "amount0Delta": "-5059644256269406930", + "amount1Before": "632455532033675867", + "amount1Delta": "2537434431428990440", + "executionPrice": "0.50150", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1295166291350014177337973823092140516", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "0.10000", + "tickAfter": 9163, + "tickBefore": -23028, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "1000", + "amount1Before": "6324555320336758664", + "amount1Delta": "-9969", + "executionPrice": "9.9690", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "10.000", + "poolPriceBefore": "10.000", + "tickAfter": 23027, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "-99", + "amount1Before": "6324555320336758664", + "amount1Delta": "1000", + "executionPrice": "10.101", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "10.000", + "poolPriceBefore": "10.000", + "tickAfter": 23027, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "1000000000000000000", + "amount1Before": "6324555320336758664", + "amount1Delta": "-3869747612262812754", + "executionPrice": "3.8697", + "feeGrowthGlobal0X128Delta": "510423550381407865336245371616884048", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.5065", + "poolPriceBefore": "10.000", + "tickAfter": 4098, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "1000000000000000000", + "amount1Before": "6324555320336758664", + "amount1Delta": "-3869747612262812754", + "executionPrice": "3.8697", + "feeGrowthGlobal0X128Delta": "510423550381407865336245371616884048", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.5065", + "poolPriceBefore": "10.000", + "tickAfter": 4098, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "-86123526743846551", + "amount1Before": "6324555320336758664", + "amount1Delta": "1000000000000000000", + "executionPrice": "11.611", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "13.401", + "poolPriceBefore": "10.000", + "tickAfter": 25954, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "632455532033675867", + "poolBalance1": "6324555320336758664", + "poolPriceBefore": "10.000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "102", + "amount1Before": "6324555320336758664", + "amount1Delta": "-1000", + "executionPrice": "9.8039", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "10.000", + "poolPriceBefore": "10.000", + "tickAfter": 23027, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "119138326055954425", + "amount1Before": "6324555320336758664", + "amount1Delta": "-1000000000000000000", + "executionPrice": "8.3936", + "feeGrowthGlobal0X128Delta": "60811007371978153949466126675899993", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "7.0877", + "poolPriceBefore": "10.000", + "tickAfter": 19584, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "119138326055954425", + "amount1Before": "6324555320336758664", + "amount1Delta": "-1000000000000000000", + "executionPrice": "8.3936", + "feeGrowthGlobal0X128Delta": "60811007371978153949466126675899993", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "7.0877", + "poolPriceBefore": "10.000", + "tickAfter": 19584, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "2537434431428990438", + "amount1Before": "6324555320336758664", + "amount1Delta": "-5059644256269406930", + "executionPrice": "1.9940", + "feeGrowthGlobal0X128Delta": "1295166291350014007196790362622908786", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "10.000", + "tickAfter": -9164, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token0 for token1 to price 2.5000 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "634358607857247610", + "amount1Before": "6324555320336758664", + "amount1Delta": "-3162277660168379331", + "executionPrice": "4.9850", + "feeGrowthGlobal0X128Delta": "323791572837503501799197590655727196", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "10.000", + "tickAfter": 9163, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "-1000", + "amount1Before": "6324555320336758664", + "amount1Delta": "10032", + "executionPrice": "10.032", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "5274376687274546183682", + "poolPriceAfter": "10.000", + "poolPriceBefore": "10.000", + "tickAfter": 23027, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "632455532033675867", + "amount0Delta": "-632455532033675838", + "amount1Before": "6324555320336758664", + "amount1Delta": "36907032426281581270030941278837275671", + "executionPrice": "5.8355e+19", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "18838218525064384185660173270402201838945341643205005201", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "10.000", + "tickAfter": 887271, + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "poolBalance0": "632455532033675867", + "poolBalance1": "6324555320336758664", + "poolPriceBefore": "10.000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "632455532033675867", + "poolBalance1": "6324555320336758664", + "poolPriceBefore": "10.000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 10:1 price, 2e18 max range liquidity swap token1 for token0 to price 2.5000 1`] = ` +Object { + "poolBalance0": "632455532033675867", + "poolBalance1": "6324555320336758664", + "poolPriceBefore": "10.000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 23027, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-996", + "amount1Before": "0", + "amount1Delta": "1000", + "executionPrice": "1.0040", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-665331998665331998", + "amount1Before": "0", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "2.2455", + "poolPriceBefore": "1.0000", + "tickAfter": 8089, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-585786437626904951", + "amount1Before": "0", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "1995041008271423675", + "poolBalance1": "0", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-1000", + "amount1Before": "0", + "amount1Delta": "1005", + "executionPrice": "1.0050", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-1000000000000000000", + "amount1Before": "0", + "amount1Delta": "2006018054162487463", + "executionPrice": "2.0060", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1023918857334819954209013958517557896", + "poolPriceAfter": "4.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 13863, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-585786437626904951", + "amount1Before": "0", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "1995041008271423675", + "poolBalance1": "0", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-735088935932648267", + "amount1Before": "0", + "amount1Delta": "1165774985123750584", + "executionPrice": "1.5859", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697554786973994761078087", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1000", + "amount1Before": "1995041008271423675", + "amount1Delta": "-996", + "executionPrice": "0.99600", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1000000000000000000", + "amount1Before": "1995041008271423675", + "amount1Delta": "-665331998665331998", + "executionPrice": "0.66533", + "feeGrowthGlobal0X128Delta": "510423550381407695195061911147652317", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.44533", + "poolPriceBefore": "1.0000", + "tickAfter": -8090, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "830919884399388263", + "amount1Before": "1995041008271423675", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70499", + "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1005", + "amount1Before": "1995041008271423675", + "amount1Delta": "-1000", + "executionPrice": "0.99502", + "feeGrowthGlobal0X128Delta": "680564733841876926926", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "2006018054162487463", + "amount1Before": "1995041008271423675", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.49850", + "feeGrowthGlobal0X128Delta": "1023918857334819954209013958517557896", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.25000", + "poolPriceBefore": "1.0000", + "tickAfter": -13864, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "830919884399388263", + "amount1Before": "1995041008271423675", + "amount1Delta": "-585786437626904951", + "executionPrice": "0.70499", + "feeGrowthGlobal0X128Delta": "424121077477644648929101317621422688", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "1165774985123750584", + "amount1Before": "1995041008271423675", + "amount1Delta": "-735088935932648267", + "executionPrice": "0.63056", + "feeGrowthGlobal0X128Delta": "595039006852697554786973994761078087", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "1995041008271423675", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "3.4026e+38", + "poolPriceBefore": "1.0000", + "tickAfter": 887271, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "0", + "poolBalance1": "1995041008271423675", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "0", + "amount0Delta": "0", + "amount1Before": "1995041008271423675", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; diff --git a/lib/v3-core/test/shared/checkObservationEquals.ts b/lib/v3-core/test/shared/checkObservationEquals.ts new file mode 100644 index 0000000..744116c --- /dev/null +++ b/lib/v3-core/test/shared/checkObservationEquals.ts @@ -0,0 +1,38 @@ +import { BigNumber, BigNumberish } from 'ethers' +import { expect } from './expect' + +// helper function because we cannot do a simple deep equals with the +// observation result object returned from ethers because it extends array +export default function checkObservationEquals( + { + tickCumulative, + blockTimestamp, + initialized, + secondsPerLiquidityCumulativeX128, + }: { + tickCumulative: BigNumber + secondsPerLiquidityCumulativeX128: BigNumber + initialized: boolean + blockTimestamp: number + }, + expected: { + tickCumulative: BigNumberish + secondsPerLiquidityCumulativeX128: BigNumberish + initialized: boolean + blockTimestamp: number + } +) { + expect( + { + initialized, + blockTimestamp, + tickCumulative: tickCumulative.toString(), + secondsPerLiquidityCumulativeX128: secondsPerLiquidityCumulativeX128.toString(), + }, + `observation is equivalent` + ).to.deep.eq({ + ...expected, + tickCumulative: expected.tickCumulative.toString(), + secondsPerLiquidityCumulativeX128: expected.secondsPerLiquidityCumulativeX128.toString(), + }) +} diff --git a/lib/v3-core/test/shared/expect.ts b/lib/v3-core/test/shared/expect.ts new file mode 100644 index 0000000..ac8f19b --- /dev/null +++ b/lib/v3-core/test/shared/expect.ts @@ -0,0 +1,8 @@ +import { expect, use } from 'chai' +import { solidity } from 'ethereum-waffle' +import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' + +use(solidity) +use(jestSnapshotPlugin()) + +export { expect } diff --git a/lib/v3-core/test/shared/fixtures.ts b/lib/v3-core/test/shared/fixtures.ts new file mode 100644 index 0000000..11c84bb --- /dev/null +++ b/lib/v3-core/test/shared/fixtures.ts @@ -0,0 +1,92 @@ +import { BigNumber } from 'ethers' +import { ethers } from 'hardhat' +import { MockTimeUniswapV3Pool } from '../../typechain/MockTimeUniswapV3Pool' +import { TestERC20 } from '../../typechain/TestERC20' +import { UniswapV3Factory } from '../../typechain/UniswapV3Factory' +import { TestUniswapV3Callee } from '../../typechain/TestUniswapV3Callee' +import { TestUniswapV3Router } from '../../typechain/TestUniswapV3Router' +import { MockTimeUniswapV3PoolDeployer } from '../../typechain/MockTimeUniswapV3PoolDeployer' + +import { Fixture } from 'ethereum-waffle' + +interface FactoryFixture { + factory: UniswapV3Factory +} + +async function factoryFixture(): Promise { + const factoryFactory = await ethers.getContractFactory('UniswapV3Factory') + const factory = (await factoryFactory.deploy()) as UniswapV3Factory + return { factory } +} + +interface TokensFixture { + token0: TestERC20 + token1: TestERC20 + token2: TestERC20 +} + +async function tokensFixture(): Promise { + const tokenFactory = await ethers.getContractFactory('TestERC20') + const tokenA = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 + const tokenB = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 + const tokenC = (await tokenFactory.deploy(BigNumber.from(2).pow(255))) as TestERC20 + + const [token0, token1, token2] = [tokenA, tokenB, tokenC].sort((tokenA, tokenB) => + tokenA.address.toLowerCase() < tokenB.address.toLowerCase() ? -1 : 1 + ) + + return { token0, token1, token2 } +} + +type TokensAndFactoryFixture = FactoryFixture & TokensFixture + +interface PoolFixture extends TokensAndFactoryFixture { + swapTargetCallee: TestUniswapV3Callee + swapTargetRouter: TestUniswapV3Router + createPool( + fee: number, + tickSpacing: number, + firstToken?: TestERC20, + secondToken?: TestERC20 + ): Promise +} + +// Monday, October 5, 2020 9:00:00 AM GMT-05:00 +export const TEST_POOL_START_TIME = 1601906400 + +export const poolFixture: Fixture = async function (): Promise { + const { factory } = await factoryFixture() + const { token0, token1, token2 } = await tokensFixture() + + const MockTimeUniswapV3PoolDeployerFactory = await ethers.getContractFactory('MockTimeUniswapV3PoolDeployer') + const MockTimeUniswapV3PoolFactory = await ethers.getContractFactory('MockTimeUniswapV3Pool') + + const calleeContractFactory = await ethers.getContractFactory('TestUniswapV3Callee') + const routerContractFactory = await ethers.getContractFactory('TestUniswapV3Router') + + const swapTargetCallee = (await calleeContractFactory.deploy()) as TestUniswapV3Callee + const swapTargetRouter = (await routerContractFactory.deploy()) as TestUniswapV3Router + + return { + token0, + token1, + token2, + factory, + swapTargetCallee, + swapTargetRouter, + createPool: async (fee, tickSpacing, firstToken = token0, secondToken = token1) => { + const mockTimePoolDeployer = (await MockTimeUniswapV3PoolDeployerFactory.deploy()) as MockTimeUniswapV3PoolDeployer + const tx = await mockTimePoolDeployer.deploy( + factory.address, + firstToken.address, + secondToken.address, + fee, + tickSpacing + ) + + const receipt = await tx.wait() + const poolAddress = receipt.events?.[0].args?.pool as string + return MockTimeUniswapV3PoolFactory.attach(poolAddress) as MockTimeUniswapV3Pool + }, + } +} diff --git a/lib/v3-core/test/shared/format.ts b/lib/v3-core/test/shared/format.ts new file mode 100644 index 0000000..8d23da5 --- /dev/null +++ b/lib/v3-core/test/shared/format.ts @@ -0,0 +1,10 @@ +import { Decimal } from 'decimal.js' +import { BigNumberish } from 'ethers' + +export function formatTokenAmount(num: BigNumberish): string { + return new Decimal(num.toString()).dividedBy(new Decimal(10).pow(18)).toPrecision(5) +} + +export function formatPrice(price: BigNumberish): string { + return new Decimal(price.toString()).dividedBy(new Decimal(2).pow(96)).pow(2).toPrecision(5) +} diff --git a/lib/v3-core/test/shared/snapshotGasCost.ts b/lib/v3-core/test/shared/snapshotGasCost.ts new file mode 100644 index 0000000..5a606d2 --- /dev/null +++ b/lib/v3-core/test/shared/snapshotGasCost.ts @@ -0,0 +1,27 @@ +import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider' +import { expect } from './expect' +import { Contract, BigNumber, ContractTransaction } from 'ethers' + +export default async function snapshotGasCost( + x: + | TransactionResponse + | Promise + | ContractTransaction + | Promise + | TransactionReceipt + | Promise + | BigNumber + | Contract + | Promise +): Promise { + const resolved = await x + if ('deployTransaction' in resolved) { + const receipt = await resolved.deployTransaction.wait() + expect(receipt.gasUsed.toNumber()).toMatchSnapshot() + } else if ('wait' in resolved) { + const waited = await resolved.wait() + expect(waited.gasUsed.toNumber()).toMatchSnapshot() + } else if (BigNumber.isBigNumber(resolved)) { + expect(resolved.toNumber()).toMatchSnapshot() + } +} diff --git a/lib/v3-core/test/shared/utilities.ts b/lib/v3-core/test/shared/utilities.ts new file mode 100644 index 0000000..098149f --- /dev/null +++ b/lib/v3-core/test/shared/utilities.ts @@ -0,0 +1,258 @@ +import bn from 'bignumber.js' +import { BigNumber, BigNumberish, constants, Contract, ContractTransaction, utils, Wallet } from 'ethers' +import { TestUniswapV3Callee } from '../../typechain/TestUniswapV3Callee' +import { TestUniswapV3Router } from '../../typechain/TestUniswapV3Router' +import { MockTimeUniswapV3Pool } from '../../typechain/MockTimeUniswapV3Pool' +import { TestERC20 } from '../../typechain/TestERC20' + +export const MaxUint128 = BigNumber.from(2).pow(128).sub(1) + +export const getMinTick = (tickSpacing: number) => Math.ceil(-887272 / tickSpacing) * tickSpacing +export const getMaxTick = (tickSpacing: number) => Math.floor(887272 / tickSpacing) * tickSpacing +export const getMaxLiquidityPerTick = (tickSpacing: number) => + BigNumber.from(2) + .pow(128) + .sub(1) + .div((getMaxTick(tickSpacing) - getMinTick(tickSpacing)) / tickSpacing + 1) + +export const MIN_SQRT_RATIO = BigNumber.from('4295128739') +export const MAX_SQRT_RATIO = BigNumber.from('1461446703485210103287273052203988822378723970342') + +export enum FeeAmount { + LOW = 500, + MEDIUM = 3000, + HIGH = 10000, +} + +export const TICK_SPACINGS: { [amount in FeeAmount]: number } = { + [FeeAmount.LOW]: 10, + [FeeAmount.MEDIUM]: 60, + [FeeAmount.HIGH]: 200, +} + +export function expandTo18Decimals(n: number): BigNumber { + return BigNumber.from(n).mul(BigNumber.from(10).pow(18)) +} + +export function getCreate2Address( + factoryAddress: string, + [tokenA, tokenB]: [string, string], + fee: number, + bytecode: string +): string { + const [token0, token1] = tokenA.toLowerCase() < tokenB.toLowerCase() ? [tokenA, tokenB] : [tokenB, tokenA] + const constructorArgumentsEncoded = utils.defaultAbiCoder.encode( + ['address', 'address', 'uint24'], + [token0, token1, fee] + ) + const create2Inputs = [ + '0xff', + factoryAddress, + // salt + utils.keccak256(constructorArgumentsEncoded), + // init code. bytecode + constructor arguments + utils.keccak256(bytecode), + ] + const sanitizedInputs = `0x${create2Inputs.map((i) => i.slice(2)).join('')}` + return utils.getAddress(`0x${utils.keccak256(sanitizedInputs).slice(-40)}`) +} + +bn.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 }) + +// returns the sqrt price as a 64x96 +export function encodePriceSqrt(reserve1: BigNumberish, reserve0: BigNumberish): BigNumber { + return BigNumber.from( + new bn(reserve1.toString()) + .div(reserve0.toString()) + .sqrt() + .multipliedBy(new bn(2).pow(96)) + .integerValue(3) + .toString() + ) +} + +export function getPositionKey(address: string, lowerTick: number, upperTick: number): string { + return utils.keccak256(utils.solidityPack(['address', 'int24', 'int24'], [address, lowerTick, upperTick])) +} + +export type SwapFunction = ( + amount: BigNumberish, + to: Wallet | string, + sqrtPriceLimitX96?: BigNumberish +) => Promise +export type SwapToPriceFunction = (sqrtPriceX96: BigNumberish, to: Wallet | string) => Promise +export type FlashFunction = ( + amount0: BigNumberish, + amount1: BigNumberish, + to: Wallet | string, + pay0?: BigNumberish, + pay1?: BigNumberish +) => Promise +export type MintFunction = ( + recipient: string, + tickLower: BigNumberish, + tickUpper: BigNumberish, + liquidity: BigNumberish +) => Promise +export interface PoolFunctions { + swapToLowerPrice: SwapToPriceFunction + swapToHigherPrice: SwapToPriceFunction + swapExact0For1: SwapFunction + swap0ForExact1: SwapFunction + swapExact1For0: SwapFunction + swap1ForExact0: SwapFunction + flash: FlashFunction + mint: MintFunction +} +export function createPoolFunctions({ + swapTarget, + token0, + token1, + pool, +}: { + swapTarget: TestUniswapV3Callee + token0: TestERC20 + token1: TestERC20 + pool: MockTimeUniswapV3Pool +}): PoolFunctions { + async function swapToSqrtPrice( + inputToken: Contract, + targetPrice: BigNumberish, + to: Wallet | string + ): Promise { + const method = inputToken === token0 ? swapTarget.swapToLowerSqrtPrice : swapTarget.swapToHigherSqrtPrice + + await inputToken.approve(swapTarget.address, constants.MaxUint256) + + const toAddress = typeof to === 'string' ? to : to.address + + return method(pool.address, targetPrice, toAddress) + } + + async function swap( + inputToken: Contract, + [amountIn, amountOut]: [BigNumberish, BigNumberish], + to: Wallet | string, + sqrtPriceLimitX96?: BigNumberish + ): Promise { + const exactInput = amountOut === 0 + + const method = + inputToken === token0 + ? exactInput + ? swapTarget.swapExact0For1 + : swapTarget.swap0ForExact1 + : exactInput + ? swapTarget.swapExact1For0 + : swapTarget.swap1ForExact0 + + if (typeof sqrtPriceLimitX96 === 'undefined') { + if (inputToken === token0) { + sqrtPriceLimitX96 = MIN_SQRT_RATIO.add(1) + } else { + sqrtPriceLimitX96 = MAX_SQRT_RATIO.sub(1) + } + } + await inputToken.approve(swapTarget.address, constants.MaxUint256) + + const toAddress = typeof to === 'string' ? to : to.address + + return method(pool.address, exactInput ? amountIn : amountOut, toAddress, sqrtPriceLimitX96) + } + + const swapToLowerPrice: SwapToPriceFunction = (sqrtPriceX96, to) => { + return swapToSqrtPrice(token0, sqrtPriceX96, to) + } + + const swapToHigherPrice: SwapToPriceFunction = (sqrtPriceX96, to) => { + return swapToSqrtPrice(token1, sqrtPriceX96, to) + } + + const swapExact0For1: SwapFunction = (amount, to, sqrtPriceLimitX96) => { + return swap(token0, [amount, 0], to, sqrtPriceLimitX96) + } + + const swap0ForExact1: SwapFunction = (amount, to, sqrtPriceLimitX96) => { + return swap(token0, [0, amount], to, sqrtPriceLimitX96) + } + + const swapExact1For0: SwapFunction = (amount, to, sqrtPriceLimitX96) => { + return swap(token1, [amount, 0], to, sqrtPriceLimitX96) + } + + const swap1ForExact0: SwapFunction = (amount, to, sqrtPriceLimitX96) => { + return swap(token1, [0, amount], to, sqrtPriceLimitX96) + } + + const mint: MintFunction = async (recipient, tickLower, tickUpper, liquidity) => { + await token0.approve(swapTarget.address, constants.MaxUint256) + await token1.approve(swapTarget.address, constants.MaxUint256) + return swapTarget.mint(pool.address, recipient, tickLower, tickUpper, liquidity) + } + + const flash: FlashFunction = async (amount0, amount1, to, pay0?: BigNumberish, pay1?: BigNumberish) => { + const fee = await pool.fee() + if (typeof pay0 === 'undefined') { + pay0 = BigNumber.from(amount0) + .mul(fee) + .add(1e6 - 1) + .div(1e6) + .add(amount0) + } + if (typeof pay1 === 'undefined') { + pay1 = BigNumber.from(amount1) + .mul(fee) + .add(1e6 - 1) + .div(1e6) + .add(amount1) + } + return swapTarget.flash(pool.address, typeof to === 'string' ? to : to.address, amount0, amount1, pay0, pay1) + } + + return { + swapToLowerPrice, + swapToHigherPrice, + swapExact0For1, + swap0ForExact1, + swapExact1For0, + swap1ForExact0, + mint, + flash, + } +} + +export interface MultiPoolFunctions { + swapForExact0Multi: SwapFunction + swapForExact1Multi: SwapFunction +} + +export function createMultiPoolFunctions({ + inputToken, + swapTarget, + poolInput, + poolOutput, +}: { + inputToken: TestERC20 + swapTarget: TestUniswapV3Router + poolInput: MockTimeUniswapV3Pool + poolOutput: MockTimeUniswapV3Pool +}): MultiPoolFunctions { + async function swapForExact0Multi(amountOut: BigNumberish, to: Wallet | string): Promise { + const method = swapTarget.swapForExact0Multi + await inputToken.approve(swapTarget.address, constants.MaxUint256) + const toAddress = typeof to === 'string' ? to : to.address + return method(toAddress, poolInput.address, poolOutput.address, amountOut) + } + + async function swapForExact1Multi(amountOut: BigNumberish, to: Wallet | string): Promise { + const method = swapTarget.swapForExact1Multi + await inputToken.approve(swapTarget.address, constants.MaxUint256) + const toAddress = typeof to === 'string' ? to : to.address + return method(toAddress, poolInput.address, poolOutput.address, amountOut) + } + + return { + swapForExact0Multi, + swapForExact1Multi, + } +} diff --git a/lib/v3-core/tsconfig.json b/lib/v3-core/tsconfig.json new file mode 100644 index 0000000..1522f0b --- /dev/null +++ b/lib/v3-core/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "outDir": "dist", + "typeRoots": ["./typechain", "./node_modules/@types"], + "types": ["@nomiclabs/hardhat-ethers", "@nomiclabs/hardhat-waffle"] + }, + "include": ["./test"], + "files": ["./hardhat.config.ts"] +} diff --git a/lib/v3-core/yarn.lock b/lib/v3-core/yarn.lock new file mode 100644 index 0000000..d2e231b --- /dev/null +++ b/lib/v3-core/yarn.lock @@ -0,0 +1,9271 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" + integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" + integrity sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@ensdomains/ens@^0.4.4": + version "0.4.5" + resolved "https://registry.yarnpkg.com/@ensdomains/ens/-/ens-0.4.5.tgz#e0aebc005afdc066447c6e22feb4eda89a5edbfc" + integrity sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw== + dependencies: + bluebird "^3.5.2" + eth-ens-namehash "^2.0.8" + solc "^0.4.20" + testrpc "0.0.1" + web3-utils "^1.0.0-beta.31" + +"@ensdomains/resolver@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" + integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== + +"@ethereum-waffle/chai@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.2.1.tgz#5cb542b2a323adf0bc2dda00f48b0eb85944d8ab" + integrity sha512-0aG946J1+2Gg7WnEjtwPEWe+xwLTeBTy6LpCnGecosMf3YINkaf9Xv3Sd7CrXBR88ihCoUhfzfmOloMHIAQPAg== + dependencies: + "@ethereum-waffle/provider" "^3.2.1" + ethers "^5.0.0" + +"@ethereum-waffle/compiler@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.2.1.tgz#612a9056285a94ce28eb57b895770ad10e438bf9" + integrity sha512-URSsbTp4g8HPHAaA4KiAD6Aya9WPx/TULfOr+YpjCJ6YWXqE9wwi3ubf9qJUQxu6W6PsiczBaQhVhpI9RLoVUA== + dependencies: + "@resolver-engine/imports" "^0.3.3" + "@resolver-engine/imports-fs" "^0.3.3" + "@types/mkdirp" "^0.5.2" + "@types/node-fetch" "^2.5.5" + ethers "^5.0.1" + mkdirp "^0.5.1" + node-fetch "^2.6.0" + solc "^0.6.3" + +"@ethereum-waffle/ens@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.2.1.tgz#9f369112d62f7aa88d010be4d133b6d0f5e8c492" + integrity sha512-dXv/Mb8EgEYOKv2jjmkFNFCmSjNv8nPk1Gaegc0J/KXWuTU6CBOhWet7YS5joGO8ORK21MvN2qVgcQj+FYw0Dw== + dependencies: + "@ensdomains/ens" "^0.4.4" + "@ensdomains/resolver" "^0.2.4" + ethers "^5.0.1" + +"@ethereum-waffle/mock-contract@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.2.1.tgz#bf5f63f61c9749eb3270108893a88ff161e68f58" + integrity sha512-39GMp/IqsHF+3j3XK38cWA+nX7Q6ABfMsYkuAjtfpTguTFQKXx2C1/VJZwGOyb4de2pl4bssmN37VEraB3NWbQ== + dependencies: + "@ethersproject/abi" "^5.0.1" + ethers "^5.0.1" + +"@ethereum-waffle/provider@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.2.1.tgz#d84c0603936f09afa69ecb671d56f527e9818e71" + integrity sha512-doG18hThqldsYcZIIO0YoiwV+ERx0dCVY6bkg4FKZtoymNelf15zNycb881c6QD9RnLuz6A2Jp9lmnrAD+IvYQ== + dependencies: + "@ethereum-waffle/ens" "^3.2.1" + ethers "^5.0.1" + ganache-core "^2.10.2" + patch-package "^6.2.2" + postinstall-postinstall "^2.1.0" + +"@ethereumjs/block@^3.2.0", "@ethereumjs/block@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.2.1.tgz#c24c345e6dd6299efa4bed40979280b7dda96d3a" + integrity sha512-FCxo5KwwULne2A2Yuae4iaGGqSsRjwzXOlDhGalOFiBbLfP3hE04RHaHGw4c8vh1PfOrLauwi0dQNUBkOG3zIA== + dependencies: + "@ethereumjs/common" "^2.2.0" + "@ethereumjs/tx" "^3.1.3" + ethereumjs-util "^7.0.10" + merkle-patricia-tree "^4.1.0" + +"@ethereumjs/blockchain@^5.2.1": + version "5.2.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.2.1.tgz#83ed83647667265f1666f111caf065ef9d1e82b5" + integrity sha512-+hshP2qSOOFsiYvZCbaDQFG7jYTWafE8sfBi+pAsdhAHfP7BN7VLyob7qoQISgwS1s7NTR4c4+2t/woU9ahItw== + dependencies: + "@ethereumjs/block" "^3.2.0" + "@ethereumjs/common" "^2.2.0" + "@ethereumjs/ethash" "^1.0.0" + debug "^2.2.0" + ethereumjs-util "^7.0.9" + level-mem "^5.0.1" + lru-cache "^5.1.1" + rlp "^2.2.4" + semaphore-async-await "^1.5.1" + +"@ethereumjs/common@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.2.0.tgz#850a3e3e594ee707ad8d44a11e8152fb62450535" + integrity sha512-PyQiTG00MJtBRkJmv46ChZL8u2XWxNBeAthznAUIUiefxPAXjbkuiCZOuncgJS34/XkMbNc9zMt/PlgKRBElig== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.0.9" + +"@ethereumjs/ethash@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.0.0.tgz#4e77f85b37be1ade5393e8719bdabac3e796ddaa" + integrity sha512-iIqnGG6NMKesyOxv2YctB2guOVX18qMAWlj3QlZyrc+GqfzLqoihti+cVNQnyNxr7eYuPdqwLQOFuPe6g/uKjw== + dependencies: + "@types/levelup" "^4.3.0" + buffer-xor "^2.0.1" + ethereumjs-util "^7.0.7" + miller-rabin "^4.0.0" + +"@ethereumjs/tx@^3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.1.3.tgz#0e4b0ccec2f12b1f0bbbb0e7542dd79d9ec25d87" + integrity sha512-DJBu6cbwYtiPTFeCUR8DF5p+PF0jxs+0rALJZiEcTz2tiRPIEkM72GEbrkGuqzENLCzBrJHT43O0DxSYTqeo+g== + dependencies: + "@ethereumjs/common" "^2.2.0" + ethereumjs-util "^7.0.10" + +"@ethereumjs/vm@^5.3.2": + version "5.3.2" + resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.3.2.tgz#b4d83a3d50a7ad22d6d412cc21bbde221b3e2871" + integrity sha512-QmCUQrW6xbhgEbQh9njue4kAJdM056C+ytBFUTF/kDYa3kNDm4Qxp9HUyTlt1OCSXvDhws0qqlh8+q+pmXpN7g== + dependencies: + "@ethereumjs/block" "^3.2.1" + "@ethereumjs/blockchain" "^5.2.1" + "@ethereumjs/common" "^2.2.0" + "@ethereumjs/tx" "^3.1.3" + async-eventemitter "^0.2.4" + core-js-pure "^3.0.1" + debug "^2.2.0" + ethereumjs-util "^7.0.10" + functional-red-black-tree "^1.0.1" + mcl-wasm "^0.7.1" + merkle-patricia-tree "^4.1.0" + rustbn.js "~0.2.0" + util.promisify "^1.0.1" + +"@ethersproject/abi@5.0.0-beta.153": + version "5.0.0-beta.153" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" + integrity sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg== + dependencies: + "@ethersproject/address" ">=5.0.0-beta.128" + "@ethersproject/bignumber" ">=5.0.0-beta.130" + "@ethersproject/bytes" ">=5.0.0-beta.129" + "@ethersproject/constants" ">=5.0.0-beta.128" + "@ethersproject/hash" ">=5.0.0-beta.128" + "@ethersproject/keccak256" ">=5.0.0-beta.127" + "@ethersproject/logger" ">=5.0.0-beta.129" + "@ethersproject/properties" ">=5.0.0-beta.131" + "@ethersproject/strings" ">=5.0.0-beta.130" + +"@ethersproject/abi@5.0.9", "@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.0.5": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.9.tgz#738c1c557e56d8f395a5a27caef9b0449bc85a10" + integrity sha512-ily2OufA2DTrxkiHQw5GqbkMSnNKuwZBqKsajtT0ERhZy1r9w2CpW1bmtRMIGzaqQxCdn/GEoFogexk72cBBZQ== + dependencies: + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/abi@^5.1.2": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.5.0.tgz#fb52820e22e50b854ff15ce1647cc508d6660613" + integrity sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w== + dependencies: + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/hash" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/abstract-provider@5.0.7", "@ethersproject/abstract-provider@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.0.7.tgz#04ee3bfe43323384e7fecf6c774975b8dec4bdc9" + integrity sha512-NF16JGn6M0zZP5ZS8KtDL2Rh7yHxZbUjBIHLNHMm/0X0BephhjUWy8jqs/Zks6kDJRzNthgmPVy41Ec0RYWPYA== + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/networks" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/web" "^5.0.6" + +"@ethersproject/abstract-provider@^5.5.0": + version "5.5.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" + integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/networks" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/transactions" "^5.5.0" + "@ethersproject/web" "^5.5.0" + +"@ethersproject/abstract-signer@5.0.9", "@ethersproject/abstract-signer@^5.0.4", "@ethersproject/abstract-signer@^5.0.6": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.0.9.tgz#238ddc06031aeb9dfceee2add965292d7dd1acbf" + integrity sha512-CM5UNmXQaA03MyYARFDDRjHWBxujO41tVle7glf5kHcQsDDULgqSVpkliLJMtPzZjOKFeCVZBHybTZDEZg5zzg== + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/abstract-signer@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" + integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== + dependencies: + "@ethersproject/abstract-provider" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + +"@ethersproject/address@5.0.8", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.8.tgz#0c551659144a5a7643c6bea337149d410825298f" + integrity sha512-V87DHiZMZR6hmFYmoGaHex0D53UEbZpW75uj8AqPbjYUmi65RB4N2LPRcJXuWuN2R0Y2CxkvW6ArijWychr5FA== + dependencies: + "@ethersproject/bignumber" "^5.0.10" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/rlp" "^5.0.3" + +"@ethersproject/address@^5.0.2": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" + integrity sha512-rfWQR12eHn2cpstCFS4RF7oGjfbkZb0oqep+BfrT+gWEGWG2IowJvIsacPOvzyS1jhNF4MQ4BS59B04Mbovteg== + dependencies: + "@ethersproject/bignumber" "^5.1.0" + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/keccak256" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + "@ethersproject/rlp" "^5.1.0" + +"@ethersproject/address@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" + integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/rlp" "^5.5.0" + +"@ethersproject/base64@5.0.6", "@ethersproject/base64@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.0.6.tgz#26311ebf29ea3d0b9c300ccf3e1fdc44b7481516" + integrity sha512-HwrGn8YMiUf7bcdVvB4NJ+eWT0BtEFpDtrYxVXEbR7p/XBSJjwiR7DEggIiRvxbualMKg+EZijQWJ3az2li0uw== + dependencies: + "@ethersproject/bytes" "^5.0.4" + +"@ethersproject/base64@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" + integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + +"@ethersproject/basex@5.0.6", "@ethersproject/basex@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.0.6.tgz#ab95c32e48288a3d868726463506641cb1e9fb6b" + integrity sha512-Y/8dowRxBF3bsKkqEp7XN4kcFFQ0o5xxP1YyopfqkXejaOEGiD7ToQdQ0pIZpAJ5GreW56oFOTDDSO6ZcUCNYg== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/bignumber@5.0.12", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.0.8": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.12.tgz#fe4a78667d7cb01790f75131147e82d6ea7e7cba" + integrity sha512-mbFZjwthx6vFlHG9owXP/C5QkNvsA+xHpDCkPPPdG2n1dS9AmZAL5DI0InNLid60rQWL3MXpEl19tFmtL7Q9jw== + dependencies: + "@ethersproject/bytes" "^5.0.8" + "@ethersproject/logger" "^5.0.5" + bn.js "^4.4.0" + +"@ethersproject/bignumber@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.1.1.tgz#84812695253ccbc639117f7ac49ee1529b68e637" + integrity sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig== + dependencies: + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + bn.js "^4.4.0" + +"@ethersproject/bignumber@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" + integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + bn.js "^4.11.9" + +"@ethersproject/bytes@5.0.8", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.8.tgz#cf1246a6a386086e590063a4602b1ffb6cc43db1" + integrity sha512-O+sJNVGzzuy51g+EMK8BegomqNIg+C2RO6vOt0XP6ac4o4saiq69FnjlsrNslaiMFVO7qcEHBsWJ9hx1tj1lMw== + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/bytes@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.1.0.tgz#55dfa9c4c21df1b1b538be3accb50fb76d5facfd" + integrity sha512-sGTxb+LVjFxJcJeUswAIK6ncgOrh3D8c192iEJd7mLr95V6du119rRfYT/b87WPkZ5I3gRBUYIYXtdgCWACe8g== + dependencies: + "@ethersproject/logger" "^5.1.0" + +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/constants@5.0.7", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.7.tgz#44ff979e5781b17c8c6901266896c3ee745f4e7e" + integrity sha512-cbQK1UpE4hamB52Eg6DLhJoXeQ1plSzekh5Ujir1xdREdwdsZPPXKczkrWqBBR0KyywJZHN/o/hj0w8j7scSGg== + dependencies: + "@ethersproject/bignumber" "^5.0.7" + +"@ethersproject/constants@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" + integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + +"@ethersproject/contracts@5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.0.8.tgz#71d3ba16853a1555be2e161a6741df186f81c73b" + integrity sha512-PecBL4vnsrpuks2lzzkRsOts8csJy338HNDKDIivbFmx92BVzh3ohOOv3XsoYPSXIHQvobF959W+aSk3RCZL/g== + dependencies: + "@ethersproject/abi" "^5.0.5" + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/hash@5.0.9", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.0.9.tgz#81252a848185b584aa600db4a1a68cad9229a4d4" + integrity sha512-e8/i2ZDeGSgCxXT0vocL54+pMbw5oX5fNjb2E3bAIvdkh5kH29M7zz1jHu1QDZnptIuvCZepIbhUH8lxKE2/SQ== + dependencies: + "@ethersproject/abstract-signer" "^5.0.6" + "@ethersproject/address" "^5.0.5" + "@ethersproject/bignumber" "^5.0.8" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.4" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/hash@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" + integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== + dependencies: + "@ethersproject/abstract-signer" "^5.5.0" + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/hdnode@5.0.7", "@ethersproject/hdnode@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.0.7.tgz#c7bce94a337ea65e37c46bab09a83e1c1a555d99" + integrity sha512-89tphqlji4y/LNE1cSaMQ3hrBtJ4lO1qWGi2hn54LiHym85DTw+zAKbA8QgmdSdJDLGR/kc9VHaIPQ+vZQ2LkQ== + dependencies: + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/basex" "^5.0.3" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/pbkdf2" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/wordlists" "^5.0.4" + +"@ethersproject/json-wallets@5.0.9", "@ethersproject/json-wallets@^5.0.6": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.0.9.tgz#2e1708c2854c4ab764e35920bd1f44c948b95434" + integrity sha512-EWuFvJd8nu90dkmJwmJddxOYCvFvMkKBsZi8rxTme2XEZsHKOFnybVkoL23u7ZtApuEfTKmVcR2PTwgZwqDsKw== + dependencies: + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hdnode" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/pbkdf2" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.0.6", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.6.tgz#5b5ba715ef1be86efde5c271f896fa0daf0e1efe" + integrity sha512-eJ4Id/i2rwrf5JXEA7a12bG1phuxjj47mPZgDUbttuNBodhSuZF2nEO5QdpaRjmlphQ8Kt9PNqY/z7lhtJptZg== + dependencies: + "@ethersproject/bytes" "^5.0.4" + js-sha3 "0.5.7" + +"@ethersproject/keccak256@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.1.0.tgz#fdcd88fb13bfef4271b225cdd8dec4d315c8e60e" + integrity sha512-vrTB1W6AEYoadww5c9UyVJ2YcSiyIUTNDRccZIgwTmFFoSHwBtcvG1hqy9RzJ1T0bMdATbM9Hfx2mJ6H0i7Hig== + dependencies: + "@ethersproject/bytes" "^5.1.0" + js-sha3 "0.5.7" + +"@ethersproject/keccak256@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" + integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== + dependencies: + "@ethersproject/bytes" "^5.5.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.0.8", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.0.8.tgz#135c1903d35c878265f3cbf2b287042c4c20d5d4" + integrity sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A== + +"@ethersproject/logger@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" + integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/networks@5.0.6", "@ethersproject/networks@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.0.6.tgz#4d6586bbebfde1c027504ebf6dfb783b29c3803a" + integrity sha512-2Cg1N5109zzFOBfkyuPj+FfF7ioqAsRffmybJ2lrsiB5skphIAE72XNSCs4fqktlf+rwSh/5o/UXRjXxvSktZw== + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/networks@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.0.tgz#babec47cab892c51f8dd652ce7f2e3e14283981a" + integrity sha512-KWfP3xOnJeF89Uf/FCJdV1a2aDJe5XTN2N52p4fcQ34QhDqQFkgQKZ39VGtiqUgHcLI8DfT0l9azC3KFTunqtA== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/pbkdf2@5.0.6", "@ethersproject/pbkdf2@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.0.6.tgz#105dbfb08cd5fcf33869b42bfdc35a3ebd978cbd" + integrity sha512-CUYciSxR/AaCoKMJk3WUW+BDhR41G3C+O9lOeZ4bR1wDhLKL2Z8p0ciF5XDEiVbmI4CToW6boVKybeVMdngRrg== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/sha2" "^5.0.3" + +"@ethersproject/properties@5.0.6", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.0.4": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.6.tgz#44d82aaa294816fd63333e7def42426cf0e87b3b" + integrity sha512-a9DUMizYhJ0TbtuDkO9iYlb2CDlpSKqGPDr+amvlZhRspQ6jbl5Eq8jfu4SCcGlcfaTbguJmqGnyOGn1EFt6xA== + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/properties@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" + integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/providers@5.0.17": + version "5.0.17" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.0.17.tgz#f380e7831149e24e7a1c6c9b5fb1d6dfc729d024" + integrity sha512-bJnvs5X7ttU5x2ekGJYG7R3Z+spZawLFfR0IDsbaMDLiCwZOyrgk+VTBU7amSFLT0WUhWFv8WwSUB+AryCQG1Q== + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/basex" "^5.0.3" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/networks" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/rlp" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/web" "^5.0.6" + bech32 "1.1.4" + ws "7.2.3" + +"@ethersproject/random@5.0.6", "@ethersproject/random@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.0.6.tgz#9be80a1065f2b8e6f321dccb3ebeb4886cac9ea4" + integrity sha512-8nsVNaZvZ9OD5NXfzE4mmz8IH/1DYJbAR95xpRxZkIuNmfn6QlMp49ccJYZWGhs6m0Zj2+FXjx3pzXfYlo9/dA== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/rlp@5.0.6", "@ethersproject/rlp@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.6.tgz#29f9097348a3c330811997433b7df89ab51cd644" + integrity sha512-M223MTaydfmQSsvqAl0FJZDYFlSqt6cgbhnssLDwqCKYegAHE16vrFyo+eiOapYlt32XAIJm0BXlqSunULzZuQ== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/rlp@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.1.0.tgz#700f4f071c27fa298d3c1d637485fefe919dd084" + integrity sha512-vDTyHIwNPrecy55gKGZ47eJZhBm8LLBxihzi5ou+zrSvYTpkSTWRcKUlXFDFQVwfWB+P5PGyERAdiDEI76clxw== + dependencies: + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + +"@ethersproject/rlp@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" + integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/sha2@5.0.6", "@ethersproject/sha2@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.0.6.tgz#175116dc10b866a0a381f6316d094bcc510bee3c" + integrity sha512-30gypDLkfkP5gE3llqi0jEuRV8m4/nvzeqmqMxiihZ7veFQHqDaGpyFeHzFim+qGeH9fq0lgYjavLvwW69+Fkw== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + hash.js "1.1.3" + +"@ethersproject/signing-key@5.0.7", "@ethersproject/signing-key@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.7.tgz#d03bfc5f565efb962bafebf8e6965e70d1c46d31" + integrity sha512-JYndnhFPKH0daPcIjyhi+GMcw3srIHkQ40hGRe6DA0CdGrpMfgyfSYDQ2D8HL2lgR+Xm4SHfEB0qba6+sCyrvg== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + elliptic "6.5.3" + +"@ethersproject/signing-key@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" + integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.7.tgz#72a3455f47a454db2dcf363992d42e9045dc7fce" + integrity sha512-dUevKUZ06p/VMLP/+cz4QUV+lA17NixucDJfm0ioWF0B3R0Lf+6wqwPchcqiAXlxkNFGIax7WNLgGMh4CkQ8iw== + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/strings@5.0.7", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.0.7.tgz#8dc68f794c9e2901f3b75e53b2afbcb6b6c15037" + integrity sha512-a+6T80LvmXGMOOWQTZHtGGQEg1z4v8rm8oX70KNs55YtPXI/5J3LBbVf5pyqCKSlmiBw5IaepPvs5XGalRUSZQ== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/strings@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" + integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/transactions@5.0.8", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.8.tgz#3b4d7041e13b957a9c4f131e0aea9dae7b6f5a23" + integrity sha512-i7NtOXVzUe+YSU6QufzlRrI2WzHaTmULAKHJv4duIZMLqzehCBXGA9lTpFgFdqGYcQJ7vOtNFC2BB2mSjmuXqg== + dependencies: + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/rlp" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + +"@ethersproject/transactions@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" + integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== + dependencies: + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/rlp" "^5.5.0" + "@ethersproject/signing-key" "^5.5.0" + +"@ethersproject/units@5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.0.8.tgz#563325b20fe1eceff7b61857711d5e2b3f38fd09" + integrity sha512-3O4MaNHFs05vC5v2ZGqVFVWtO1WyqFejO78M7Qh16njo282aoMlENtVI6cn2B36zOLFXRvYt2pYx6xCG53qKzg== + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/wallet@5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.0.9.tgz#976c7d950489c40308d676869d24e59ab7b82ad1" + integrity sha512-GfpQF56PO/945SJq7Wdg5F5U6wkxaDgkAzcgGbCW6Joz8oW8MzKItkvYCzMh+j/8gJMzFncsuqX4zg2gq3J6nQ== + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/hdnode" "^5.0.4" + "@ethersproject/json-wallets" "^5.0.6" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/wordlists" "^5.0.4" + +"@ethersproject/web@5.0.11", "@ethersproject/web@^5.0.6": + version "5.0.11" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.0.11.tgz#d47da612b958b4439e415782a53c8f8461522d68" + integrity sha512-x03ihbPoN1S8Gsh9WSwxkYxUIumLi02ZEKJku1C43sxBfe+mdprWyvujzYlpuoRNfWRgNhdRDKMP8JbG6MwNGA== + dependencies: + "@ethersproject/base64" "^5.0.3" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/web@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.0.tgz#0e5bb21a2b58fb4960a705bfc6522a6acf461e28" + integrity sha512-BEgY0eL5oH4mAo37TNYVrFeHsIXLRxggCRG/ksRIxI2X5uj5IsjGmcNiRN/VirQOlBxcUhCgHhaDLG4m6XAVoA== + dependencies: + "@ethersproject/base64" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/wordlists@5.0.7", "@ethersproject/wordlists@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.0.7.tgz#4e5ad38cfbef746b196a3290c0d41696eb7ab468" + integrity sha512-ZjQtYxm41FmHfYgpkdQG++EDcBPQWv9O6FfP6NndYRVaXaQZh6eq3sy7HQP8zCZ8dznKgy6ZyKECS8qdvnGHwA== + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@jest/console@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" + integrity sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^26.6.2" + jest-util "^26.6.2" + slash "^3.0.0" + +"@jest/test-result@^26.5.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" + integrity sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ== + dependencies: + "@jest/console" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/types@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" + integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + +"@nomiclabs/hardhat-ethers@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" + integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== + +"@nomiclabs/hardhat-etherscan@^2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.8.tgz#e206275e96962cd15e5ba9148b44388bc922d8c2" + integrity sha512-0+rj0SsZotVOcTLyDOxnOc3Gulo8upo0rsw/h+gBPcmtj91YqYJNhdARHoBxOhhE8z+5IUQPx+Dii04lXT14PA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^5.0.2" + debug "^4.1.1" + fs-extra "^7.0.1" + node-fetch "^2.6.0" + semver "^6.3.0" + +"@nomiclabs/hardhat-waffle@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz#5d43654fba780720c5033dea240fe14f70ef4bd2" + integrity sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ== + dependencies: + "@types/sinon-chai" "^3.2.3" + "@types/web3" "1.0.19" + +"@resolver-engine/core@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" + integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== + dependencies: + debug "^3.1.0" + is-url "^1.2.4" + request "^2.85.0" + +"@resolver-engine/fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" + integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== + dependencies: + "@resolver-engine/core" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports-fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" + integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== + dependencies: + "@resolver-engine/fs" "^0.3.3" + "@resolver-engine/imports" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" + integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== + dependencies: + "@resolver-engine/core" "^0.3.3" + debug "^3.1.0" + hosted-git-info "^2.6.0" + path-browserify "^1.0.0" + url "^0.11.0" + +"@sentry/core@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.29.2.tgz#9e05fe197234161d57aabaf52fab336a7c520d81" + integrity sha512-7WYkoxB5IdlNEbwOwqSU64erUKH4laavPsM0/yQ+jojM76ErxlgEF0u//p5WaLPRzh3iDSt6BH+9TL45oNZeZw== + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/minimal" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/hub@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.29.2.tgz#208f10fe6674695575ad74182a1151f71d6df00a" + integrity sha512-LaAIo2hwUk9ykeh9RF0cwLy6IRw+DjEee8l1HfEaDFUM6TPGlNNGObMJNXb9/95jzWp7jWwOpQjoIE3jepdQJQ== + dependencies: + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/minimal@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.29.2.tgz#420bebac8d03d30980fdb05c72d7b253d8aa541b" + integrity sha512-0aINSm8fGA1KyM7PavOBe1GDZDxrvnKt+oFnU0L+bTcw8Lr+of+v6Kwd97rkLRNOLw621xP076dL/7LSIzMuhw== + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/types" "5.29.2" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.29.2.tgz#f0f0b4b2be63c9ddd702729fab998cead271dff1" + integrity sha512-98m1ZejmJgA+eiz6jEFyYYfp6kJZQnx6d6KrJDMxGfss4YTmmJY57bE4xStnjjk7WINDGzlCiHuk+wJFMBjuoA== + dependencies: + "@sentry/core" "5.29.2" + "@sentry/hub" "5.29.2" + "@sentry/tracing" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.29.2.tgz#6012788547d2ab7893799d82c4941bda145dcd47" + integrity sha512-iumYbVRpvoU3BUuIooxibydeaOOjl5ysc+mzsqhRs2NGW/C3uKAsFXdvyNfqt3bxtRQwJEhwJByLP2u3pLThpw== + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/minimal" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/types@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.29.2.tgz#ac87383df1222c2d9b9f8f9ed7a6b86ea41a098a" + integrity sha512-dM9wgt8wy4WRty75QkqQgrw9FV9F+BOMfmc0iaX13Qos7i6Qs2Q0dxtJ83SoR4YGtW8URaHzlDtWlGs5egBiMA== + +"@sentry/utils@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.29.2.tgz#99a5cdda2ea19d34a41932f138d470adcb3ee673" + integrity sha512-nEwQIDjtFkeE4k6yIk4Ka5XjGRklNLThWLs2xfXlL7uwrYOH2B9UBBOOIRUraBm/g/Xrra3xsam/kRxuiwtXZQ== + dependencies: + "@sentry/types" "5.29.2" + tslib "^1.9.3" + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@solidity-parser/parser@^0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.10.1.tgz#d3680d1ebebed21eee67f58a41eb92175204f0c7" + integrity sha512-tHDPCRMEBFDxBz5rioQRoKgOQGa/K2digdfR68cd5vO6IufAqoNt1sfjssQDf2KPqHPftICBQOqlcu0w5/Jisg== + +"@solidity-parser/parser@^0.11.0": + version "0.11.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.11.1.tgz#fa840af64840c930f24a9c82c08d4a092a068add" + integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ== + +"@solidity-parser/parser@^0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.8.2.tgz#a6a5e93ac8dca6884a99a532f133beba59b87b69" + integrity sha512-8LySx3qrNXPgB5JiULfG10O3V7QTxI/TLzSw5hFQhXWSkVxZBAv4rZQ0sYgLEbc8g3L2lmnujj1hKul38Eu5NQ== + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@typechain/ethers-v5@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-4.0.0.tgz#2a8be5e108d23f3b8e6354d1618fdc2abcb00b07" + integrity sha512-Rw4WHPIuwTXWcHfmn9ICQISQhmJa6Ug5IjqPYLpsKqlED2L4W2JgQ6S9hYt4IKVmT//1yxIxD+iaa5tSQEEx1A== + +"@types/abstract-leveldown@*": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz#3c7750d0186b954c7f2d2f6acc8c3c7ba0c3412e" + integrity sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ== + +"@types/babel__traverse@^7.0.4": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" + integrity sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg== + dependencies: + "@babel/types" "^7.3.0" + +"@types/bn.js@*", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + dependencies: + "@types/node" "*" + +"@types/chai@*", "@types/chai@^4.2.6": + version "4.2.14" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193" + integrity sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ== + +"@types/graceful-fs@^4.1.2": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.4.tgz#4ff9f641a7c6d1a3508ff88bc3141b152772e753" + integrity sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" + integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" + integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/levelup@^4.3.0": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.1.tgz#7a53b9fd510716e11b2065332790fdf5f9b950b9" + integrity sha512-n//PeTpbHLjMLTIgW5B/g06W/6iuTBHuvUka2nFL9APMSVMNe2r4enADfu3CIE9IyV9E+uquf9OEQQqrDeg24A== + dependencies: + "@types/abstract-leveldown" "*" + "@types/node" "*" + +"@types/lru-cache@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03" + integrity sha512-RaE0B+14ToE4l6UqdarKPnXwVDuigfFv+5j9Dze/Nqr23yyuqdNvzcZi3xB+3Agvi5R4EOgAksfv3lXX4vBt9w== + +"@types/mkdirp@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" + integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== + dependencies: + "@types/node" "*" + +"@types/mocha@^5.2.7": + version "5.2.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" + integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== + +"@types/node-fetch@^2.5.5": + version "2.5.7" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" + integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + +"@types/node@*": + version "14.14.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae" + integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ== + +"@types/node@^12.12.6": + version "12.19.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.9.tgz#990ad687ad8b26ef6dcc34a4f69c33d40c95b679" + integrity sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q== + +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + +"@types/prettier@^2.0.0", "@types/prettier@^2.1.1": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" + integrity sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ== + +"@types/resolve@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" + integrity sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog== + dependencies: + "@types/node" "*" + +"@types/sinon-chai@^3.2.3": + version "3.2.5" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.5.tgz#df21ae57b10757da0b26f512145c065f2ad45c48" + integrity sha512-bKQqIpew7mmIGNRlxW6Zli/QVyc3zikpGzCa797B/tRnD9OtHvZ/ts8sYXV+Ilj9u3QRaUEM8xrjgd1gwm1BpQ== + dependencies: + "@types/chai" "*" + "@types/sinon" "*" + +"@types/sinon@*": + version "9.0.10" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-9.0.10.tgz#7fb9bcb6794262482859cab66d59132fca18fcf7" + integrity sha512-/faDC0erR06wMdybwI/uR8wEKV/E83T0k4sepIpB7gXuy2gzx2xiOjmztq6a2Y6rIGJ04D+6UU0VBmWy+4HEMA== + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinonjs__fake-timers@*": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" + integrity sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== + +"@types/stack-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== + +"@types/underscore@*": + version "1.10.24" + resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.10.24.tgz#dede004deed3b3f99c4db0bdb9ee21cae25befdd" + integrity sha512-T3NQD8hXNW2sRsSbLNjF/aBo18MyJlbw0lSpQHB/eZZtScPdexN4HSa8cByYwTw9Wy7KuOFr81mlDQcQQaZ79w== + +"@types/web3@1.0.19": + version "1.0.19" + resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" + integrity sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A== + dependencies: + "@types/bn.js" "*" + "@types/underscore" "*" + +"@types/yargs-parser@*": + version "20.2.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" + integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== + +"@types/yargs@^15.0.0": + version "15.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.12.tgz#6234ce3e3e3fa32c5db301a170f96a599c960d74" + integrity sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw== + dependencies: + "@types/yargs-parser" "*" + +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + +abstract-leveldown@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" + integrity sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^2.4.1, abstract-leveldown@~2.7.1: + version "2.7.2" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" + integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" + integrity sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^6.2.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" + integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +abstract-leveldown@~2.6.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" + integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@~6.2.1: + version "6.2.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" + integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +acorn-jsx@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + +acorn@^6.0.7: + version "6.4.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= + +aes-js@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +ajv@^6.10.2, ajv@^6.12.3, ajv@^6.6.1, ajv@^6.9.1: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== + +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-escapes@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" + integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== + dependencies: + type-fest "^0.11.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4@4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" + integrity sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ== + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +anymatch@^3.0.3, anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-back@^1.0.3, array-back@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" + integrity sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs= + dependencies: + typical "^2.6.0" + +array-back@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" + integrity sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw== + dependencies: + typical "^2.6.1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +asn1.js@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" + integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + safer-buffer "^2.1.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +ast-parents@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" + integrity sha1-UI/Q8F0MSHddnszaLhdEIyYejdM= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" + integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== + dependencies: + async "^2.4.0" + +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + +async@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + dependencies: + lodash "^4.17.11" + +async@^1.4.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + +async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== + dependencies: + lodash "^4.17.14" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.0.14, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + integrity sha1-zORReto1b0IgvK6KAsKzRvmlZmQ= + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + integrity sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340= + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + integrity sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8= + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + integrity sha1-8luCz33BBDPFX3BZLVdGQArCLKo= + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + integrity sha1-00dbjAPtmCQqJbSDUasYOZ01gKk= + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + integrity sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + integrity sha1-HssnaJydJVE+rbyZFKc/VAi+enY= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + integrity sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + integrity sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI= + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + integrity sha1-XsWBgnrXI/7N04HxySg5BnbkVRs= + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + integrity sha1-v22/5Dk40XNpohPKiov3S2qQqxo= + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + integrity sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + integrity sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU= + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + integrity sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4= + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + integrity sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM= + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + integrity sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E= + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + integrity sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + integrity sha1-u8UbSflk1wy42OC5ToICRs46YUE= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + integrity sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8= + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + integrity sha1-WkxYpQyclGHlZLSyo7+ryXolhNs= + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + integrity sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + integrity sha1-mXux8auWf2gtKwh2/jWNYOdlxW0= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + integrity sha1-c+s9MQypaePvnskcU3QabxV2Qj4= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + integrity sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + integrity sha1-g0yJhTvDaxrw86TF26qU/Y6sqos= + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + integrity sha1-T1SgLWzWbPkVKAAZox0xklN3yi4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + integrity sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ= + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + integrity sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM= + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + integrity sha1-rJl+YoXNGO1hdq22B9YCNErThGg= + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + integrity sha1-JM72muIcuDp/hgPa0CH1cusnj40= + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + integrity sha1-V6w1GrScrxSpfNE7CfZv3wpiXys= + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + integrity sha1-JPh11nIch2YbvZmkYi5R8U3jiqA= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + integrity sha1-1taKmfia7cRTbIGlQujdnxdG+NE= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + integrity sha1-AMHNsaynERLN8M9hJsLta0V8zbw= + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + integrity sha1-qEs0UPfp+PH2g51taH2oS7EjbY0= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + integrity sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + integrity sha1-04sS9C6nMj9yk4fxinxa4frrNek= + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + integrity sha1-KrDJx/MJj6SJB3cruBP+QejeOg4= + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + integrity sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8= + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + integrity sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g= + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-preset-env@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" + integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^3.2.6" + invariant "^2.2.2" + semver "^5.3.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babelify@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" + integrity sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU= + dependencies: + babel-core "^6.0.14" + object-assign "^4.0.0" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +backoff@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" + integrity sha1-9hbtqdPktmuMp/ynn2lXIsX44m8= + dependencies: + precond "0.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base-x@^3.0.2, base-x@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" + integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bignumber.js@^9.0.0, bignumber.js@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" + integrity sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA== + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +bip39@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235" + integrity sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA== + dependencies: + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + safe-buffer "^5.0.1" + unorm "^1.3.3" + +blakejs@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" + integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= + +bluebird@^3.5.0, bluebird@^3.5.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== + +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2: + version "5.1.3" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" + integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== + +body-parser@1.19.0, body-parser@^1.16.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.0.1, brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" + integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== + dependencies: + bn.js "^5.0.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" + integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== + dependencies: + bn.js "^5.1.1" + browserify-rsa "^4.0.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.5.3" + inherits "^2.0.4" + parse-asn1 "^5.1.5" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +browserslist@^3.2.6: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-to-arraybuffer@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" + integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer-xor@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" + integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== + dependencies: + safe-buffer "^5.1.1" + +buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +bufferutil@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.2.tgz#79f68631910f6b993d870fc77dc0a2894eb96cd5" + integrity sha512-AtnG3W6M8B2n4xDQ5R+70EXvOpnXsFYg/AK2yTZd+HQ/oxAdz+GI+DvjmhBw3L0ole+LJ0ngqY4JMbDzkfNzhA== + dependencies: + node-gyp-build "^4.2.0" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + +bytewise-core@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bytewise-core/-/bytewise-core-1.2.3.tgz#3fb410c7e91558eb1ab22a82834577aa6bd61d42" + integrity sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI= + dependencies: + typewise-core "^1.2" + +bytewise@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/bytewise/-/bytewise-1.1.0.tgz#1d13cbff717ae7158094aa881b35d081b387253e" + integrity sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4= + dependencies: + bytewise-core "^1.2.2" + typewise "^1.0.3" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +cachedown@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cachedown/-/cachedown-1.0.0.tgz#d43f036e4510696b31246d7db31ebf0f7ac32d15" + integrity sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU= + dependencies: + abstract-leveldown "^2.4.1" + lru-cache "^3.2.0" + +call-bind@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" + integrity sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.0" + +call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-lite@^1.0.30000844: + version "1.0.30001170" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001170.tgz#0088bfecc6a14694969e391cc29d7eb6362ca6a7" + integrity sha512-Dd4d/+0tsK0UNLrZs3CvNukqalnVTRrxb5mcQm8rHL49t7V5ZaTygwXkrq+FB+dVDf++4ri8eJnFEJAB8332PA== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +cbor@^5.0.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" + integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A== + dependencies: + bignumber.js "^9.0.1" + nofilter "^1.0.4" + +chai@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" + integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.0" + type-detect "^4.0.5" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= + +checkpoint-store@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" + integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= + dependencies: + functional-red-black-tree "^1.0.1" + +chokidar@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" + integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.2.0" + optionalDependencies: + fsevents "~2.1.1" + +chokidar@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cids@^0.7.1: + version "0.7.5" + resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" + integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== + dependencies: + buffer "^5.5.0" + class-is "^1.1.0" + multibase "~0.6.0" + multicodec "^1.0.0" + multihashes "~0.4.15" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-is@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" + integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +clone@2.1.2, clone@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collect-v8-coverage@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" + integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +command-line-args@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" + integrity sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA== + dependencies: + array-back "^2.0.0" + find-replace "^1.0.3" + typical "^2.6.1" + +commander@2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.5.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-hash@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" + integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== + dependencies: + cids "^0.7.1" + multicodec "^0.5.5" + multihashes "^0.4.15" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + +cookie@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + +cookiejar@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" + integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js-pure@^3.0.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.8.1.tgz#23f84048f366fdfcf52d3fd1c68fec349177d119" + integrity sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g== + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cors@^2.8.1: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== + dependencies: + object-assign "^4" + vary "^1" + +cosmiconfig@^5.0.7: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" + +crc-32@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" + integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== + dependencies: + exit-on-epipe "~1.0.1" + printj "~1.1.0" + +create-ecdh@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" + integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== + dependencies: + bn.js "^4.1.0" + elliptic "^6.5.3" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-fetch@^2.1.0, cross-fetch@^2.1.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" + integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== + dependencies: + node-fetch "2.1.2" + whatwg-fetch "2.0.4" + +cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@4, debug@^4.0.1, debug@^4.1.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +debug@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decimal.js@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" + integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +decompress-response@^3.2.0, decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +deep-equal@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== + dependencies: + is-arguments "^1.0.4" + is-date-object "^1.0.1" + is-regex "^1.0.4" + object-is "^1.0.1" + object-keys "^1.1.1" + regexp.prototype.flags "^1.2.0" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + +deferred-leveldown@~1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" + integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== + dependencies: + abstract-leveldown "~2.6.0" + +deferred-leveldown@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" + integrity sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww== + dependencies: + abstract-leveldown "~5.0.0" + inherits "^2.0.3" + +deferred-leveldown@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" + integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== + dependencies: + abstract-leveldown "~6.2.1" + inherits "^2.0.3" + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +des.js@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff-sequences@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" + integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dir-to-object@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-to-object/-/dir-to-object-2.0.0.tgz#29723e9bd1c3e58e4f307bd04ff634c0370c8f8a" + integrity sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA== + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dom-walk@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" + integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== + +dotignore@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" + integrity sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw== + dependencies: + minimatch "^3.0.4" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +electron-to-chromium@^1.3.47: + version "1.3.633" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe" + integrity sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA== + +elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +elliptic@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.0.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.0.tgz#a26da8e832b16a9753309f25e35e3c0efb9a066a" + integrity sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +encoding-down@5.0.4, encoding-down@~5.0.0: + version "5.0.4" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-5.0.4.tgz#1e477da8e9e9d0f7c8293d320044f8b2cd8e9614" + integrity sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw== + dependencies: + abstract-leveldown "^5.0.0" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + xtend "^4.0.1" + +encoding-down@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" + integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== + dependencies: + abstract-leveldown "^6.2.1" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + +encoding@^0.1.11: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +env-paths@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" + integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== + +errno@~0.1.1: + version "0.1.8" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" + integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.1: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.2: + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.2" + is-string "^1.0.5" + object-inspect "^1.9.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es5-ext@^0.10.35, es5-ext@^0.10.50: + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.3" + next-tick "~1.0.0" + +es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint@^5.6.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +eth-block-tracker@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1" + integrity sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug== + dependencies: + eth-query "^2.1.0" + ethereumjs-tx "^1.3.3" + ethereumjs-util "^5.1.3" + ethjs-util "^0.1.3" + json-rpc-engine "^3.6.0" + pify "^2.3.0" + tape "^4.6.3" + +eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" + integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= + dependencies: + idna-uts46-hx "^2.3.1" + js-sha3 "^0.5.7" + +eth-json-rpc-infura@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz#26702a821067862b72d979c016fd611502c6057f" + integrity sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw== + dependencies: + cross-fetch "^2.1.1" + eth-json-rpc-middleware "^1.5.0" + json-rpc-engine "^3.4.0" + json-rpc-error "^2.0.0" + +eth-json-rpc-middleware@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz#5c9d4c28f745ccb01630f0300ba945f4bef9593f" + integrity sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q== + dependencies: + async "^2.5.0" + eth-query "^2.1.2" + eth-tx-summary "^3.1.2" + ethereumjs-block "^1.6.0" + ethereumjs-tx "^1.3.3" + ethereumjs-util "^5.1.2" + ethereumjs-vm "^2.1.0" + fetch-ponyfill "^4.0.0" + json-rpc-engine "^3.6.0" + json-rpc-error "^2.0.0" + json-stable-stringify "^1.0.1" + promise-to-callback "^1.0.0" + tape "^4.6.3" + +eth-lib@0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" + integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + +eth-lib@^0.1.26: + version "0.1.29" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" + integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + nano-json-stream-parser "^0.1.2" + servify "^0.1.12" + ws "^3.0.0" + xhr-request-promise "^0.1.2" + +eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" + integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= + dependencies: + json-rpc-random-id "^1.0.0" + xtend "^4.0.1" + +eth-sig-util@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" + integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= + dependencies: + ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" + ethereumjs-util "^5.1.1" + +eth-sig-util@^2.0.0, eth-sig-util@^2.5.2: + version "2.5.3" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.3.tgz#6938308b38226e0b3085435474900b03036abcbe" + integrity sha512-KpXbCKmmBUNUTGh9MRKmNkIPietfhzBqqYqysDavLseIiMUGl95k6UcPEkALAZlj41e9E6yioYXc1PC333RKqw== + dependencies: + buffer "^5.2.1" + elliptic "^6.4.0" + ethereumjs-abi "0.6.5" + ethereumjs-util "^5.1.1" + tweetnacl "^1.0.0" + tweetnacl-util "^0.15.0" + +eth-tx-summary@^3.1.2: + version "3.2.4" + resolved "https://registry.yarnpkg.com/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz#e10eb95eb57cdfe549bf29f97f1e4f1db679035c" + integrity sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg== + dependencies: + async "^2.1.2" + clone "^2.0.0" + concat-stream "^1.5.1" + end-of-stream "^1.1.0" + eth-query "^2.0.2" + ethereumjs-block "^1.4.1" + ethereumjs-tx "^1.1.1" + ethereumjs-util "^5.0.1" + ethereumjs-vm "^2.6.0" + through2 "^2.0.3" + +ethashjs@~0.0.7: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" + integrity sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw== + dependencies: + async "^2.1.2" + buffer-xor "^2.0.1" + ethereumjs-util "^7.0.2" + miller-rabin "^4.0.0" + +ethereum-bloom-filters@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz#b7b80735e385dbb7f944ce6b4533e24511306060" + integrity sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ== + dependencies: + js-sha3 "^0.8.0" + +ethereum-common@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" + integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== + +ethereum-common@^0.0.18: + version "0.0.18" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" + integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= + +ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-waffle@^3.0.2: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.2.1.tgz#9d6d6b93484c5e1b77dfdeb646c050ed877e836e" + integrity sha512-Fhg7BaBuV+Xo5XT+NEC3UTKGunvpq+iQPglZbIAJF6ZcwQwkiKfJUDuB0ZSkg5ntbRS4gpahfoXj1nTzdtx8UA== + dependencies: + "@ethereum-waffle/chai" "^3.2.1" + "@ethereum-waffle/compiler" "^3.2.1" + "@ethereum-waffle/mock-contract" "^3.2.1" + "@ethereum-waffle/provider" "^3.2.1" + ethers "^5.0.1" + +ethereumjs-abi@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" + integrity sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE= + dependencies: + bn.js "^4.10.0" + ethereumjs-util "^4.3.0" + +ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": + version "0.6.8" + resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f" + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" + integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== + dependencies: + ethereumjs-util "^6.0.0" + rlp "^2.2.1" + safe-buffer "^5.1.1" + +ethereumjs-account@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" + integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== + dependencies: + ethereumjs-util "^5.0.0" + rlp "^2.0.0" + safe-buffer "^5.1.1" + +ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" + integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== + dependencies: + async "^2.0.1" + ethereumjs-common "^1.5.0" + ethereumjs-tx "^2.1.1" + ethereumjs-util "^5.0.0" + merkle-patricia-tree "^2.1.2" + +ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" + integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== + dependencies: + async "^2.0.1" + ethereum-common "0.2.0" + ethereumjs-tx "^1.2.2" + ethereumjs-util "^5.0.0" + merkle-patricia-tree "^2.1.2" + +ethereumjs-blockchain@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz#30f2228dc35f6dcf94423692a6902604ae34960f" + integrity sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ== + dependencies: + async "^2.6.1" + ethashjs "~0.0.7" + ethereumjs-block "~2.2.2" + ethereumjs-common "^1.5.0" + ethereumjs-util "^6.1.0" + flow-stoplight "^1.0.0" + level-mem "^3.0.1" + lru-cache "^5.1.1" + rlp "^2.2.2" + semaphore "^1.1.0" + +ethereumjs-common@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" + integrity sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ== + +ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" + integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA== + +ethereumjs-tx@2.1.2, ethereumjs-tx@^2.1.1, ethereumjs-tx@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" + integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw== + dependencies: + ethereumjs-common "^1.5.0" + ethereumjs-util "^6.0.0" + +ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3: + version "1.3.7" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" + integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== + dependencies: + ethereum-common "^0.0.18" + ethereumjs-util "^5.0.0" + +ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethereumjs-util@^4.3.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz#f4bf9b3b515a484e3cc8781d61d9d980f7c83bd0" + integrity sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w== + dependencies: + bn.js "^4.8.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + rlp "^2.0.0" + +ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" + integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== + dependencies: + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "^0.1.3" + rlp "^2.0.0" + safe-buffer "^5.1.1" + +ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.7, ethereumjs-util@^7.0.8, ethereumjs-util@^7.0.9: + version "7.0.10" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz#5fb7b69fa1fda0acc59634cf39d6b0291180fc1f" + integrity sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + +ethereumjs-util@^7.0.2: + version "7.0.7" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz#484fb9c03b766b2ee64821281070616562fb5a59" + integrity sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + +ethereumjs-vm@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" + integrity sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA== + dependencies: + async "^2.1.2" + async-eventemitter "^0.2.2" + core-js-pure "^3.0.1" + ethereumjs-account "^3.0.0" + ethereumjs-block "^2.2.2" + ethereumjs-blockchain "^4.0.3" + ethereumjs-common "^1.5.0" + ethereumjs-tx "^2.1.2" + ethereumjs-util "^6.2.0" + fake-merkle-patricia-tree "^1.0.1" + functional-red-black-tree "^1.0.1" + merkle-patricia-tree "^2.3.2" + rustbn.js "~0.2.0" + safe-buffer "^5.1.1" + util.promisify "^1.0.0" + +ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" + integrity sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw== + dependencies: + async "^2.1.2" + async-eventemitter "^0.2.2" + ethereumjs-account "^2.0.3" + ethereumjs-block "~2.2.0" + ethereumjs-common "^1.1.0" + ethereumjs-util "^6.0.0" + fake-merkle-patricia-tree "^1.0.1" + functional-red-black-tree "^1.0.1" + merkle-patricia-tree "^2.3.2" + rustbn.js "~0.2.0" + safe-buffer "^5.1.1" + +ethereumjs-wallet@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" + integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA== + dependencies: + aes-js "^3.1.1" + bs58check "^2.1.2" + ethereum-cryptography "^0.1.3" + ethereumjs-util "^6.0.0" + randombytes "^2.0.6" + safe-buffer "^5.1.2" + scryptsy "^1.2.1" + utf8 "^3.0.0" + uuid "^3.3.2" + +ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.8: + version "5.0.24" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.24.tgz#fbb8e4d35070d134f2eb846c07500b8c0eaef6d3" + integrity sha512-77CEtVC88fJGEhxGXRvQqAEH6e2A+ZFiv2FBT6ikXndlty5sw6vMatAhg1v+w3CaaGZOf1CP81jl4Mc8Zrj08A== + dependencies: + "@ethersproject/abi" "5.0.9" + "@ethersproject/abstract-provider" "5.0.7" + "@ethersproject/abstract-signer" "5.0.9" + "@ethersproject/address" "5.0.8" + "@ethersproject/base64" "5.0.6" + "@ethersproject/basex" "5.0.6" + "@ethersproject/bignumber" "5.0.12" + "@ethersproject/bytes" "5.0.8" + "@ethersproject/constants" "5.0.7" + "@ethersproject/contracts" "5.0.8" + "@ethersproject/hash" "5.0.9" + "@ethersproject/hdnode" "5.0.7" + "@ethersproject/json-wallets" "5.0.9" + "@ethersproject/keccak256" "5.0.6" + "@ethersproject/logger" "5.0.8" + "@ethersproject/networks" "5.0.6" + "@ethersproject/pbkdf2" "5.0.6" + "@ethersproject/properties" "5.0.6" + "@ethersproject/providers" "5.0.17" + "@ethersproject/random" "5.0.6" + "@ethersproject/rlp" "5.0.6" + "@ethersproject/sha2" "5.0.6" + "@ethersproject/signing-key" "5.0.7" + "@ethersproject/solidity" "5.0.7" + "@ethersproject/strings" "5.0.7" + "@ethersproject/transactions" "5.0.8" + "@ethersproject/units" "5.0.8" + "@ethersproject/wallet" "5.0.9" + "@ethersproject/web" "5.0.11" + "@ethersproject/wordlists" "5.0.7" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.3: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +eventemitter3@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" + integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== + +events@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" + integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.3.2: + version "0.3.4" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" + integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-on-epipe@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" + integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" + integrity sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA== + dependencies: + "@jest/types" "^26.6.2" + ansi-styles "^4.0.0" + jest-get-type "^26.3.0" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" + +express@^4.14.0: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== + dependencies: + type "^2.0.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fake-merkle-patricia-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" + integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= + dependencies: + checkpoint-store "^1.1.0" + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fb-watchman@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" + integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + dependencies: + bser "2.1.1" + +fetch-ponyfill@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" + integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= + dependencies: + node-fetch "~1.7.1" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + +find-package-json@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/find-package-json/-/find-package-json-1.2.0.tgz#4057d1b943f82d8445fe52dc9cf456f6b8b58083" + integrity sha512-+SOGcLGYDJHtyqHd87ysBhmaeQ95oWspDKnMXBrnQ9Eq4OkLNqejgoaD8xVWu6GPa0B6roa6KinCMEMcVeqONw== + +find-replace@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" + integrity sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A= + dependencies: + array-back "^1.0.4" + test-value "^2.1.0" + +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-yarn-workspace-root@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" + integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== + dependencies: + fs-extra "^4.0.3" + micromatch "^3.1.4" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flat@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== + dependencies: + is-buffer "~2.0.3" + +flatted@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== + +flow-stoplight@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" + integrity sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s= + +follow-redirects@^1.12.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" + integrity sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg== + +for-each@^0.3.3, for-each@~0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^4.0.2, fs-extra@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^7.0.0, fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== + dependencies: + minipass "^2.6.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" + integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== + +fsevents@~2.1.1, fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +function-bind@^1.1.1, function-bind@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +ganache-core@^2.10.2: + version "2.13.1" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.1.tgz#bf60399a2dd084e1090db91cbbc7ed3885dc01e4" + integrity sha512-Ewg+kNcDqXtOohe7jCcP+ZUv9EMzOx2MoqOYYP3BCfxrDh3KjBXXaKK+Let7li0TghAs9lxmBgevZku35j5YzA== + dependencies: + abstract-leveldown "3.0.0" + async "2.6.2" + bip39 "2.5.0" + cachedown "1.0.0" + clone "2.1.2" + debug "3.2.6" + encoding-down "5.0.4" + eth-sig-util "^2.0.0" + ethereumjs-abi "0.6.8" + ethereumjs-account "3.0.0" + ethereumjs-block "2.2.2" + ethereumjs-common "1.5.0" + ethereumjs-tx "2.1.2" + ethereumjs-util "6.2.1" + ethereumjs-vm "4.2.0" + heap "0.2.6" + keccak "3.0.1" + level-sublevel "6.6.4" + levelup "3.1.1" + lodash "4.17.20" + lru-cache "5.1.1" + merkle-patricia-tree "3.0.0" + patch-package "6.2.2" + seedrandom "3.0.1" + source-map-support "0.5.12" + tmp "0.1.0" + web3-provider-engine "14.2.1" + websocket "1.0.32" + optionalDependencies: + ethereumjs-wallet "0.6.5" + web3 "1.2.11" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + +get-intrinsic@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" + integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-stream@^4.0.0, get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3, glob@~7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" + integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== + dependencies: + min-document "^2.19.0" + process "^0.11.10" + +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +got@9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +got@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== + dependencies: + decompress-response "^3.2.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-plain-obj "^1.1.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + p-cancelable "^0.3.0" + p-timeout "^1.1.1" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + url-parse-lax "^1.0.0" + url-to-options "^1.0.1" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +hardhat-typechain@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/hardhat-typechain/-/hardhat-typechain-0.3.5.tgz#8e50616a9da348b33bd001168c8fda9c66b7b4af" + integrity sha512-w9lm8sxqTJACY+V7vijiH+NkPExnmtiQEjsV9JKD1KgMdVk2q8y+RhvU/c4B7+7b1+HylRUCxpOIvFuB3rE4+w== + +hardhat@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.2.0.tgz#7d569d29678e5f786a228390b4c0b0cc9fd8ae32" + integrity sha512-3g0qFoQTkR4gfcHDZr59vPfbSH2PiAyxzYblkAAHUNTPBadO5W26z5RWzDv6/lRu8SqZZ9/8AdGZX4IZEa8EDg== + dependencies: + "@ethereumjs/block" "^3.2.1" + "@ethereumjs/blockchain" "^5.2.1" + "@ethereumjs/common" "^2.2.0" + "@ethereumjs/tx" "^3.1.3" + "@ethereumjs/vm" "^5.3.2" + "@sentry/node" "^5.18.1" + "@solidity-parser/parser" "^0.11.0" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + abort-controller "^3.0.0" + adm-zip "^0.4.16" + ansi-escapes "^4.3.0" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + eth-sig-util "^2.5.2" + ethereum-cryptography "^0.1.2" + ethereumjs-abi "^0.6.8" + ethereumjs-util "^7.0.10" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "^7.1.3" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + lodash "^4.17.11" + merkle-patricia-tree "^4.1.0" + mnemonist "^0.38.0" + mocha "^7.1.2" + node-fetch "^2.6.0" + qs "^6.7.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + slash "^3.0.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + "true-case-path" "^2.2.1" + tsort "0.0.1" + uuid "^3.3.2" + ws "^7.2.1" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== + +has-symbols@^1.0.0, has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + +has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== + dependencies: + has-symbol-support-x "^1.4.1" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.3, has@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +heap@0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" + integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= + +hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: + version "2.8.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@1.7.3, http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-https@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" + integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24, iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" + integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +idna-uts46-hx@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" + integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== + dependencies: + punycode "2.1.0" + +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +immediate@^3.2.3: + version "3.3.0" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" + integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== + +immediate@~3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= + +immutable@^4.0.0-rc.12: + version "4.0.0-rc.12" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" + integrity sha512-0M2XxkZLx/mi3t8NVwIm1g8nHoEmM9p9UBl/G9k4+hm0kBgOVdMV/B3CY5dQ8qG8qc80NN4gDV4HQv6FTJ5q7A== + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inquirer@^6.2.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arguments@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== + dependencies: + call-bind "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-bigint@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" + integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" + integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== + dependencies: + call-bind "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-buffer@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + +is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-core-module@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + dependencies: + has "^1.0.3" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" + integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-function@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" + integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= + +is-negative-zero@^2.0.0, is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4, is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== + dependencies: + has-symbols "^1.0.1" + +is-regex@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" + integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.1" + +is-regex@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + +is-retry-allowed@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" + integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== + +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-url@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" + integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + +jest-diff@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" + integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA== + dependencies: + chalk "^4.0.0" + diff-sequences "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-get-type@^26.3.0: + version "26.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" + integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== + +jest-haste-map@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" + integrity sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w== + dependencies: + "@jest/types" "^26.6.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^26.0.0" + jest-serializer "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.1.2" + +jest-matcher-utils@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" + integrity sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw== + dependencies: + chalk "^4.0.0" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-message-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" + integrity sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/types" "^26.6.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + pretty-format "^26.6.2" + slash "^3.0.0" + stack-utils "^2.0.2" + +jest-pnp-resolver@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" + integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + +jest-regex-util@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" + integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== + +jest-resolve@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" + integrity sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ== + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^26.6.2" + read-pkg-up "^7.0.1" + resolve "^1.18.1" + slash "^3.0.0" + +jest-serializer@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" + integrity sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g== + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + +jest-snapshot@^26.5.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" + integrity sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^26.6.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.6.2" + graceful-fs "^4.2.4" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + jest-haste-map "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + natural-compare "^1.4.0" + pretty-format "^26.6.2" + semver "^7.3.2" + +jest-util@^26.5.2, jest-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" + integrity sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q== + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + micromatch "^4.0.2" + +jest-worker@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +js-sha3@0.5.7, js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" + integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== + dependencies: + async "^2.0.1" + babel-preset-env "^1.7.0" + babelify "^7.3.0" + json-rpc-error "^2.0.0" + promise-to-callback "^1.0.0" + safe-event-emitter "^1.0.1" + +json-rpc-error@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" + integrity sha1-p6+cICg4tekFxyUOVH8a/3cligI= + dependencies: + inherits "^2.0.1" + +json-rpc-random-id@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" + integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +keccak@3.0.1, keccak@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" + integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= + optionalDependencies: + graceful-fs "^4.1.9" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +level-codec@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" + integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== + dependencies: + buffer "^5.6.0" + +level-codec@~7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" + integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== + +level-concat-iterator@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" + integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== + +level-errors@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" + integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== + dependencies: + errno "~0.1.1" + +level-errors@^2.0.0, level-errors@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" + integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== + dependencies: + errno "~0.1.1" + +level-errors@~1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" + integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== + dependencies: + errno "~0.1.1" + +level-iterator-stream@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" + integrity sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.5" + xtend "^4.0.0" + +level-iterator-stream@~1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" + integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= + dependencies: + inherits "^2.0.1" + level-errors "^1.0.3" + readable-stream "^1.0.33" + xtend "^4.0.0" + +level-iterator-stream@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz#2c98a4f8820d87cdacab3132506815419077c730" + integrity sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g== + dependencies: + inherits "^2.0.1" + readable-stream "^2.3.6" + xtend "^4.0.0" + +level-iterator-stream@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" + integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== + dependencies: + inherits "^2.0.4" + readable-stream "^3.4.0" + xtend "^4.0.2" + +level-mem@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" + integrity sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg== + dependencies: + level-packager "~4.0.0" + memdown "~3.0.0" + +level-mem@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" + integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== + dependencies: + level-packager "^5.0.3" + memdown "^5.0.0" + +level-packager@^5.0.3: + version "5.1.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" + integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== + dependencies: + encoding-down "^6.3.0" + levelup "^4.3.2" + +level-packager@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" + integrity sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q== + dependencies: + encoding-down "~5.0.0" + levelup "^3.0.0" + +level-post@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/level-post/-/level-post-1.0.7.tgz#19ccca9441a7cc527879a0635000f06d5e8f27d0" + integrity sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew== + dependencies: + ltgt "^2.1.2" + +level-sublevel@6.6.4: + version "6.6.4" + resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-6.6.4.tgz#f7844ae893919cd9d69ae19d7159499afd5352ba" + integrity sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA== + dependencies: + bytewise "~1.1.0" + level-codec "^9.0.0" + level-errors "^2.0.0" + level-iterator-stream "^2.0.3" + ltgt "~2.1.1" + pull-defer "^0.2.2" + pull-level "^2.0.3" + pull-stream "^3.6.8" + typewiselite "~1.0.0" + xtend "~4.0.0" + +level-supports@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" + integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== + dependencies: + xtend "^4.0.2" + +level-ws@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" + integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= + dependencies: + readable-stream "~1.0.15" + xtend "~2.1.1" + +level-ws@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-1.0.0.tgz#19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b" + integrity sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q== + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.8" + xtend "^4.0.1" + +level-ws@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" + integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== + dependencies: + inherits "^2.0.3" + readable-stream "^3.1.0" + xtend "^4.0.1" + +levelup@3.1.1, levelup@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" + integrity sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg== + dependencies: + deferred-leveldown "~4.0.0" + level-errors "~2.0.0" + level-iterator-stream "~3.0.0" + xtend "~4.0.0" + +levelup@^1.2.1: + version "1.3.9" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" + integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== + dependencies: + deferred-leveldown "~1.2.1" + level-codec "~7.0.0" + level-errors "~1.0.3" + level-iterator-stream "~1.3.0" + prr "~1.0.1" + semver "~5.4.1" + xtend "~4.0.0" + +levelup@^4.3.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" + integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== + dependencies: + deferred-leveldown "~5.3.0" + level-errors "~2.0.0" + level-iterator-stream "~4.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.assign@^4.0.3, lodash.assign@^4.0.6: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= + +lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +log-symbols@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + +log-symbols@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== + dependencies: + chalk "^2.4.2" + +looper@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" + integrity sha1-Zs0Md0rz1P7axTeU90LbVtqPCew= + +looper@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-3.0.0.tgz#2efa54c3b1cbaba9b94aee2e5914b0be57fbb749" + integrity sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k= + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +lru-cache@5.1.1, lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" + integrity sha1-cXibO39Tmb7IVl3aOKow0qCX7+4= + dependencies: + pseudomap "^1.0.1" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= + +ltgt@^2.1.2, ltgt@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= + +ltgt@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" + integrity sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ= + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +mcl-wasm@^0.7.1: + version "0.7.6" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.6.tgz#c1789ebda5565d49b77d2ee195ff3e4d282f1554" + integrity sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +memdown@^1.0.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" + integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= + dependencies: + abstract-leveldown "~2.7.1" + functional-red-black-tree "^1.0.1" + immediate "^3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.1.1" + +memdown@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" + integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== + dependencies: + abstract-leveldown "~6.2.1" + functional-red-black-tree "~1.0.1" + immediate "~3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.2.0" + +memdown@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" + integrity sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA== + dependencies: + abstract-leveldown "~5.0.0" + functional-red-black-tree "~1.0.1" + immediate "~3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.1.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merkle-patricia-tree@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" + integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ== + dependencies: + async "^2.6.1" + ethereumjs-util "^5.2.0" + level-mem "^3.0.1" + level-ws "^1.0.0" + readable-stream "^3.0.6" + rlp "^2.0.0" + semaphore ">=1.0.1" + +merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" + integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== + dependencies: + async "^1.4.2" + ethereumjs-util "^5.0.0" + level-ws "0.0.0" + levelup "^1.2.1" + memdown "^1.0.0" + readable-stream "^2.0.0" + rlp "^2.0.0" + semaphore ">=1.0.1" + +merkle-patricia-tree@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.1.0.tgz#010636c4cfd68682df33a2e3186b7d0be7b98b9d" + integrity sha512-vmP1J7FwIpprFMVjjSMM1JAwFce85Q+tp0TYIedYv8qaMh2oLUZ3ETXn9wbgi9S6elySzKzGa+Ai6VNKGEwSlg== + dependencies: + "@types/levelup" "^4.3.0" + ethereumjs-util "^7.0.8" + level-mem "^5.0.1" + level-ws "^2.0.0" + readable-stream "^3.6.0" + rlp "^2.2.3" + semaphore-async-await "^1.5.1" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= + dependencies: + dom-walk "^0.1.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== + dependencies: + minipass "^2.9.0" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp-promise@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= + dependencies: + mkdirp "*" + +mkdirp@*: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mkdirp@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" + integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== + dependencies: + minimist "^1.2.5" + +mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mnemonist@^0.38.0: + version "0.38.3" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.3.tgz#35ec79c1c1f4357cfda2fe264659c2775ccd7d9d" + integrity sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw== + dependencies: + obliterator "^1.6.1" + +mocha-chai-jest-snapshot@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.1.tgz#7e49f20d0c12e6792d7f7da2e4ee0c38950571cc" + integrity sha512-52GyyqRD/cI8AIiMTQzizKmLeKQvZRBLwWOHwlwytUKPnWSNpRy1MkIcJIlgUrs5ocrjujOWwtKwyVkLWT/DFQ== + dependencies: + "@jest/test-result" "^26.5.2" + chalk "^4.1.0" + find-package-json "^1.2.0" + jest-snapshot "^26.5.2" + jest-util "^26.5.2" + slash "^3.0.0" + yargs "^16.0.3" + +mocha@^6.2.2: + version "6.2.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" + integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "2.2.0" + minimatch "3.0.4" + mkdirp "0.5.4" + ms "2.1.1" + node-environment-flags "1.0.5" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mocha@^7.1.2: + version "7.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" + integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "3.0.0" + minimatch "3.0.4" + mkdirp "0.5.5" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mock-fs@^4.1.0: + version "4.13.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.13.0.tgz#31c02263673ec3789f90eb7b6963676aa407a598" + integrity sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +multibase@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" + integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multibase@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" + integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multicodec@^0.5.5: + version "0.5.7" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" + integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== + dependencies: + varint "^5.0.0" + +multicodec@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" + integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== + dependencies: + buffer "^5.6.0" + varint "^5.0.0" + +multihashes@^0.4.15, multihashes@~0.4.15: + version "0.4.21" + resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" + integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== + dependencies: + buffer "^5.5.0" + multibase "^0.7.0" + varint "^5.0.0" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +nano-json-stream-parser@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" + integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +next-tick@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-environment-flags@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" + integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-environment-flags@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" + integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-fetch@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" + integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= + +node-fetch@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +node-fetch@~1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-gyp-build@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" + integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +nofilter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" + integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== + +normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4, object-assign@^4.0.0, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.8.0, object-inspect@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" + integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== + +object-inspect@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + +object-is@^1.0.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" + integrity sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.assign@^4.1.1, object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz#0dfda8d108074d9c563e80490c883b6661091544" + integrity sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +object.getownpropertydescriptors@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7" + integrity sha512-WtxeKSzfBjlzL+F9b7M7hewDzMwy+C8NRssHd1YrNlzHzIDrXcXiNOMrezdAEM4UXixgV+vvnyBeN7Rygl2ttQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +obliterator@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-1.6.1.tgz#dea03e8ab821f6c4d96a299e17aef6a3af994ef3" + integrity sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig== + +oboe@2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" + integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= + dependencies: + http-https "^1.0.0" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0, p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-timeout@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= + dependencies: + p-finally "^1.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-asn1@^5.0.0, parse-asn1@^5.1.5: + version "5.1.6" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" + integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== + dependencies: + asn1.js "^5.2.0" + browserify-aes "^1.0.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-headers@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" + integrity sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA== + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-json@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" + integrity sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +patch-package@6.2.2, patch-package@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.2.tgz#71d170d650c65c26556f0d0fbbb48d92b6cc5f39" + integrity sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^2.4.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^1.2.1" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.0" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + +path-browserify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= + +pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: + version "3.1.1" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" + integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== + +precond@0.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" + integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-solidity@^1.0.0-alpha.59: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.2.tgz#312a429cd0026b2cbdbe0ad8ef30c4f8db1f74b2" + integrity sha512-afn8Q0E0fY2I26fbagiBo1XRe7Cv/vs3t/N5Xbndzjgln+TXrtNxgWzhdZcFoZLN92WrFbxqqDoP6Lk5L80Fmw== + dependencies: + "@solidity-parser/parser" "^0.10.1" + dir-to-object "^2.0.0" + emoji-regex "^9.0.0" + escape-string-regexp "^4.0.0" + prettier "^2.0.5" + semver "^7.3.2" + solidity-comments-extractor "^0.0.4" + string-width "^4.2.0" + +prettier@^1.14.3: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + +prettier@^2.0.5, prettier@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== + +pretty-format@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" + integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== + dependencies: + "@jest/types" "^26.6.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^17.0.1" + +printj@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" + integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +promise-to-callback@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" + integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= + dependencies: + is-fn "^1.0.0" + set-immediate-shim "^1.0.1" + +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pull-cat@^1.1.9: + version "1.1.11" + resolved "https://registry.yarnpkg.com/pull-cat/-/pull-cat-1.1.11.tgz#b642dd1255da376a706b6db4fa962f5fdb74c31b" + integrity sha1-tkLdElXaN2pwa220+pYvX9t0wxs= + +pull-defer@^0.2.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/pull-defer/-/pull-defer-0.2.3.tgz#4ee09c6d9e227bede9938db80391c3dac489d113" + integrity sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA== + +pull-level@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pull-level/-/pull-level-2.0.4.tgz#4822e61757c10bdcc7cf4a03af04c92734c9afac" + integrity sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg== + dependencies: + level-post "^1.0.7" + pull-cat "^1.1.9" + pull-live "^1.0.1" + pull-pushable "^2.0.0" + pull-stream "^3.4.0" + pull-window "^2.1.4" + stream-to-pull-stream "^1.7.1" + +pull-live@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pull-live/-/pull-live-1.0.1.tgz#a4ecee01e330155e9124bbbcf4761f21b38f51f5" + integrity sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU= + dependencies: + pull-cat "^1.1.9" + pull-stream "^3.4.0" + +pull-pushable@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" + integrity sha1-Xy867UethpGfAbEqLpnW8b13ZYE= + +pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.6.8: + version "3.6.14" + resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.14.tgz#529dbd5b86131f4a5ed636fdf7f6af00781357ee" + integrity sha512-KIqdvpqHHaTUA2mCYcLG1ibEbu/LCKoJZsBWyv9lSYtPkJPBq8m3Hxa103xHi6D2thj5YXa0TqK3L3GUkwgnew== + +pull-window@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/pull-window/-/pull-window-2.1.4.tgz#fc3b86feebd1920c7ae297691e23f705f88552f0" + integrity sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA= + dependencies: + looper "^2.0.0" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + integrity sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +qs@^6.7.0: + version "6.9.4" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" + integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + +raw-body@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" + integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== + dependencies: + bytes "3.1.0" + http-errors "1.7.3" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-is@^17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" + integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + +readable-stream@^1.0.33: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6, readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~1.0.15: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdirp@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" + integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== + dependencies: + picomatch "^2.0.4" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +regenerate@^1.2.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp.prototype.flags@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + integrity sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA= + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +request@^2.79.0, request@^2.85.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.17.0, resolve@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.10.0, resolve@^1.18.1, resolve@^1.8.1: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= + dependencies: + through "~2.3.4" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rimraf@^2.2.8, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: + version "2.2.6" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" + integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== + dependencies: + bn.js "^4.11.1" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + +run-async@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + +rustbn.js@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== + +rxjs@^6.4.0: + version "6.6.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" + integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== + dependencies: + tslib "^1.9.0" + +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-event-emitter@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" + integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== + dependencies: + events "^3.0.0" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +scryptsy@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" + integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= + dependencies: + pbkdf2 "^3.0.3" + +secp256k1@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +seedrandom@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" + integrity sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg== + +semaphore-async-await@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" + integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= + +semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" + integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.2: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" + +semver@~5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== + +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + +servify@^0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" + integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== + dependencies: + body-parser "^1.16.0" + cors "^2.8.1" + express "^4.14.0" + request "^2.79.0" + xhr "^2.3.3" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^2.7.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" + integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== + dependencies: + decompress-response "^3.3.0" + once "^1.3.1" + simple-concat "^1.0.0" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solc@^0.4.20: + version "0.4.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.26.tgz#5390a62a99f40806b86258c737c1cf653cc35cb5" + integrity sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA== + dependencies: + fs-extra "^0.30.0" + memorystream "^0.3.1" + require-from-string "^1.1.0" + semver "^5.3.0" + yargs "^4.7.1" + +solc@^0.6.3: + version "0.6.12" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" + integrity sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solhint-plugin-prettier@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" + integrity sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA== + dependencies: + prettier-linter-helpers "^1.0.0" + +solhint@^3.2.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.3.2.tgz#ebd7270bb50fd378b427d7a6fc9f2a7fd00216c0" + integrity sha512-8tHCkIAk1axLLG6Qu2WIH3GgNABonj9eAWejJbov3o3ujkZQRNHeHU1cC4/Dmjsh3Om7UzFFeADUHu2i7ZJeiw== + dependencies: + "@solidity-parser/parser" "^0.8.2" + ajv "^6.6.1" + antlr4 "4.7.1" + ast-parents "0.0.1" + chalk "^2.4.2" + commander "2.18.0" + cosmiconfig "^5.0.7" + eslint "^5.6.0" + fast-diff "^1.1.2" + glob "^7.1.3" + ignore "^4.0.6" + js-yaml "^3.12.0" + lodash "^4.17.11" + semver "^6.3.0" + optionalDependencies: + prettier "^1.14.3" + +solidity-comments-extractor@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.4.tgz#ce420aef23641ffd0131c7d80ba85b6e1e42147e" + integrity sha512-58glBODwXIKMaQ7rfcJOrWtFQMMOK28tJ0/LcB5Xhu7WtAxk4UX2fpgKPuaL41XjMp/y0gAa1MTLqk018wuSzA== + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@0.5.12: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.13, source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.7" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" + integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" + integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== + dependencies: + escape-string-regexp "^2.0.0" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +stream-to-pull-stream@^1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz#4161aa2d2eb9964de60bfa1af7feaf917e874ece" + integrity sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg== + dependencies: + looper "^3.0.0" + pull-stream "^3.2.3" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.trim@~1.2.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.3.tgz#d23a22fde01c1e6571a7fadcb9be11decd8061a7" + integrity sha512-16IL9pIBA5asNOSukPfxX2W68BaBvxyiRK16H3RA/lWW9BDosh+w7f+LhomPHpXJ82QEe7w7/rY/S1CV97raLg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +string.prototype.trimend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" + integrity sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" + integrity sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@2.0.1, strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== + dependencies: + has-flag "^3.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +swarm-js@^0.1.40: + version "0.1.40" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" + integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== + dependencies: + bluebird "^3.5.0" + buffer "^5.0.5" + eth-lib "^0.1.26" + fs-extra "^4.0.2" + got "^7.1.0" + mime-types "^2.1.16" + mkdirp-promise "^5.0.1" + mock-fs "^4.1.0" + setimmediate "^1.0.5" + tar "^4.0.2" + xhr-request "^1.0.1" + +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +tape@^4.6.3: + version "4.13.3" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.3.tgz#51b3d91c83668c7a45b1a594b607dee0a0b46278" + integrity sha512-0/Y20PwRIUkQcTCSi4AASs+OANZZwqPKaipGCEwp10dQMipVvSZwUUCi01Y/OklIGyHKFhIcjock+DKnBfLAFw== + dependencies: + deep-equal "~1.1.1" + defined "~1.0.0" + dotignore "~0.1.2" + for-each "~0.3.3" + function-bind "~1.1.1" + glob "~7.1.6" + has "~1.0.3" + inherits "~2.0.4" + is-regex "~1.0.5" + minimist "~1.2.5" + object-inspect "~1.7.0" + resolve "~1.17.0" + resumer "~0.0.0" + string.prototype.trim "~1.2.1" + through "~2.3.8" + +tar@^4.0.2: + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.8.6" + minizlib "^1.2.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.3" + +test-value@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" + integrity sha1-Edpv9nDzRxpztiXKTz/c97t0gpE= + dependencies: + array-back "^1.0.3" + typical "^2.6.0" + +testrpc@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" + integrity sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA== + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through2@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through@^2.3.6, through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +timed-out@^4.0.0, timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + +tmp@0.0.33, tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmp@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" + integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== + dependencies: + rimraf "^2.6.3" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +"true-case-path@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" + integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== + +ts-essentials@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" + integrity sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ== + +ts-essentials@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.1.tgz#d205508cae0cdadfb73c89503140cf2228389e2d" + integrity sha512-8lwh3QJtIc1UWhkQtr9XuksXu3O0YQdEE5g79guDfhCaU1FWTDIEDZ1ZSx4HTHUmlJZ8L812j3BZQ4a0aOUkSA== + +ts-generator@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" + integrity sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ== + dependencies: + "@types/mkdirp" "^0.5.2" + "@types/prettier" "^2.1.1" + "@types/resolve" "^0.0.8" + chalk "^2.4.1" + glob "^7.1.2" + mkdirp "^0.5.1" + prettier "^2.1.2" + resolve "^1.8.1" + ts-essentials "^1.0.0" + +ts-node@^8.5.4: + version "8.10.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" + integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +tslib@^1.9.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl-util@^0.15.0: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.1.0.tgz#9bdc22c648cf8cf86dd23d32336a41cfb6475e3f" + integrity sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA== + +typechain@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-4.0.1.tgz#b40eaf5ede15588d97a4b9a5f85120f7ea1cf262" + integrity sha512-H/1VpRmplp1qhCTVLU9PCgzyVCQ7Lth7YvaaI1hTvT31IpWnLLNpDpQD4vXJGr26T9BsZ0ZIceOwieAbcoywXw== + dependencies: + command-line-args "^4.0.7" + debug "^4.1.1" + fs-extra "^7.0.0" + js-sha3 "^0.8.0" + lodash "^4.17.15" + ts-essentials "^7.0.1" + ts-generator "^0.1.1" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +typescript@^3.7.3: + version "3.9.7" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" + integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== + +typewise-core@^1.2, typewise-core@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" + integrity sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU= + +typewise@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typewise/-/typewise-1.0.3.tgz#1067936540af97937cc5dcf9922486e9fa284651" + integrity sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE= + dependencies: + typewise-core "^1.2.0" + +typewiselite@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typewiselite/-/typewiselite-1.0.0.tgz#c8882fa1bb1092c06005a97f34ef5c8508e3664e" + integrity sha1-yIgvobsQksBgBal/NO9chQjjZk4= + +typical@^2.6.0, typical@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" + integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + +unbox-primitive@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + +underscore@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" + integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unorm@^1.3.3: + version "1.6.0" + resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" + integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" + integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +url-set-query@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" + integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +utf-8-validate@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.3.tgz#3b64e418ad2ff829809025fdfef595eab2f03a27" + integrity sha512-jtJM6fpGv8C1SoH4PtG22pGto6x+Y8uPprW0tw3//gGFhDDTiuksgradgFN6yRayDP4SyZZa6ZMGHLIa17+M8A== + dependencies: + node-gyp-build "^4.2.0" + +utf8@3.0.0, utf8@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util.promisify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" + integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.2" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.0" + +util.promisify@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" + integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + for-each "^0.3.3" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.1" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +uuid@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +varint@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" + integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== + +vary@^1, vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +web3-bzz@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" + integrity sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg== + dependencies: + "@types/node" "^12.12.6" + got "9.6.0" + swarm-js "^0.1.40" + underscore "1.9.1" + +web3-core-helpers@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" + integrity sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A== + dependencies: + underscore "1.9.1" + web3-eth-iban "1.2.11" + web3-utils "1.2.11" + +web3-core-method@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" + integrity sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw== + dependencies: + "@ethersproject/transactions" "^5.0.0-beta.135" + underscore "1.9.1" + web3-core-helpers "1.2.11" + web3-core-promievent "1.2.11" + web3-core-subscriptions "1.2.11" + web3-utils "1.2.11" + +web3-core-promievent@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" + integrity sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA== + dependencies: + eventemitter3 "4.0.4" + +web3-core-requestmanager@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" + integrity sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.11" + web3-providers-http "1.2.11" + web3-providers-ipc "1.2.11" + web3-providers-ws "1.2.11" + +web3-core-subscriptions@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" + integrity sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg== + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-core@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" + integrity sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ== + dependencies: + "@types/bn.js" "^4.11.5" + "@types/node" "^12.12.6" + bignumber.js "^9.0.0" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-requestmanager "1.2.11" + web3-utils "1.2.11" + +web3-eth-abi@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" + integrity sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg== + dependencies: + "@ethersproject/abi" "5.0.0-beta.153" + underscore "1.9.1" + web3-utils "1.2.11" + +web3-eth-accounts@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" + integrity sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw== + dependencies: + crypto-browserify "3.12.0" + eth-lib "0.2.8" + ethereumjs-common "^1.3.2" + ethereumjs-tx "^2.1.1" + scrypt-js "^3.0.1" + underscore "1.9.1" + uuid "3.3.2" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-utils "1.2.11" + +web3-eth-contract@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" + integrity sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow== + dependencies: + "@types/bn.js" "^4.11.5" + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-promievent "1.2.11" + web3-core-subscriptions "1.2.11" + web3-eth-abi "1.2.11" + web3-utils "1.2.11" + +web3-eth-ens@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" + integrity sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA== + dependencies: + content-hash "^2.5.2" + eth-ens-namehash "2.0.8" + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-promievent "1.2.11" + web3-eth-abi "1.2.11" + web3-eth-contract "1.2.11" + web3-utils "1.2.11" + +web3-eth-iban@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" + integrity sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ== + dependencies: + bn.js "^4.11.9" + web3-utils "1.2.11" + +web3-eth-personal@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" + integrity sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw== + dependencies: + "@types/node" "^12.12.6" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-net "1.2.11" + web3-utils "1.2.11" + +web3-eth@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" + integrity sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ== + dependencies: + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-subscriptions "1.2.11" + web3-eth-abi "1.2.11" + web3-eth-accounts "1.2.11" + web3-eth-contract "1.2.11" + web3-eth-ens "1.2.11" + web3-eth-iban "1.2.11" + web3-eth-personal "1.2.11" + web3-net "1.2.11" + web3-utils "1.2.11" + +web3-net@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" + integrity sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg== + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-utils "1.2.11" + +web3-provider-engine@14.2.1: + version "14.2.1" + resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" + integrity sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw== + dependencies: + async "^2.5.0" + backoff "^2.5.0" + clone "^2.0.0" + cross-fetch "^2.1.0" + eth-block-tracker "^3.0.0" + eth-json-rpc-infura "^3.1.0" + eth-sig-util "^1.4.2" + ethereumjs-block "^1.2.2" + ethereumjs-tx "^1.2.0" + ethereumjs-util "^5.1.5" + ethereumjs-vm "^2.3.4" + json-rpc-error "^2.0.0" + json-stable-stringify "^1.0.1" + promise-to-callback "^1.0.0" + readable-stream "^2.2.9" + request "^2.85.0" + semaphore "^1.0.3" + ws "^5.1.1" + xhr "^2.2.0" + xtend "^4.0.1" + +web3-providers-http@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" + integrity sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA== + dependencies: + web3-core-helpers "1.2.11" + xhr2-cookies "1.1.0" + +web3-providers-ipc@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" + integrity sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ== + dependencies: + oboe "2.1.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-providers-ws@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" + integrity sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg== + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + websocket "^1.0.31" + +web3-shh@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" + integrity sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg== + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-core-subscriptions "1.2.11" + web3-net "1.2.11" + +web3-utils@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" + integrity sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ== + dependencies: + bn.js "^4.11.9" + eth-lib "0.2.8" + ethereum-bloom-filters "^1.0.6" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + underscore "1.9.1" + utf8 "3.0.0" + +web3-utils@^1.0.0-beta.31: + version "1.3.1" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.1.tgz#9aa880dd8c9463fe5c099107889f86a085370c2e" + integrity sha512-9gPwFm8SXtIJuzdrZ37PRlalu40fufXxo+H2PiCwaO6RpKGAvlUlWU0qQbyToFNXg7W2H8djEgoAVac8NLMCKQ== + dependencies: + bn.js "^4.11.9" + eth-lib "0.2.8" + ethereum-bloom-filters "^1.0.6" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + underscore "1.9.1" + utf8 "3.0.0" + +web3@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" + integrity sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ== + dependencies: + web3-bzz "1.2.11" + web3-core "1.2.11" + web3-eth "1.2.11" + web3-eth-personal "1.2.11" + web3-net "1.2.11" + web3-shh "1.2.11" + web3-utils "1.2.11" + +websocket@1.0.32: + version "1.0.32" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" + integrity sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q== + dependencies: + bufferutil "^4.0.1" + debug "^2.2.0" + es5-ext "^0.10.50" + typedarray-to-buffer "^3.1.5" + utf-8-validate "^5.0.2" + yaeti "^0.0.6" + +websocket@^1.0.31: + version "1.0.33" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" + integrity sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA== + dependencies: + bufferutil "^4.0.1" + debug "^2.2.0" + es5-ext "^0.10.50" + typedarray-to-buffer "^3.1.5" + utf-8-validate "^5.0.2" + yaeti "^0.0.6" + +whatwg-fetch@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@1.3.1, which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= + +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +ws@7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + integrity sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ== + +ws@^3.0.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +ws@^5.1.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +ws@^7.2.1: + version "7.4.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb" + integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ== + +xhr-request-promise@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" + integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== + dependencies: + xhr-request "^1.1.0" + +xhr-request@^1.0.1, xhr-request@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" + integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== + dependencies: + buffer-to-arraybuffer "^0.0.5" + object-assign "^4.1.1" + query-string "^5.0.1" + simple-get "^2.7.0" + timed-out "^4.0.1" + url-set-query "^1.0.0" + xhr "^2.0.4" + +xhr2-cookies@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" + integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= + dependencies: + cookiejar "^2.1.1" + +xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: + version "2.6.0" + resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" + integrity sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA== + dependencies: + global "~4.4.0" + is-function "^1.0.1" + parse-headers "^2.0.0" + xtend "^4.0.0" + +xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= + dependencies: + object-keys "~0.4.0" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +y18n@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + +yaeti@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" + integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= + +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + integrity sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ= + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.0.6" + +yargs-parser@^20.2.2: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-unparser@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" + integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== + dependencies: + flat "^4.1.0" + lodash "^4.17.15" + yargs "^13.3.0" + +yargs@13.3.2, yargs@^13.3.0: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@^16.0.3: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^4.7.1: + version "4.8.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + integrity sha1-wMQpJMpKqmsObaFznfshZDn53cA= + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + lodash.assign "^4.0.3" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.1" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^2.4.1" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== diff --git a/lib/v3-periphery/.gitattributes b/lib/v3-periphery/.gitattributes new file mode 100644 index 0000000..7cc88f0 --- /dev/null +++ b/lib/v3-periphery/.gitattributes @@ -0,0 +1 @@ +*.sol linguist-language=Solidity \ No newline at end of file diff --git a/lib/v3-periphery/.github/stale.yml b/lib/v3-periphery/.github/stale.yml new file mode 100644 index 0000000..91b9bf5 --- /dev/null +++ b/lib/v3-periphery/.github/stale.yml @@ -0,0 +1,25 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +issues: + # Number of days of inactivity before an Issue or Pull Request becomes stale + daysUntilStale: 7 + + # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. + # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. + daysUntilClose: 7 + + # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) + onlyLabels: + - question + - autoclose + + # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable + exemptLabels: + - p0 + - bug + + # Comment to post when marking as stale. Set to `false` to disable + markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. diff --git a/lib/v3-periphery/.github/workflows/lint.yml b/lib/v3-periphery/.github/workflows/lint.yml new file mode 100644 index 0000000..2f78834 --- /dev/null +++ b/lib/v3-periphery/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Set up node + uses: actions/setup-node@v1 + with: + node-version: 12.x + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run linters + uses: wearerequired/lint-action@a8497ddb33fb1205941fd40452ca9fff07e0770d + with: + github_token: ${{ secrets.github_token }} + prettier: true + auto_fix: true + prettier_extensions: 'css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml,sol' diff --git a/lib/v3-periphery/.github/workflows/tests.yml b/lib/v3-periphery/.github/workflows/tests.yml new file mode 100644 index 0000000..ba7a04b --- /dev/null +++ b/lib/v3-periphery/.github/workflows/tests.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + +jobs: + unit-tests: + name: Unit Tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + registry-url: https://registry.npmjs.org + + - id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn- + + - name: Install dependencies + run: yarn install --frozen-lockfile + + # This is required separately from yarn test because it generates the typechain definitions + - name: Compile + run: yarn compile + + - name: Run unit tests + run: yarn test diff --git a/lib/v3-periphery/.gitignore b/lib/v3-periphery/.gitignore new file mode 100644 index 0000000..2be090a --- /dev/null +++ b/lib/v3-periphery/.gitignore @@ -0,0 +1,5 @@ +artifacts/ +cache/ +crytic-export/ +node_modules/ +typechain/ \ No newline at end of file diff --git a/lib/v3-periphery/.prettierignore b/lib/v3-periphery/.prettierignore new file mode 100644 index 0000000..821c19d --- /dev/null +++ b/lib/v3-periphery/.prettierignore @@ -0,0 +1 @@ +.github \ No newline at end of file diff --git a/lib/v3-periphery/.prettierrc b/lib/v3-periphery/.prettierrc new file mode 100644 index 0000000..31ba22d --- /dev/null +++ b/lib/v3-periphery/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} diff --git a/lib/v3-periphery/.solhint.json b/lib/v3-periphery/.solhint.json new file mode 100644 index 0000000..11b3647 --- /dev/null +++ b/lib/v3-periphery/.solhint.json @@ -0,0 +1,6 @@ +{ + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/lib/v3-periphery/.yarnrc b/lib/v3-periphery/.yarnrc new file mode 100644 index 0000000..5455c6c --- /dev/null +++ b/lib/v3-periphery/.yarnrc @@ -0,0 +1 @@ +ignore-scripts true diff --git a/lib/v3-periphery/LICENSE b/lib/v3-periphery/LICENSE new file mode 100644 index 0000000..ecbc059 --- /dev/null +++ b/lib/v3-periphery/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/lib/v3-periphery/README.md b/lib/v3-periphery/README.md new file mode 100644 index 0000000..8d7345b --- /dev/null +++ b/lib/v3-periphery/README.md @@ -0,0 +1,52 @@ +# Uniswap V3 Periphery + +[![Tests](https://github.com/Uniswap/uniswap-v3-periphery/workflows/Tests/badge.svg)](https://github.com/Uniswap/uniswap-v3-periphery/actions?query=workflow%3ATests) +[![Lint](https://github.com/Uniswap/uniswap-v3-periphery/workflows/Lint/badge.svg)](https://github.com/Uniswap/uniswap-v3-periphery/actions?query=workflow%3ALint) + +This repository contains the periphery smart contracts for the Uniswap V3 Protocol. +For the lower level core contracts, see the [uniswap-v3-core](https://github.com/Uniswap/uniswap-v3-core) +repository. + +## Bug bounty + +This repository is subject to the Uniswap V3 bug bounty program, +per the terms defined [here](./bug-bounty.md). + +## Local deployment + +In order to deploy this code to a local testnet, you should install the npm package +`@uniswap/v3-periphery` +and import bytecode imported from artifacts located at +`@uniswap/v3-periphery/artifacts/contracts/*/*.json`. +For example: + +```typescript +import { + abi as SWAP_ROUTER_ABI, + bytecode as SWAP_ROUTER_BYTECODE, +} from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json' + +// deploy the bytecode +``` + +This will ensure that you are testing against the same bytecode that is deployed to +mainnet and public testnets, and all Uniswap code will correctly interoperate with +your local deployment. + +## Using solidity interfaces + +The Uniswap v3 periphery interfaces are available for import into solidity smart contracts +via the npm artifact `@uniswap/v3-periphery`, e.g.: + +```solidity +import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol'; + +contract MyContract { + ISwapRouter router; + + function doSomethingWithSwapRouter() { + // router.exactInput(...); + } +} + +``` diff --git a/lib/v3-periphery/audits/abdk/audit.pdf b/lib/v3-periphery/audits/abdk/audit.pdf new file mode 100644 index 0000000..3608934 Binary files /dev/null and b/lib/v3-periphery/audits/abdk/audit.pdf differ diff --git a/lib/v3-periphery/bug-bounty.md b/lib/v3-periphery/bug-bounty.md new file mode 100644 index 0000000..2fbc14f --- /dev/null +++ b/lib/v3-periphery/bug-bounty.md @@ -0,0 +1,80 @@ +# Uniswap V3 Bug Bounty + +## Overview + +Starting on April 26th, 2021, the [uniswap-v3-periphery](https://github.com/Uniswap/uniswap-v3-periphery) repository is +subject to the Uniswap V3 Bug Bounty (the “Program”) to incentivize responsible bug disclosure. + +We are limiting the scope of the Program to critical and high severity bugs, and are offering a reward of up to $500,000. Happy hunting! + +## Scope + +The scope of the Program is limited to bugs that result in the loss of user funds. + +The following are not within the scope of the Program: + +- Any contract located under [contracts/test](./contracts/test) or [contracts/lens](./contracts/lens). +- Bugs in any third party contract or platform that interacts with Uniswap V3. +- Vulnerabilities already reported and/or discovered in contracts built by third parties on Uniswap V3. +- Any already-reported bugs. + +Vulnerabilities contingent upon the occurrence of any of the following also are outside the scope of this Program: + +- Frontend bugs +- DDOS attacks +- Spamming +- Phishing +- Automated tools (Github Actions, AWS, etc.) +- Compromise or misuse of third party systems or services + +## Assumptions + +Uniswap V3 was developed with the following assumptions, and thus any bug must also adhere to the following assumptions +to be eligible for the bug bounty: + +- The total supply of any token does not exceed 2128 - 1, i.e. `type(uint128).max`. +- The `transfer` and `transferFrom` methods of any token strictly decrease the balance of the token sender by the transfer amount and increases the balance of token recipient by the transfer amount, i.e. fee on transfer tokens are excluded. +- The token balance of an address can only change due to a call to `transfer` by the sender or `transferFrom` by an approved address, i.e. rebase tokens and interest bearing tokens are excluded. + +## Rewards + +Rewards will be allocated based on the severity of the bug disclosed and will be evaluated and rewarded at the discretion of the Uniswap Labs team. +For critical bugs that lead to loss of user funds (more than 1% or user specified slippage tolerance), +rewards of up to $500,000 will be granted. Lower severity bugs will be rewarded at the discretion of the team. +In addition, all vulnerabilities disclosed prior to the mainnet launch date will be subject to receive higher rewards. + +## Disclosure + +Any vulnerability or bug discovered must be reported only to the following email: [security@uniswap.org](mailto:security@uniswap.org). + +The vulnerability must not be disclosed publicly or to any other person, entity or email address before Uniswap Labs has been notified, has fixed the issue, and has granted permission for public disclosure. In addition, disclosure must be made within 24 hours following discovery of the vulnerability. + +A detailed report of a vulnerability increases the likelihood of a reward and may increase the reward amount. Please provide as much information about the vulnerability as possible, including: + +- The conditions on which reproducing the bug is contingent. +- The steps needed to reproduce the bug or, preferably, a proof of concept. +- The potential implications of the vulnerability being abused. + +Anyone who reports a unique, previously-unreported vulnerability that results in a change to the code or a configuration change and who keeps such vulnerability confidential until it has been resolved by our engineers will be recognized publicly for their contribution if they so choose. + +## Eligibility + +To be eligible for a reward under this Program, you must: + +- Discover a previously unreported, non-public vulnerability that would result in a loss of and/or lock on any ERC-20 token on Uniswap V3 (but not on any third party platform interacting with Uniswap V3) and that is within the scope of this Program. Vulnerabilities must be distinct from the issues covered in the Trail of Bits or ABDK audits. +- Be the first to disclose the unique vulnerability to [security@uniswap.org](mailto:security@uniswap.org), in compliance with the disclosure requirements above. If similar vulnerabilities are reported within the same 24 hour period, rewards will be split at the discretion of Uniswap Labs. +- Provide sufficient information to enable our engineers to reproduce and fix the vulnerability. +- Not engage in any unlawful conduct when disclosing the bug, including through threats, demands, or any other coercive tactics. +- Not exploit the vulnerability in any way, including through making it public or by obtaining a profit (other than a reward under this Program). +- Make a good faith effort to avoid privacy violations, destruction of data, interruption or degradation of Uniswap V3. +- Submit only one vulnerability per submission, unless you need to chain vulnerabilities to provide impact regarding any of the vulnerabilities. +- Not submit a vulnerability caused by an underlying issue that is the same as an issue on which a reward has been paid under this Program. +- Not be one of our current or former employees, vendors, or contractors or an employee of any of those vendors or contractors. +- Not be subject to US sanctions or reside in a US-embargoed country. +- Be at least 18 years of age or, if younger, submit your vulnerability with the consent of your parent or guardian. + +## Other Terms + +By submitting your report, you grant Uniswap Labs any and all rights, including intellectual property rights, needed to validate, mitigate, and disclose the vulnerability. All reward decisions, including eligibility for and amounts of the rewards and the manner in which such rewards will be paid, are made at our sole discretion. + +The terms and conditions of this Program may be altered at any time. diff --git a/lib/v3-periphery/contracts/NonfungiblePositionManager.sol b/lib/v3-periphery/contracts/NonfungiblePositionManager.sol new file mode 100644 index 0000000..68532a0 --- /dev/null +++ b/lib/v3-periphery/contracts/NonfungiblePositionManager.sol @@ -0,0 +1,400 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/v3-core/contracts/libraries/FixedPoint128.sol'; +import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; + +import './interfaces/INonfungiblePositionManager.sol'; +import './interfaces/INonfungibleTokenPositionDescriptor.sol'; +import './libraries/PositionKey.sol'; +import './libraries/PoolAddress.sol'; +import './base/LiquidityManagement.sol'; +import './base/PeripheryImmutableState.sol'; +import './base/Multicall.sol'; +import './base/ERC721Permit.sol'; +import './base/PeripheryValidation.sol'; +import './base/SelfPermit.sol'; +import './base/PoolInitializer.sol'; + +/// @title NFT positions +/// @notice Wraps Uniswap V3 positions in the ERC721 non-fungible token interface +contract NonfungiblePositionManager is + INonfungiblePositionManager, + Multicall, + ERC721Permit, + PeripheryImmutableState, + PoolInitializer, + LiquidityManagement, + PeripheryValidation, + SelfPermit +{ + // details about the uniswap position + struct Position { + // the nonce for permits + uint96 nonce; + // the address that is approved for spending this token + address operator; + // the ID of the pool with which this token is connected + uint80 poolId; + // the tick range of the position + int24 tickLower; + int24 tickUpper; + // the liquidity of the position + uint128 liquidity; + // the fee growth of the aggregate position as of the last action on the individual position + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + // how many uncollected tokens are owed to the position, as of the last computation + uint128 tokensOwed0; + uint128 tokensOwed1; + } + + /// @dev IDs of pools assigned by this contract + mapping(address => uint80) private _poolIds; + + /// @dev Pool keys by pool ID, to save on SSTOREs for position data + mapping(uint80 => PoolAddress.PoolKey) private _poolIdToPoolKey; + + /// @dev The token ID position data + mapping(uint256 => Position) private _positions; + + /// @dev The ID of the next token that will be minted. Skips 0 + uint176 private _nextId = 1; + /// @dev The ID of the next pool that is used for the first time. Skips 0 + uint80 private _nextPoolId = 1; + + /// @dev The address of the token descriptor contract, which handles generating token URIs for position tokens + address private immutable _tokenDescriptor; + + constructor( + address _factory, + address _WETH9, + address _tokenDescriptor_ + ) ERC721Permit('Uniswap V3 Positions NFT-V1', 'UNI-V3-POS', '1') PeripheryImmutableState(_factory, _WETH9) { + _tokenDescriptor = _tokenDescriptor_; + } + + /// @inheritdoc INonfungiblePositionManager + function positions(uint256 tokenId) + external + view + override + returns ( + uint96 nonce, + address operator, + address token0, + address token1, + uint24 fee, + int24 tickLower, + int24 tickUpper, + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ) + { + Position memory position = _positions[tokenId]; + require(position.poolId != 0, 'Invalid token ID'); + PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; + return ( + position.nonce, + position.operator, + poolKey.token0, + poolKey.token1, + poolKey.fee, + position.tickLower, + position.tickUpper, + position.liquidity, + position.feeGrowthInside0LastX128, + position.feeGrowthInside1LastX128, + position.tokensOwed0, + position.tokensOwed1 + ); + } + + /// @dev Caches a pool key + function cachePoolKey(address pool, PoolAddress.PoolKey memory poolKey) private returns (uint80 poolId) { + poolId = _poolIds[pool]; + if (poolId == 0) { + _poolIds[pool] = (poolId = _nextPoolId++); + _poolIdToPoolKey[poolId] = poolKey; + } + } + + /// @inheritdoc INonfungiblePositionManager + function mint(MintParams calldata params) + external + payable + override + checkDeadline(params.deadline) + returns ( + uint256 tokenId, + uint128 liquidity, + uint256 amount0, + uint256 amount1 + ) + { + IUniswapV3Pool pool; + (liquidity, amount0, amount1, pool) = addLiquidity( + AddLiquidityParams({ + token0: params.token0, + token1: params.token1, + fee: params.fee, + recipient: address(this), + tickLower: params.tickLower, + tickUpper: params.tickUpper, + amount0Desired: params.amount0Desired, + amount1Desired: params.amount1Desired, + amount0Min: params.amount0Min, + amount1Min: params.amount1Min + }) + ); + + _mint(params.recipient, (tokenId = _nextId++)); + + bytes32 positionKey = PositionKey.compute(address(this), params.tickLower, params.tickUpper); + (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); + + // idempotent set + uint80 poolId = + cachePoolKey( + address(pool), + PoolAddress.PoolKey({token0: params.token0, token1: params.token1, fee: params.fee}) + ); + + _positions[tokenId] = Position({ + nonce: 0, + operator: address(0), + poolId: poolId, + tickLower: params.tickLower, + tickUpper: params.tickUpper, + liquidity: liquidity, + feeGrowthInside0LastX128: feeGrowthInside0LastX128, + feeGrowthInside1LastX128: feeGrowthInside1LastX128, + tokensOwed0: 0, + tokensOwed1: 0 + }); + + emit IncreaseLiquidity(tokenId, liquidity, amount0, amount1); + } + + modifier isAuthorizedForToken(uint256 tokenId) { + require(_isApprovedOrOwner(msg.sender, tokenId), 'Not approved'); + _; + } + + function tokenURI(uint256 tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) { + require(_exists(tokenId)); + return INonfungibleTokenPositionDescriptor(_tokenDescriptor).tokenURI(this, tokenId); + } + + // save bytecode by removing implementation of unused method + function baseURI() public pure override returns (string memory) {} + + /// @inheritdoc INonfungiblePositionManager + function increaseLiquidity(IncreaseLiquidityParams calldata params) + external + payable + override + checkDeadline(params.deadline) + returns ( + uint128 liquidity, + uint256 amount0, + uint256 amount1 + ) + { + Position storage position = _positions[params.tokenId]; + + PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; + + IUniswapV3Pool pool; + (liquidity, amount0, amount1, pool) = addLiquidity( + AddLiquidityParams({ + token0: poolKey.token0, + token1: poolKey.token1, + fee: poolKey.fee, + tickLower: position.tickLower, + tickUpper: position.tickUpper, + amount0Desired: params.amount0Desired, + amount1Desired: params.amount1Desired, + amount0Min: params.amount0Min, + amount1Min: params.amount1Min, + recipient: address(this) + }) + ); + + bytes32 positionKey = PositionKey.compute(address(this), position.tickLower, position.tickUpper); + + // this is now updated to the current transaction + (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); + + position.tokensOwed0 += uint128( + FullMath.mulDiv( + feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, + position.liquidity, + FixedPoint128.Q128 + ) + ); + position.tokensOwed1 += uint128( + FullMath.mulDiv( + feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, + position.liquidity, + FixedPoint128.Q128 + ) + ); + + position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; + position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; + position.liquidity += liquidity; + + emit IncreaseLiquidity(params.tokenId, liquidity, amount0, amount1); + } + + /// @inheritdoc INonfungiblePositionManager + function decreaseLiquidity(DecreaseLiquidityParams calldata params) + external + payable + override + isAuthorizedForToken(params.tokenId) + checkDeadline(params.deadline) + returns (uint256 amount0, uint256 amount1) + { + require(params.liquidity > 0); + Position storage position = _positions[params.tokenId]; + + uint128 positionLiquidity = position.liquidity; + require(positionLiquidity >= params.liquidity); + + PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; + IUniswapV3Pool pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); + (amount0, amount1) = pool.burn(position.tickLower, position.tickUpper, params.liquidity); + + require(amount0 >= params.amount0Min && amount1 >= params.amount1Min, 'Price slippage check'); + + bytes32 positionKey = PositionKey.compute(address(this), position.tickLower, position.tickUpper); + // this is now updated to the current transaction + (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool.positions(positionKey); + + position.tokensOwed0 += + uint128(amount0) + + uint128( + FullMath.mulDiv( + feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, + positionLiquidity, + FixedPoint128.Q128 + ) + ); + position.tokensOwed1 += + uint128(amount1) + + uint128( + FullMath.mulDiv( + feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, + positionLiquidity, + FixedPoint128.Q128 + ) + ); + + position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; + position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; + // subtraction is safe because we checked positionLiquidity is gte params.liquidity + position.liquidity = positionLiquidity - params.liquidity; + + emit DecreaseLiquidity(params.tokenId, params.liquidity, amount0, amount1); + } + + /// @inheritdoc INonfungiblePositionManager + function collect(CollectParams calldata params) + external + payable + override + isAuthorizedForToken(params.tokenId) + returns (uint256 amount0, uint256 amount1) + { + require(params.amount0Max > 0 || params.amount1Max > 0); + // allow collecting to the nft position manager address with address 0 + address recipient = params.recipient == address(0) ? address(this) : params.recipient; + + Position storage position = _positions[params.tokenId]; + + PoolAddress.PoolKey memory poolKey = _poolIdToPoolKey[position.poolId]; + + IUniswapV3Pool pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); + + (uint128 tokensOwed0, uint128 tokensOwed1) = (position.tokensOwed0, position.tokensOwed1); + + // trigger an update of the position fees owed and fee growth snapshots if it has any liquidity + if (position.liquidity > 0) { + pool.burn(position.tickLower, position.tickUpper, 0); + (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = + pool.positions(PositionKey.compute(address(this), position.tickLower, position.tickUpper)); + + tokensOwed0 += uint128( + FullMath.mulDiv( + feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128, + position.liquidity, + FixedPoint128.Q128 + ) + ); + tokensOwed1 += uint128( + FullMath.mulDiv( + feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128, + position.liquidity, + FixedPoint128.Q128 + ) + ); + + position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128; + position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128; + } + + // compute the arguments to give to the pool#collect method + (uint128 amount0Collect, uint128 amount1Collect) = + ( + params.amount0Max > tokensOwed0 ? tokensOwed0 : params.amount0Max, + params.amount1Max > tokensOwed1 ? tokensOwed1 : params.amount1Max + ); + + // the actual amounts collected are returned + (amount0, amount1) = pool.collect( + recipient, + position.tickLower, + position.tickUpper, + amount0Collect, + amount1Collect + ); + + // sometimes there will be a few less wei than expected due to rounding down in core, but we just subtract the full amount expected + // instead of the actual amount so we can burn the token + (position.tokensOwed0, position.tokensOwed1) = (tokensOwed0 - amount0Collect, tokensOwed1 - amount1Collect); + + emit Collect(params.tokenId, recipient, amount0Collect, amount1Collect); + } + + /// @inheritdoc INonfungiblePositionManager + function burn(uint256 tokenId) external payable override isAuthorizedForToken(tokenId) { + Position storage position = _positions[tokenId]; + require(position.liquidity == 0 && position.tokensOwed0 == 0 && position.tokensOwed1 == 0, 'Not cleared'); + delete _positions[tokenId]; + _burn(tokenId); + } + + function _getAndIncrementNonce(uint256 tokenId) internal override returns (uint256) { + return uint256(_positions[tokenId].nonce++); + } + + /// @inheritdoc IERC721 + function getApproved(uint256 tokenId) public view override(ERC721, IERC721) returns (address) { + require(_exists(tokenId), 'ERC721: approved query for nonexistent token'); + + return _positions[tokenId].operator; + } + + /// @dev Overrides _approve to use the operator in the position, which is packed with the position permit nonce + function _approve(address to, uint256 tokenId) internal override(ERC721) { + _positions[tokenId].operator = to; + emit Approval(ownerOf(tokenId), to, tokenId); + } +} diff --git a/lib/v3-periphery/contracts/NonfungibleTokenPositionDescriptor.sol b/lib/v3-periphery/contracts/NonfungibleTokenPositionDescriptor.sol new file mode 100644 index 0000000..a8c1628 --- /dev/null +++ b/lib/v3-periphery/contracts/NonfungibleTokenPositionDescriptor.sol @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/lib/contracts/libraries/SafeERC20Namer.sol'; + +import './libraries/ChainId.sol'; +import './interfaces/INonfungiblePositionManager.sol'; +import './interfaces/INonfungibleTokenPositionDescriptor.sol'; +import './interfaces/IERC20Metadata.sol'; +import './libraries/PoolAddress.sol'; +import './libraries/NFTDescriptor.sol'; +import './libraries/TokenRatioSortOrder.sol'; + +/// @title Describes NFT token positions +/// @notice Produces a string containing the data URI for a JSON metadata string +contract NonfungibleTokenPositionDescriptor is INonfungibleTokenPositionDescriptor { + address private constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F; + address private constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; + address private constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7; + address private constant TBTC = 0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa; + address private constant WBTC = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599; + + address public immutable WETH9; + /// @dev A null-terminated string + bytes32 public immutable nativeCurrencyLabelBytes; + + constructor(address _WETH9, bytes32 _nativeCurrencyLabelBytes) { + WETH9 = _WETH9; + nativeCurrencyLabelBytes = _nativeCurrencyLabelBytes; + } + + /// @notice Returns the native currency label as a string + function nativeCurrencyLabel() public view returns (string memory) { + uint256 len = 0; + while (len < 32 && nativeCurrencyLabelBytes[len] != 0) { + len++; + } + bytes memory b = new bytes(len); + for (uint256 i = 0; i < len; i++) { + b[i] = nativeCurrencyLabelBytes[i]; + } + return string(b); + } + + /// @inheritdoc INonfungibleTokenPositionDescriptor + function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId) + external + view + override + returns (string memory) + { + (, , address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, , , , , ) = + positionManager.positions(tokenId); + + IUniswapV3Pool pool = + IUniswapV3Pool( + PoolAddress.computeAddress( + positionManager.factory(), + PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee}) + ) + ); + + bool _flipRatio = flipRatio(token0, token1, ChainId.get()); + address quoteTokenAddress = !_flipRatio ? token1 : token0; + address baseTokenAddress = !_flipRatio ? token0 : token1; + (, int24 tick, , , , , ) = pool.slot0(); + + return + NFTDescriptor.constructTokenURI( + NFTDescriptor.ConstructTokenURIParams({ + tokenId: tokenId, + quoteTokenAddress: quoteTokenAddress, + baseTokenAddress: baseTokenAddress, + quoteTokenSymbol: quoteTokenAddress == WETH9 + ? nativeCurrencyLabel() + : SafeERC20Namer.tokenSymbol(quoteTokenAddress), + baseTokenSymbol: baseTokenAddress == WETH9 + ? nativeCurrencyLabel() + : SafeERC20Namer.tokenSymbol(baseTokenAddress), + quoteTokenDecimals: IERC20Metadata(quoteTokenAddress).decimals(), + baseTokenDecimals: IERC20Metadata(baseTokenAddress).decimals(), + flipRatio: _flipRatio, + tickLower: tickLower, + tickUpper: tickUpper, + tickCurrent: tick, + tickSpacing: pool.tickSpacing(), + fee: fee, + poolAddress: address(pool) + }) + ); + } + + function flipRatio( + address token0, + address token1, + uint256 chainId + ) public view returns (bool) { + return tokenRatioPriority(token0, chainId) > tokenRatioPriority(token1, chainId); + } + + function tokenRatioPriority(address token, uint256 chainId) public view returns (int256) { + if (token == WETH9) { + return TokenRatioSortOrder.DENOMINATOR; + } + if (chainId == 1) { + if (token == USDC) { + return TokenRatioSortOrder.NUMERATOR_MOST; + } else if (token == USDT) { + return TokenRatioSortOrder.NUMERATOR_MORE; + } else if (token == DAI) { + return TokenRatioSortOrder.NUMERATOR; + } else if (token == TBTC) { + return TokenRatioSortOrder.DENOMINATOR_MORE; + } else if (token == WBTC) { + return TokenRatioSortOrder.DENOMINATOR_MOST; + } else { + return 0; + } + } + return 0; + } +} diff --git a/lib/v3-periphery/contracts/SwapRouter.sol b/lib/v3-periphery/contracts/SwapRouter.sol new file mode 100644 index 0000000..0b14d56 --- /dev/null +++ b/lib/v3-periphery/contracts/SwapRouter.sol @@ -0,0 +1,244 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/libraries/SafeCast.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +import './interfaces/ISwapRouter.sol'; +import './base/PeripheryImmutableState.sol'; +import './base/PeripheryValidation.sol'; +import './base/PeripheryPaymentsWithFee.sol'; +import './base/Multicall.sol'; +import './base/SelfPermit.sol'; +import './libraries/Path.sol'; +import './libraries/PoolAddress.sol'; +import './libraries/CallbackValidation.sol'; +import './interfaces/external/IWETH9.sol'; + +/// @title Uniswap V3 Swap Router +/// @notice Router for stateless execution of swaps against Uniswap V3 +contract SwapRouter is + ISwapRouter, + PeripheryImmutableState, + PeripheryValidation, + PeripheryPaymentsWithFee, + Multicall, + SelfPermit +{ + using Path for bytes; + using SafeCast for uint256; + + /// @dev Used as the placeholder value for amountInCached, because the computed amount in for an exact output swap + /// can never actually be this value + uint256 private constant DEFAULT_AMOUNT_IN_CACHED = type(uint256).max; + + /// @dev Transient storage variable used for returning the computed amount in for an exact output swap. + uint256 private amountInCached = DEFAULT_AMOUNT_IN_CACHED; + + constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {} + + /// @dev Returns the pool for the given token pair and fee. The pool contract may or may not exist. + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) private view returns (IUniswapV3Pool) { + return IUniswapV3Pool(PoolAddress.computeAddress(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee))); + } + + struct SwapCallbackData { + bytes path; + address payer; + } + + /// @inheritdoc IUniswapV3SwapCallback + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata _data + ) external override { + require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported + SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData)); + (address tokenIn, address tokenOut, uint24 fee) = data.path.decodeFirstPool(); + CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); + + (bool isExactInput, uint256 amountToPay) = + amount0Delta > 0 + ? (tokenIn < tokenOut, uint256(amount0Delta)) + : (tokenOut < tokenIn, uint256(amount1Delta)); + if (isExactInput) { + pay(tokenIn, data.payer, msg.sender, amountToPay); + } else { + // either initiate the next swap or pay + if (data.path.hasMultiplePools()) { + data.path = data.path.skipToken(); + exactOutputInternal(amountToPay, msg.sender, 0, data); + } else { + amountInCached = amountToPay; + tokenIn = tokenOut; // swap in/out because exact output swaps are reversed + pay(tokenIn, data.payer, msg.sender, amountToPay); + } + } + } + + /// @dev Performs a single exact input swap + function exactInputInternal( + uint256 amountIn, + address recipient, + uint160 sqrtPriceLimitX96, + SwapCallbackData memory data + ) private returns (uint256 amountOut) { + // allow swapping to the router address with address 0 + if (recipient == address(0)) recipient = address(this); + + (address tokenIn, address tokenOut, uint24 fee) = data.path.decodeFirstPool(); + + bool zeroForOne = tokenIn < tokenOut; + + (int256 amount0, int256 amount1) = + getPool(tokenIn, tokenOut, fee).swap( + recipient, + zeroForOne, + amountIn.toInt256(), + sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : sqrtPriceLimitX96, + abi.encode(data) + ); + + return uint256(-(zeroForOne ? amount1 : amount0)); + } + + /// @inheritdoc ISwapRouter + function exactInputSingle(ExactInputSingleParams calldata params) + external + payable + override + checkDeadline(params.deadline) + returns (uint256 amountOut) + { + amountOut = exactInputInternal( + params.amountIn, + params.recipient, + params.sqrtPriceLimitX96, + SwapCallbackData({path: abi.encodePacked(params.tokenIn, params.fee, params.tokenOut), payer: msg.sender}) + ); + require(amountOut >= params.amountOutMinimum, 'Too little received'); + } + + /// @inheritdoc ISwapRouter + function exactInput(ExactInputParams memory params) + external + payable + override + checkDeadline(params.deadline) + returns (uint256 amountOut) + { + address payer = msg.sender; // msg.sender pays for the first hop + + while (true) { + bool hasMultiplePools = params.path.hasMultiplePools(); + + // the outputs of prior swaps become the inputs to subsequent ones + params.amountIn = exactInputInternal( + params.amountIn, + hasMultiplePools ? address(this) : params.recipient, // for intermediate swaps, this contract custodies + 0, + SwapCallbackData({ + path: params.path.getFirstPool(), // only the first pool in the path is necessary + payer: payer + }) + ); + + // decide whether to continue or terminate + if (hasMultiplePools) { + payer = address(this); // at this point, the caller has paid + params.path = params.path.skipToken(); + } else { + amountOut = params.amountIn; + break; + } + } + + require(amountOut >= params.amountOutMinimum, 'Too little received'); + } + + /// @dev Performs a single exact output swap + function exactOutputInternal( + uint256 amountOut, + address recipient, + uint160 sqrtPriceLimitX96, + SwapCallbackData memory data + ) private returns (uint256 amountIn) { + // allow swapping to the router address with address 0 + if (recipient == address(0)) recipient = address(this); + + (address tokenOut, address tokenIn, uint24 fee) = data.path.decodeFirstPool(); + + bool zeroForOne = tokenIn < tokenOut; + + (int256 amount0Delta, int256 amount1Delta) = + getPool(tokenIn, tokenOut, fee).swap( + recipient, + zeroForOne, + -amountOut.toInt256(), + sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : sqrtPriceLimitX96, + abi.encode(data) + ); + + uint256 amountOutReceived; + (amountIn, amountOutReceived) = zeroForOne + ? (uint256(amount0Delta), uint256(-amount1Delta)) + : (uint256(amount1Delta), uint256(-amount0Delta)); + // it's technically possible to not receive the full output amount, + // so if no price limit has been specified, require this possibility away + if (sqrtPriceLimitX96 == 0) require(amountOutReceived == amountOut); + } + + /// @inheritdoc ISwapRouter + function exactOutputSingle(ExactOutputSingleParams calldata params) + external + payable + override + checkDeadline(params.deadline) + returns (uint256 amountIn) + { + // avoid an SLOAD by using the swap return data + amountIn = exactOutputInternal( + params.amountOut, + params.recipient, + params.sqrtPriceLimitX96, + SwapCallbackData({path: abi.encodePacked(params.tokenOut, params.fee, params.tokenIn), payer: msg.sender}) + ); + + require(amountIn <= params.amountInMaximum, 'Too much requested'); + // has to be reset even though we don't use it in the single hop case + amountInCached = DEFAULT_AMOUNT_IN_CACHED; + } + + /// @inheritdoc ISwapRouter + function exactOutput(ExactOutputParams calldata params) + external + payable + override + checkDeadline(params.deadline) + returns (uint256 amountIn) + { + // it's okay that the payer is fixed to msg.sender here, as they're only paying for the "final" exact output + // swap, which happens first, and subsequent swaps are paid for within nested callback frames + exactOutputInternal( + params.amountOut, + params.recipient, + 0, + SwapCallbackData({path: params.path, payer: msg.sender}) + ); + + amountIn = amountInCached; + require(amountIn <= params.amountInMaximum, 'Too much requested'); + amountInCached = DEFAULT_AMOUNT_IN_CACHED; + } +} diff --git a/lib/v3-periphery/contracts/V3Migrator.sol b/lib/v3-periphery/contracts/V3Migrator.sol new file mode 100644 index 0000000..e0376e2 --- /dev/null +++ b/lib/v3-periphery/contracts/V3Migrator.sol @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol'; +import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; + +import './interfaces/INonfungiblePositionManager.sol'; + +import './libraries/TransferHelper.sol'; + +import './interfaces/IV3Migrator.sol'; +import './base/PeripheryImmutableState.sol'; +import './base/Multicall.sol'; +import './base/SelfPermit.sol'; +import './interfaces/external/IWETH9.sol'; +import './base/PoolInitializer.sol'; + +/// @title Uniswap V3 Migrator +contract V3Migrator is IV3Migrator, PeripheryImmutableState, PoolInitializer, Multicall, SelfPermit { + using LowGasSafeMath for uint256; + + address public immutable nonfungiblePositionManager; + + constructor( + address _factory, + address _WETH9, + address _nonfungiblePositionManager + ) PeripheryImmutableState(_factory, _WETH9) { + nonfungiblePositionManager = _nonfungiblePositionManager; + } + + receive() external payable { + require(msg.sender == WETH9, 'Not WETH9'); + } + + function migrate(MigrateParams calldata params) external override { + require(params.percentageToMigrate > 0, 'Percentage too small'); + require(params.percentageToMigrate <= 100, 'Percentage too large'); + + // burn v2 liquidity to this address + IUniswapV2Pair(params.pair).transferFrom(msg.sender, params.pair, params.liquidityToMigrate); + (uint256 amount0V2, uint256 amount1V2) = IUniswapV2Pair(params.pair).burn(address(this)); + + // calculate the amounts to migrate to v3 + uint256 amount0V2ToMigrate = amount0V2.mul(params.percentageToMigrate) / 100; + uint256 amount1V2ToMigrate = amount1V2.mul(params.percentageToMigrate) / 100; + + // approve the position manager up to the maximum token amounts + TransferHelper.safeApprove(params.token0, nonfungiblePositionManager, amount0V2ToMigrate); + TransferHelper.safeApprove(params.token1, nonfungiblePositionManager, amount1V2ToMigrate); + + // mint v3 position + (, , uint256 amount0V3, uint256 amount1V3) = + INonfungiblePositionManager(nonfungiblePositionManager).mint( + INonfungiblePositionManager.MintParams({ + token0: params.token0, + token1: params.token1, + fee: params.fee, + tickLower: params.tickLower, + tickUpper: params.tickUpper, + amount0Desired: amount0V2ToMigrate, + amount1Desired: amount1V2ToMigrate, + amount0Min: params.amount0Min, + amount1Min: params.amount1Min, + recipient: params.recipient, + deadline: params.deadline + }) + ); + + // if necessary, clear allowance and refund dust + if (amount0V3 < amount0V2) { + if (amount0V3 < amount0V2ToMigrate) { + TransferHelper.safeApprove(params.token0, nonfungiblePositionManager, 0); + } + + uint256 refund0 = amount0V2 - amount0V3; + if (params.refundAsETH && params.token0 == WETH9) { + IWETH9(WETH9).withdraw(refund0); + TransferHelper.safeTransferETH(msg.sender, refund0); + } else { + TransferHelper.safeTransfer(params.token0, msg.sender, refund0); + } + } + if (amount1V3 < amount1V2) { + if (amount1V3 < amount1V2ToMigrate) { + TransferHelper.safeApprove(params.token1, nonfungiblePositionManager, 0); + } + + uint256 refund1 = amount1V2 - amount1V3; + if (params.refundAsETH && params.token1 == WETH9) { + IWETH9(WETH9).withdraw(refund1); + TransferHelper.safeTransferETH(msg.sender, refund1); + } else { + TransferHelper.safeTransfer(params.token1, msg.sender, refund1); + } + } + } +} diff --git a/lib/v3-periphery/contracts/base/BlockTimestamp.sol b/lib/v3-periphery/contracts/base/BlockTimestamp.sol new file mode 100644 index 0000000..ac05cac --- /dev/null +++ b/lib/v3-periphery/contracts/base/BlockTimestamp.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +/// @title Function for getting block timestamp +/// @dev Base contract that is overridden for tests +abstract contract BlockTimestamp { + /// @dev Method that exists purely to be overridden for tests + /// @return The current block timestamp + function _blockTimestamp() internal view virtual returns (uint256) { + return block.timestamp; + } +} diff --git a/lib/v3-periphery/contracts/base/ERC721Permit.sol b/lib/v3-periphery/contracts/base/ERC721Permit.sol new file mode 100644 index 0000000..efe0f54 --- /dev/null +++ b/lib/v3-periphery/contracts/base/ERC721Permit.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; +import '@openzeppelin/contracts/utils/Address.sol'; + +import '../libraries/ChainId.sol'; +import '../interfaces/external/IERC1271.sol'; +import '../interfaces/IERC721Permit.sol'; +import './BlockTimestamp.sol'; + +/// @title ERC721 with permit +/// @notice Nonfungible tokens that support an approve via signature, i.e. permit +abstract contract ERC721Permit is BlockTimestamp, ERC721, IERC721Permit { + /// @dev Gets the current nonce for a token ID and then increments it, returning the original value + function _getAndIncrementNonce(uint256 tokenId) internal virtual returns (uint256); + + /// @dev The hash of the name used in the permit signature verification + bytes32 private immutable nameHash; + + /// @dev The hash of the version string used in the permit signature verification + bytes32 private immutable versionHash; + + /// @notice Computes the nameHash and versionHash + constructor( + string memory name_, + string memory symbol_, + string memory version_ + ) ERC721(name_, symbol_) { + nameHash = keccak256(bytes(name_)); + versionHash = keccak256(bytes(version_)); + } + + /// @inheritdoc IERC721Permit + function DOMAIN_SEPARATOR() public view override returns (bytes32) { + return + keccak256( + abi.encode( + // keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)') + 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f, + nameHash, + versionHash, + ChainId.get(), + address(this) + ) + ); + } + + /// @inheritdoc IERC721Permit + /// @dev Value is equal to keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"); + bytes32 public constant override PERMIT_TYPEHASH = + 0x49ecf333e5b8c95c40fdafc95c1ad136e8914a8fb55e9dc8bb01eaa83a2df9ad; + + /// @inheritdoc IERC721Permit + function permit( + address spender, + uint256 tokenId, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external payable override { + require(_blockTimestamp() <= deadline, 'Permit expired'); + + bytes32 digest = + keccak256( + abi.encodePacked( + '\x19\x01', + DOMAIN_SEPARATOR(), + keccak256(abi.encode(PERMIT_TYPEHASH, spender, tokenId, _getAndIncrementNonce(tokenId), deadline)) + ) + ); + address owner = ownerOf(tokenId); + require(spender != owner, 'ERC721Permit: approval to current owner'); + + if (Address.isContract(owner)) { + require(IERC1271(owner).isValidSignature(digest, abi.encodePacked(r, s, v)) == 0x1626ba7e, 'Unauthorized'); + } else { + address recoveredAddress = ecrecover(digest, v, r, s); + require(recoveredAddress != address(0), 'Invalid signature'); + require(recoveredAddress == owner, 'Unauthorized'); + } + + _approve(spender, tokenId); + } +} diff --git a/lib/v3-periphery/contracts/base/LiquidityManagement.sol b/lib/v3-periphery/contracts/base/LiquidityManagement.sol new file mode 100644 index 0000000..0301b39 --- /dev/null +++ b/lib/v3-periphery/contracts/base/LiquidityManagement.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol'; +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; + +import '../libraries/PoolAddress.sol'; +import '../libraries/CallbackValidation.sol'; +import '../libraries/LiquidityAmounts.sol'; + +import './PeripheryPayments.sol'; +import './PeripheryImmutableState.sol'; + +/// @title Liquidity management functions +/// @notice Internal functions for safely managing liquidity in Uniswap V3 +abstract contract LiquidityManagement is IUniswapV3MintCallback, PeripheryImmutableState, PeripheryPayments { + struct MintCallbackData { + PoolAddress.PoolKey poolKey; + address payer; + } + + /// @inheritdoc IUniswapV3MintCallback + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external override { + MintCallbackData memory decoded = abi.decode(data, (MintCallbackData)); + CallbackValidation.verifyCallback(factory, decoded.poolKey); + + if (amount0Owed > 0) pay(decoded.poolKey.token0, decoded.payer, msg.sender, amount0Owed); + if (amount1Owed > 0) pay(decoded.poolKey.token1, decoded.payer, msg.sender, amount1Owed); + } + + struct AddLiquidityParams { + address token0; + address token1; + uint24 fee; + address recipient; + int24 tickLower; + int24 tickUpper; + uint256 amount0Desired; + uint256 amount1Desired; + uint256 amount0Min; + uint256 amount1Min; + } + + /// @notice Add liquidity to an initialized pool + function addLiquidity(AddLiquidityParams memory params) + internal + returns ( + uint128 liquidity, + uint256 amount0, + uint256 amount1, + IUniswapV3Pool pool + ) + { + PoolAddress.PoolKey memory poolKey = + PoolAddress.PoolKey({token0: params.token0, token1: params.token1, fee: params.fee}); + + pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); + + // compute the liquidity amount + { + (uint160 sqrtPriceX96, , , , , , ) = pool.slot0(); + uint160 sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(params.tickLower); + uint160 sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(params.tickUpper); + + liquidity = LiquidityAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtRatioAX96, + sqrtRatioBX96, + params.amount0Desired, + params.amount1Desired + ); + } + + (amount0, amount1) = pool.mint( + params.recipient, + params.tickLower, + params.tickUpper, + liquidity, + abi.encode(MintCallbackData({poolKey: poolKey, payer: msg.sender})) + ); + + require(amount0 >= params.amount0Min && amount1 >= params.amount1Min, 'Price slippage check'); + } +} diff --git a/lib/v3-periphery/contracts/base/Multicall.sol b/lib/v3-periphery/contracts/base/Multicall.sol new file mode 100644 index 0000000..5a6384d --- /dev/null +++ b/lib/v3-periphery/contracts/base/Multicall.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../interfaces/IMulticall.sol'; + +/// @title Multicall +/// @notice Enables calling multiple methods in a single call to the contract +abstract contract Multicall is IMulticall { + /// @inheritdoc IMulticall + function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) { + results = new bytes[](data.length); + for (uint256 i = 0; i < data.length; i++) { + (bool success, bytes memory result) = address(this).delegatecall(data[i]); + + if (!success) { + // Next 5 lines from https://ethereum.stackexchange.com/a/83577 + if (result.length < 68) revert(); + assembly { + result := add(result, 0x04) + } + revert(abi.decode(result, (string))); + } + + results[i] = result; + } + } +} diff --git a/lib/v3-periphery/contracts/base/PeripheryImmutableState.sol b/lib/v3-periphery/contracts/base/PeripheryImmutableState.sol new file mode 100644 index 0000000..75267a4 --- /dev/null +++ b/lib/v3-periphery/contracts/base/PeripheryImmutableState.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '../interfaces/IPeripheryImmutableState.sol'; + +/// @title Immutable state +/// @notice Immutable state used by periphery contracts +abstract contract PeripheryImmutableState is IPeripheryImmutableState { + /// @inheritdoc IPeripheryImmutableState + address public immutable override factory; + /// @inheritdoc IPeripheryImmutableState + address public immutable override WETH9; + + constructor(address _factory, address _WETH9) { + factory = _factory; + WETH9 = _WETH9; + } +} diff --git a/lib/v3-periphery/contracts/base/PeripheryPayments.sol b/lib/v3-periphery/contracts/base/PeripheryPayments.sol new file mode 100644 index 0000000..8651e3e --- /dev/null +++ b/lib/v3-periphery/contracts/base/PeripheryPayments.sol @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; + +import '../interfaces/IPeripheryPayments.sol'; +import '../interfaces/external/IWETH9.sol'; + +import '../libraries/TransferHelper.sol'; + +import './PeripheryImmutableState.sol'; + +abstract contract PeripheryPayments is IPeripheryPayments, PeripheryImmutableState { + receive() external payable { + require(msg.sender == WETH9, 'Not WETH9'); + } + + /// @inheritdoc IPeripheryPayments + function unwrapWETH9(uint256 amountMinimum, address recipient) public payable override { + uint256 balanceWETH9 = IWETH9(WETH9).balanceOf(address(this)); + require(balanceWETH9 >= amountMinimum, 'Insufficient WETH9'); + + if (balanceWETH9 > 0) { + IWETH9(WETH9).withdraw(balanceWETH9); + TransferHelper.safeTransferETH(recipient, balanceWETH9); + } + } + + /// @inheritdoc IPeripheryPayments + function sweepToken( + address token, + uint256 amountMinimum, + address recipient + ) public payable override { + uint256 balanceToken = IERC20(token).balanceOf(address(this)); + require(balanceToken >= amountMinimum, 'Insufficient token'); + + if (balanceToken > 0) { + TransferHelper.safeTransfer(token, recipient, balanceToken); + } + } + + /// @inheritdoc IPeripheryPayments + function refundETH() external payable override { + if (address(this).balance > 0) TransferHelper.safeTransferETH(msg.sender, address(this).balance); + } + + /// @param token The token to pay + /// @param payer The entity that must pay + /// @param recipient The entity that will receive payment + /// @param value The amount to pay + function pay( + address token, + address payer, + address recipient, + uint256 value + ) internal { + if (token == WETH9 && address(this).balance >= value) { + // pay with WETH9 + IWETH9(WETH9).deposit{value: value}(); // wrap only what is needed to pay + IWETH9(WETH9).transfer(recipient, value); + } else if (payer == address(this)) { + // pay with tokens already in the contract (for the exact input multihop case) + TransferHelper.safeTransfer(token, recipient, value); + } else { + // pull payment + TransferHelper.safeTransferFrom(token, payer, recipient, value); + } + } +} diff --git a/lib/v3-periphery/contracts/base/PeripheryPaymentsWithFee.sol b/lib/v3-periphery/contracts/base/PeripheryPaymentsWithFee.sol new file mode 100644 index 0000000..b7b1a31 --- /dev/null +++ b/lib/v3-periphery/contracts/base/PeripheryPaymentsWithFee.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import '@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol'; + +import './PeripheryPayments.sol'; +import '../interfaces/IPeripheryPaymentsWithFee.sol'; + +import '../interfaces/external/IWETH9.sol'; +import '../libraries/TransferHelper.sol'; + +abstract contract PeripheryPaymentsWithFee is PeripheryPayments, IPeripheryPaymentsWithFee { + using LowGasSafeMath for uint256; + + /// @inheritdoc IPeripheryPaymentsWithFee + function unwrapWETH9WithFee( + uint256 amountMinimum, + address recipient, + uint256 feeBips, + address feeRecipient + ) public payable override { + require(feeBips > 0 && feeBips <= 100); + + uint256 balanceWETH9 = IWETH9(WETH9).balanceOf(address(this)); + require(balanceWETH9 >= amountMinimum, 'Insufficient WETH9'); + + if (balanceWETH9 > 0) { + IWETH9(WETH9).withdraw(balanceWETH9); + uint256 feeAmount = balanceWETH9.mul(feeBips) / 10_000; + if (feeAmount > 0) TransferHelper.safeTransferETH(feeRecipient, feeAmount); + TransferHelper.safeTransferETH(recipient, balanceWETH9 - feeAmount); + } + } + + /// @inheritdoc IPeripheryPaymentsWithFee + function sweepTokenWithFee( + address token, + uint256 amountMinimum, + address recipient, + uint256 feeBips, + address feeRecipient + ) public payable override { + require(feeBips > 0 && feeBips <= 100); + + uint256 balanceToken = IERC20(token).balanceOf(address(this)); + require(balanceToken >= amountMinimum, 'Insufficient token'); + + if (balanceToken > 0) { + uint256 feeAmount = balanceToken.mul(feeBips) / 10_000; + if (feeAmount > 0) TransferHelper.safeTransfer(token, feeRecipient, feeAmount); + TransferHelper.safeTransfer(token, recipient, balanceToken - feeAmount); + } + } +} diff --git a/lib/v3-periphery/contracts/base/PeripheryValidation.sol b/lib/v3-periphery/contracts/base/PeripheryValidation.sol new file mode 100644 index 0000000..40fadd7 --- /dev/null +++ b/lib/v3-periphery/contracts/base/PeripheryValidation.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import './BlockTimestamp.sol'; + +abstract contract PeripheryValidation is BlockTimestamp { + modifier checkDeadline(uint256 deadline) { + require(_blockTimestamp() <= deadline, 'Transaction too old'); + _; + } +} diff --git a/lib/v3-periphery/contracts/base/PoolInitializer.sol b/lib/v3-periphery/contracts/base/PoolInitializer.sol new file mode 100644 index 0000000..af8e43e --- /dev/null +++ b/lib/v3-periphery/contracts/base/PoolInitializer.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +import './PeripheryImmutableState.sol'; +import '../interfaces/IPoolInitializer.sol'; + +/// @title Creates and initializes V3 Pools +abstract contract PoolInitializer is IPoolInitializer, PeripheryImmutableState { + /// @inheritdoc IPoolInitializer + function createAndInitializePoolIfNecessary( + address token0, + address token1, + uint24 fee, + uint160 sqrtPriceX96 + ) external payable override returns (address pool) { + require(token0 < token1); + pool = IUniswapV3Factory(factory).getPool(token0, token1, fee); + + if (pool == address(0)) { + pool = IUniswapV3Factory(factory).createPool(token0, token1, fee); + IUniswapV3Pool(pool).initialize(sqrtPriceX96); + } else { + (uint160 sqrtPriceX96Existing, , , , , , ) = IUniswapV3Pool(pool).slot0(); + if (sqrtPriceX96Existing == 0) { + IUniswapV3Pool(pool).initialize(sqrtPriceX96); + } + } + } +} diff --git a/lib/v3-periphery/contracts/base/SelfPermit.sol b/lib/v3-periphery/contracts/base/SelfPermit.sol new file mode 100644 index 0000000..691acb4 --- /dev/null +++ b/lib/v3-periphery/contracts/base/SelfPermit.sol @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import '@openzeppelin/contracts/drafts/IERC20Permit.sol'; + +import '../interfaces/ISelfPermit.sol'; +import '../interfaces/external/IERC20PermitAllowed.sol'; + +/// @title Self Permit +/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route +/// @dev These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function +/// that requires an approval in a single transaction. +abstract contract SelfPermit is ISelfPermit { + /// @inheritdoc ISelfPermit + function selfPermit( + address token, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) public payable override { + IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s); + } + + /// @inheritdoc ISelfPermit + function selfPermitIfNecessary( + address token, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external payable override { + if (IERC20(token).allowance(msg.sender, address(this)) < value) selfPermit(token, value, deadline, v, r, s); + } + + /// @inheritdoc ISelfPermit + function selfPermitAllowed( + address token, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) public payable override { + IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s); + } + + /// @inheritdoc ISelfPermit + function selfPermitAllowedIfNecessary( + address token, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) external payable override { + if (IERC20(token).allowance(msg.sender, address(this)) < type(uint256).max) + selfPermitAllowed(token, nonce, expiry, v, r, s); + } +} diff --git a/lib/v3-periphery/contracts/examples/PairFlash.sol b/lib/v3-periphery/contracts/examples/PairFlash.sol new file mode 100644 index 0000000..a538b41 --- /dev/null +++ b/lib/v3-periphery/contracts/examples/PairFlash.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol'; +import '@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol'; + +import '../base/PeripheryPayments.sol'; +import '../base/PeripheryImmutableState.sol'; +import '../libraries/PoolAddress.sol'; +import '../libraries/CallbackValidation.sol'; +import '../libraries/TransferHelper.sol'; +import '../interfaces/ISwapRouter.sol'; + +/// @title Flash contract implementation +/// @notice An example contract using the Uniswap V3 flash function +contract PairFlash is IUniswapV3FlashCallback, PeripheryPayments { + using LowGasSafeMath for uint256; + using LowGasSafeMath for int256; + + ISwapRouter public immutable swapRouter; + + constructor( + ISwapRouter _swapRouter, + address _factory, + address _WETH9 + ) PeripheryImmutableState(_factory, _WETH9) { + swapRouter = _swapRouter; + } + + // fee2 and fee3 are the two other fees associated with the two other pools of token0 and token1 + struct FlashCallbackData { + uint256 amount0; + uint256 amount1; + address payer; + PoolAddress.PoolKey poolKey; + uint24 poolFee2; + uint24 poolFee3; + } + + /// @param fee0 The fee from calling flash for token0 + /// @param fee1 The fee from calling flash for token1 + /// @param data The data needed in the callback passed as FlashCallbackData from `initFlash` + /// @notice implements the callback called from flash + /// @dev fails if the flash is not profitable, meaning the amountOut from the flash is less than the amount borrowed + function uniswapV3FlashCallback( + uint256 fee0, + uint256 fee1, + bytes calldata data + ) external override { + FlashCallbackData memory decoded = abi.decode(data, (FlashCallbackData)); + CallbackValidation.verifyCallback(factory, decoded.poolKey); + + address token0 = decoded.poolKey.token0; + address token1 = decoded.poolKey.token1; + + // profitability parameters - we must receive at least the required payment from the arbitrage swaps + // exactInputSingle will fail if this amount not met + uint256 amount0Min = LowGasSafeMath.add(decoded.amount0, fee0); + uint256 amount1Min = LowGasSafeMath.add(decoded.amount1, fee1); + + // call exactInputSingle for swapping token1 for token0 in pool with fee2 + TransferHelper.safeApprove(token1, address(swapRouter), decoded.amount1); + uint256 amountOut0 = + swapRouter.exactInputSingle( + ISwapRouter.ExactInputSingleParams({ + tokenIn: token1, + tokenOut: token0, + fee: decoded.poolFee2, + recipient: address(this), + deadline: block.timestamp, + amountIn: decoded.amount1, + amountOutMinimum: amount0Min, + sqrtPriceLimitX96: 0 + }) + ); + + // call exactInputSingle for swapping token0 for token 1 in pool with fee3 + TransferHelper.safeApprove(token0, address(swapRouter), decoded.amount0); + uint256 amountOut1 = + swapRouter.exactInputSingle( + ISwapRouter.ExactInputSingleParams({ + tokenIn: token0, + tokenOut: token1, + fee: decoded.poolFee3, + recipient: address(this), + deadline: block.timestamp, + amountIn: decoded.amount0, + amountOutMinimum: amount1Min, + sqrtPriceLimitX96: 0 + }) + ); + + // pay the required amounts back to the pair + if (amount0Min > 0) pay(token0, address(this), msg.sender, amount0Min); + if (amount1Min > 0) pay(token1, address(this), msg.sender, amount1Min); + + // if profitable pay profits to payer + if (amountOut0 > amount0Min) { + uint256 profit0 = amountOut0 - amount0Min; + pay(token0, address(this), decoded.payer, profit0); + } + if (amountOut1 > amount1Min) { + uint256 profit1 = amountOut1 - amount1Min; + pay(token1, address(this), decoded.payer, profit1); + } + } + + //fee1 is the fee of the pool from the initial borrow + //fee2 is the fee of the first pool to arb from + //fee3 is the fee of the second pool to arb from + struct FlashParams { + address token0; + address token1; + uint24 fee1; + uint256 amount0; + uint256 amount1; + uint24 fee2; + uint24 fee3; + } + + /// @param params The parameters necessary for flash and the callback, passed in as FlashParams + /// @notice Calls the pools flash function with data needed in `uniswapV3FlashCallback` + function initFlash(FlashParams memory params) external { + PoolAddress.PoolKey memory poolKey = + PoolAddress.PoolKey({token0: params.token0, token1: params.token1, fee: params.fee1}); + IUniswapV3Pool pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); + // recipient of borrowed amounts + // amount of token0 requested to borrow + // amount of token1 requested to borrow + // need amount 0 and amount1 in callback to pay back pool + // recipient of flash should be THIS contract + pool.flash( + address(this), + params.amount0, + params.amount1, + abi.encode( + FlashCallbackData({ + amount0: params.amount0, + amount1: params.amount1, + payer: msg.sender, + poolKey: poolKey, + poolFee2: params.fee2, + poolFee3: params.fee3 + }) + ) + ); + } +} diff --git a/lib/v3-periphery/contracts/interfaces/IERC20Metadata.sol b/lib/v3-periphery/contracts/interfaces/IERC20Metadata.sol new file mode 100644 index 0000000..d7bd3e9 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IERC20Metadata.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.7.0; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; + +/// @title IERC20Metadata +/// @title Interface for ERC20 Metadata +/// @notice Extension to IERC20 that includes token metadata +interface IERC20Metadata is IERC20 { + /// @return The name of the token + function name() external view returns (string memory); + + /// @return The symbol of the token + function symbol() external view returns (string memory); + + /// @return The number of decimal places the token has + function decimals() external view returns (uint8); +} diff --git a/lib/v3-periphery/contracts/interfaces/IERC721Permit.sol b/lib/v3-periphery/contracts/interfaces/IERC721Permit.sol new file mode 100644 index 0000000..744cd3a --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IERC721Permit.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; + +/// @title ERC721 with permit +/// @notice Extension to ERC721 that includes a permit function for signature based approvals +interface IERC721Permit is IERC721 { + /// @notice The permit typehash used in the permit signature + /// @return The typehash for the permit + function PERMIT_TYPEHASH() external pure returns (bytes32); + + /// @notice The domain separator used in the permit signature + /// @return The domain seperator used in encoding of permit signature + function DOMAIN_SEPARATOR() external view returns (bytes32); + + /// @notice Approve of a specific token ID for spending by spender via signature + /// @param spender The account that is being approved + /// @param tokenId The ID of the token that is being approved for spending + /// @param deadline The deadline timestamp by which the call must be mined for the approve to work + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function permit( + address spender, + uint256 tokenId, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external payable; +} diff --git a/lib/v3-periphery/contracts/interfaces/IMulticall.sol b/lib/v3-periphery/contracts/interfaces/IMulticall.sol new file mode 100644 index 0000000..1ea39c6 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IMulticall.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +/// @title Multicall interface +/// @notice Enables calling multiple methods in a single call to the contract +interface IMulticall { + /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed + /// @dev The `msg.value` should not be trusted for any method callable from multicall. + /// @param data The encoded function data for each of the calls to make to this contract + /// @return results The results from each of the calls passed in via data + function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); +} diff --git a/lib/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol b/lib/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol new file mode 100644 index 0000000..10a40e9 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +import '@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol'; +import '@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol'; + +import './IPoolInitializer.sol'; +import './IERC721Permit.sol'; +import './IPeripheryPayments.sol'; +import './IPeripheryImmutableState.sol'; + +/// @title Non-fungible token for positions +/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred +/// and authorized. +interface INonfungiblePositionManager is + IPoolInitializer, + IPeripheryPayments, + IPeripheryImmutableState, + IERC721Metadata, + IERC721Enumerable, + IERC721Permit +{ + /// @notice Emitted when liquidity is increased for a position NFT + /// @dev Also emitted when a token is minted + /// @param tokenId The ID of the token for which liquidity was increased + /// @param liquidity The amount by which liquidity for the NFT position was increased + /// @param amount0 The amount of token0 that was paid for the increase in liquidity + /// @param amount1 The amount of token1 that was paid for the increase in liquidity + event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); + /// @notice Emitted when liquidity is decreased for a position NFT + /// @param tokenId The ID of the token for which liquidity was decreased + /// @param liquidity The amount by which liquidity for the NFT position was decreased + /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity + /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity + event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); + /// @notice Emitted when tokens are collected for a position NFT + /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior + /// @param tokenId The ID of the token for which underlying tokens were collected + /// @param recipient The address of the account that received the collected tokens + /// @param amount0 The amount of token0 owed to the position that was collected + /// @param amount1 The amount of token1 owed to the position that was collected + event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1); + + /// @notice Returns the position information associated with a given token ID. + /// @dev Throws if the token ID is not valid. + /// @param tokenId The ID of the token that represents the position + /// @return nonce The nonce for permits + /// @return operator The address that is approved for spending + /// @return token0 The address of the token0 for a specific pool + /// @return token1 The address of the token1 for a specific pool + /// @return fee The fee associated with the pool + /// @return tickLower The lower end of the tick range for the position + /// @return tickUpper The higher end of the tick range for the position + /// @return liquidity The liquidity of the position + /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position + /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position + /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation + /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation + function positions(uint256 tokenId) + external + view + returns ( + uint96 nonce, + address operator, + address token0, + address token1, + uint24 fee, + int24 tickLower, + int24 tickUpper, + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ); + + struct MintParams { + address token0; + address token1; + uint24 fee; + int24 tickLower; + int24 tickUpper; + uint256 amount0Desired; + uint256 amount1Desired; + uint256 amount0Min; + uint256 amount1Min; + address recipient; + uint256 deadline; + } + + /// @notice Creates a new position wrapped in a NFT + /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized + /// a method does not exist, i.e. the pool is assumed to be initialized. + /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata + /// @return tokenId The ID of the token that represents the minted position + /// @return liquidity The amount of liquidity for this position + /// @return amount0 The amount of token0 + /// @return amount1 The amount of token1 + function mint(MintParams calldata params) + external + payable + returns ( + uint256 tokenId, + uint128 liquidity, + uint256 amount0, + uint256 amount1 + ); + + struct IncreaseLiquidityParams { + uint256 tokenId; + uint256 amount0Desired; + uint256 amount1Desired; + uint256 amount0Min; + uint256 amount1Min; + uint256 deadline; + } + + /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` + /// @param params tokenId The ID of the token for which liquidity is being increased, + /// amount0Desired The desired amount of token0 to be spent, + /// amount1Desired The desired amount of token1 to be spent, + /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check, + /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check, + /// deadline The time by which the transaction must be included to effect the change + /// @return liquidity The new liquidity amount as a result of the increase + /// @return amount0 The amount of token0 to acheive resulting liquidity + /// @return amount1 The amount of token1 to acheive resulting liquidity + function increaseLiquidity(IncreaseLiquidityParams calldata params) + external + payable + returns ( + uint128 liquidity, + uint256 amount0, + uint256 amount1 + ); + + struct DecreaseLiquidityParams { + uint256 tokenId; + uint128 liquidity; + uint256 amount0Min; + uint256 amount1Min; + uint256 deadline; + } + + /// @notice Decreases the amount of liquidity in a position and accounts it to the position + /// @param params tokenId The ID of the token for which liquidity is being decreased, + /// amount The amount by which liquidity will be decreased, + /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, + /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, + /// deadline The time by which the transaction must be included to effect the change + /// @return amount0 The amount of token0 accounted to the position's tokens owed + /// @return amount1 The amount of token1 accounted to the position's tokens owed + function decreaseLiquidity(DecreaseLiquidityParams calldata params) + external + payable + returns (uint256 amount0, uint256 amount1); + + struct CollectParams { + uint256 tokenId; + address recipient; + uint128 amount0Max; + uint128 amount1Max; + } + + /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient + /// @param params tokenId The ID of the NFT for which tokens are being collected, + /// recipient The account that should receive the tokens, + /// amount0Max The maximum amount of token0 to collect, + /// amount1Max The maximum amount of token1 to collect + /// @return amount0 The amount of fees collected in token0 + /// @return amount1 The amount of fees collected in token1 + function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1); + + /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens + /// must be collected first. + /// @param tokenId The ID of the token that is being burned + function burn(uint256 tokenId) external payable; +} diff --git a/lib/v3-periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol b/lib/v3-periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol new file mode 100644 index 0000000..b3f27b8 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import './INonfungiblePositionManager.sol'; + +/// @title Describes position NFT tokens via URI +interface INonfungibleTokenPositionDescriptor { + /// @notice Produces the URI describing a particular token ID for a position manager + /// @dev Note this URI may be a data: URI with the JSON contents directly inlined + /// @param positionManager The position manager for which to describe the token + /// @param tokenId The ID of the token for which to produce a description, which may not be valid + /// @return The URI of the ERC721-compliant metadata + function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId) + external + view + returns (string memory); +} diff --git a/lib/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol b/lib/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol new file mode 100644 index 0000000..b337805 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Immutable state +/// @notice Functions that return immutable state of the router +interface IPeripheryImmutableState { + /// @return Returns the address of the Uniswap V3 factory + function factory() external view returns (address); + + /// @return Returns the address of WETH9 + function WETH9() external view returns (address); +} diff --git a/lib/v3-periphery/contracts/interfaces/IPeripheryPayments.sol b/lib/v3-periphery/contracts/interfaces/IPeripheryPayments.sol new file mode 100644 index 0000000..ac74f8c --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IPeripheryPayments.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +/// @title Periphery Payments +/// @notice Functions to ease deposits and withdrawals of ETH +interface IPeripheryPayments { + /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH. + /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users. + /// @param amountMinimum The minimum amount of WETH9 to unwrap + /// @param recipient The address receiving ETH + function unwrapWETH9(uint256 amountMinimum, address recipient) external payable; + + /// @notice Refunds any ETH balance held by this contract to the `msg.sender` + /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps + /// that use ether for the input amount + function refundETH() external payable; + + /// @notice Transfers the full amount of a token held by this contract to recipient + /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users + /// @param token The contract address of the token which will be transferred to `recipient` + /// @param amountMinimum The minimum amount of token required for a transfer + /// @param recipient The destination address of the token + function sweepToken( + address token, + uint256 amountMinimum, + address recipient + ) external payable; +} diff --git a/lib/v3-periphery/contracts/interfaces/IPeripheryPaymentsWithFee.sol b/lib/v3-periphery/contracts/interfaces/IPeripheryPaymentsWithFee.sol new file mode 100644 index 0000000..907e446 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IPeripheryPaymentsWithFee.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +import './IPeripheryPayments.sol'; + +/// @title Periphery Payments +/// @notice Functions to ease deposits and withdrawals of ETH +interface IPeripheryPaymentsWithFee is IPeripheryPayments { + /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH, with a percentage between + /// 0 (exclusive), and 1 (inclusive) going to feeRecipient + /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users. + function unwrapWETH9WithFee( + uint256 amountMinimum, + address recipient, + uint256 feeBips, + address feeRecipient + ) external payable; + + /// @notice Transfers the full amount of a token held by this contract to recipient, with a percentage between + /// 0 (exclusive) and 1 (inclusive) going to feeRecipient + /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users + function sweepTokenWithFee( + address token, + uint256 amountMinimum, + address recipient, + uint256 feeBips, + address feeRecipient + ) external payable; +} diff --git a/lib/v3-periphery/contracts/interfaces/IPoolInitializer.sol b/lib/v3-periphery/contracts/interfaces/IPoolInitializer.sol new file mode 100644 index 0000000..d2949b3 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IPoolInitializer.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +/// @title Creates and initializes V3 Pools +/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that +/// require the pool to exist. +interface IPoolInitializer { + /// @notice Creates a new pool if it does not exist, then initializes if not initialized + /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool + /// @param token0 The contract address of token0 of the pool + /// @param token1 The contract address of token1 of the pool + /// @param fee The fee amount of the v3 pool for the specified token pair + /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value + /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary + function createAndInitializePoolIfNecessary( + address token0, + address token1, + uint24 fee, + uint160 sqrtPriceX96 + ) external payable returns (address pool); +} diff --git a/lib/v3-periphery/contracts/interfaces/IQuoter.sol b/lib/v3-periphery/contracts/interfaces/IQuoter.sol new file mode 100644 index 0000000..3410e0c --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IQuoter.sol @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +/// @title Quoter Interface +/// @notice Supports quoting the calculated amounts from exact input or exact output swaps +/// @dev These functions are not marked view because they rely on calling non-view functions and reverting +/// to compute the result. They are also not gas efficient and should not be called on-chain. +interface IQuoter { + /// @notice Returns the amount out received for a given exact input swap without executing the swap + /// @param path The path of the swap, i.e. each token pair and the pool fee + /// @param amountIn The amount of the first token to swap + /// @return amountOut The amount of the last token that would be received + function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut); + + /// @notice Returns the amount out received for a given exact input but for a swap of a single pool + /// @param tokenIn The token being swapped in + /// @param tokenOut The token being swapped out + /// @param fee The fee of the token pool to consider for the pair + /// @param amountIn The desired input amount + /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap + /// @return amountOut The amount of `tokenOut` that would be received + function quoteExactInputSingle( + address tokenIn, + address tokenOut, + uint24 fee, + uint256 amountIn, + uint160 sqrtPriceLimitX96 + ) external returns (uint256 amountOut); + + /// @notice Returns the amount in required for a given exact output swap without executing the swap + /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order + /// @param amountOut The amount of the last token to receive + /// @return amountIn The amount of first token required to be paid + function quoteExactOutput(bytes memory path, uint256 amountOut) external returns (uint256 amountIn); + + /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool + /// @param tokenIn The token being swapped in + /// @param tokenOut The token being swapped out + /// @param fee The fee of the token pool to consider for the pair + /// @param amountOut The desired output amount + /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap + /// @return amountIn The amount required as the input for the swap in order to receive `amountOut` + function quoteExactOutputSingle( + address tokenIn, + address tokenOut, + uint24 fee, + uint256 amountOut, + uint160 sqrtPriceLimitX96 + ) external returns (uint256 amountIn); +} diff --git a/lib/v3-periphery/contracts/interfaces/IQuoterV2.sol b/lib/v3-periphery/contracts/interfaces/IQuoterV2.sol new file mode 100644 index 0000000..3c2961b --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IQuoterV2.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +/// @title QuoterV2 Interface +/// @notice Supports quoting the calculated amounts from exact input or exact output swaps. +/// @notice For each pool also tells you the number of initialized ticks crossed and the sqrt price of the pool after the swap. +/// @dev These functions are not marked view because they rely on calling non-view functions and reverting +/// to compute the result. They are also not gas efficient and should not be called on-chain. +interface IQuoterV2 { + /// @notice Returns the amount out received for a given exact input swap without executing the swap + /// @param path The path of the swap, i.e. each token pair and the pool fee + /// @param amountIn The amount of the first token to swap + /// @return amountOut The amount of the last token that would be received + /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path + /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path + /// @return gasEstimate The estimate of the gas that the swap consumes + function quoteExactInput(bytes memory path, uint256 amountIn) + external + returns ( + uint256 amountOut, + uint160[] memory sqrtPriceX96AfterList, + uint32[] memory initializedTicksCrossedList, + uint256 gasEstimate + ); + + struct QuoteExactInputSingleParams { + address tokenIn; + address tokenOut; + uint256 amountIn; + uint24 fee; + uint160 sqrtPriceLimitX96; + } + + /// @notice Returns the amount out received for a given exact input but for a swap of a single pool + /// @param params The params for the quote, encoded as `QuoteExactInputSingleParams` + /// tokenIn The token being swapped in + /// tokenOut The token being swapped out + /// fee The fee of the token pool to consider for the pair + /// amountIn The desired input amount + /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap + /// @return amountOut The amount of `tokenOut` that would be received + /// @return sqrtPriceX96After The sqrt price of the pool after the swap + /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed + /// @return gasEstimate The estimate of the gas that the swap consumes + function quoteExactInputSingle(QuoteExactInputSingleParams memory params) + external + returns ( + uint256 amountOut, + uint160 sqrtPriceX96After, + uint32 initializedTicksCrossed, + uint256 gasEstimate + ); + + /// @notice Returns the amount in required for a given exact output swap without executing the swap + /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order + /// @param amountOut The amount of the last token to receive + /// @return amountIn The amount of first token required to be paid + /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path + /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path + /// @return gasEstimate The estimate of the gas that the swap consumes + function quoteExactOutput(bytes memory path, uint256 amountOut) + external + returns ( + uint256 amountIn, + uint160[] memory sqrtPriceX96AfterList, + uint32[] memory initializedTicksCrossedList, + uint256 gasEstimate + ); + + struct QuoteExactOutputSingleParams { + address tokenIn; + address tokenOut; + uint256 amount; + uint24 fee; + uint160 sqrtPriceLimitX96; + } + + /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool + /// @param params The params for the quote, encoded as `QuoteExactOutputSingleParams` + /// tokenIn The token being swapped in + /// tokenOut The token being swapped out + /// fee The fee of the token pool to consider for the pair + /// amountOut The desired output amount + /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap + /// @return amountIn The amount required as the input for the swap in order to receive `amountOut` + /// @return sqrtPriceX96After The sqrt price of the pool after the swap + /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed + /// @return gasEstimate The estimate of the gas that the swap consumes + function quoteExactOutputSingle(QuoteExactOutputSingleParams memory params) + external + returns ( + uint256 amountIn, + uint160 sqrtPriceX96After, + uint32 initializedTicksCrossed, + uint256 gasEstimate + ); +} diff --git a/lib/v3-periphery/contracts/interfaces/ISelfPermit.sol b/lib/v3-periphery/contracts/interfaces/ISelfPermit.sol new file mode 100644 index 0000000..0ab8a25 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/ISelfPermit.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; + +/// @title Self Permit +/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route +interface ISelfPermit { + /// @notice Permits this contract to spend a given token from `msg.sender` + /// @dev The `owner` is always msg.sender and the `spender` is always address(this). + /// @param token The address of the token spent + /// @param value The amount that can be spent of token + /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function selfPermit( + address token, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external payable; + + /// @notice Permits this contract to spend a given token from `msg.sender` + /// @dev The `owner` is always msg.sender and the `spender` is always address(this). + /// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit + /// @param token The address of the token spent + /// @param value The amount that can be spent of token + /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function selfPermitIfNecessary( + address token, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) external payable; + + /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter + /// @dev The `owner` is always msg.sender and the `spender` is always address(this) + /// @param token The address of the token spent + /// @param nonce The current nonce of the owner + /// @param expiry The timestamp at which the permit is no longer valid + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function selfPermitAllowed( + address token, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) external payable; + + /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter + /// @dev The `owner` is always msg.sender and the `spender` is always address(this) + /// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed. + /// @param token The address of the token spent + /// @param nonce The current nonce of the owner + /// @param expiry The timestamp at which the permit is no longer valid + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function selfPermitAllowedIfNecessary( + address token, + uint256 nonce, + uint256 expiry, + uint8 v, + bytes32 r, + bytes32 s + ) external payable; +} diff --git a/lib/v3-periphery/contracts/interfaces/ISwapRouter.sol b/lib/v3-periphery/contracts/interfaces/ISwapRouter.sol new file mode 100644 index 0000000..35806a2 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/ISwapRouter.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; + +/// @title Router token swapping functionality +/// @notice Functions for swapping tokens via Uniswap V3 +interface ISwapRouter is IUniswapV3SwapCallback { + struct ExactInputSingleParams { + address tokenIn; + address tokenOut; + uint24 fee; + address recipient; + uint256 deadline; + uint256 amountIn; + uint256 amountOutMinimum; + uint160 sqrtPriceLimitX96; + } + + /// @notice Swaps `amountIn` of one token for as much as possible of another token + /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata + /// @return amountOut The amount of the received token + function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); + + struct ExactInputParams { + bytes path; + address recipient; + uint256 deadline; + uint256 amountIn; + uint256 amountOutMinimum; + } + + /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path + /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata + /// @return amountOut The amount of the received token + function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); + + struct ExactOutputSingleParams { + address tokenIn; + address tokenOut; + uint24 fee; + address recipient; + uint256 deadline; + uint256 amountOut; + uint256 amountInMaximum; + uint160 sqrtPriceLimitX96; + } + + /// @notice Swaps as little as possible of one token for `amountOut` of another token + /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata + /// @return amountIn The amount of the input token + function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); + + struct ExactOutputParams { + bytes path; + address recipient; + uint256 deadline; + uint256 amountOut; + uint256 amountInMaximum; + } + + /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) + /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata + /// @return amountIn The amount of the input token + function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); +} diff --git a/lib/v3-periphery/contracts/interfaces/ITickLens.sol b/lib/v3-periphery/contracts/interfaces/ITickLens.sol new file mode 100644 index 0000000..89bac2d --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/ITickLens.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +/// @title Tick Lens +/// @notice Provides functions for fetching chunks of tick data for a pool +/// @dev This avoids the waterfall of fetching the tick bitmap, parsing the bitmap to know which ticks to fetch, and +/// then sending additional multicalls to fetch the tick data +interface ITickLens { + struct PopulatedTick { + int24 tick; + int128 liquidityNet; + uint128 liquidityGross; + } + + /// @notice Get all the tick data for the populated ticks from a word of the tick bitmap of a pool + /// @param pool The address of the pool for which to fetch populated tick data + /// @param tickBitmapIndex The index of the word in the tick bitmap for which to parse the bitmap and + /// fetch all the populated ticks + /// @return populatedTicks An array of tick data for the given word in the tick bitmap + function getPopulatedTicksInWord(address pool, int16 tickBitmapIndex) + external + view + returns (PopulatedTick[] memory populatedTicks); +} diff --git a/lib/v3-periphery/contracts/interfaces/IV3Migrator.sol b/lib/v3-periphery/contracts/interfaces/IV3Migrator.sol new file mode 100644 index 0000000..6eb6e42 --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/IV3Migrator.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.5; +pragma abicoder v2; + +import './IMulticall.sol'; +import './ISelfPermit.sol'; +import './IPoolInitializer.sol'; + +/// @title V3 Migrator +/// @notice Enables migration of liqudity from Uniswap v2-compatible pairs into Uniswap v3 pools +interface IV3Migrator is IMulticall, ISelfPermit, IPoolInitializer { + struct MigrateParams { + address pair; // the Uniswap v2-compatible pair + uint256 liquidityToMigrate; // expected to be balanceOf(msg.sender) + uint8 percentageToMigrate; // represented as a numerator over 100 + address token0; + address token1; + uint24 fee; + int24 tickLower; + int24 tickUpper; + uint256 amount0Min; // must be discounted by percentageToMigrate + uint256 amount1Min; // must be discounted by percentageToMigrate + address recipient; + uint256 deadline; + bool refundAsETH; + } + + /// @notice Migrates liquidity to v3 by burning v2 liquidity and minting a new position for v3 + /// @dev Slippage protection is enforced via `amount{0,1}Min`, which should be a discount of the expected values of + /// the maximum amount of v3 liquidity that the v2 liquidity can get. For the special case of migrating to an + /// out-of-range position, `amount{0,1}Min` may be set to 0, enforcing that the position remains out of range + /// @param params The params necessary to migrate v2 liquidity, encoded as `MigrateParams` in calldata + function migrate(MigrateParams calldata params) external; +} diff --git a/lib/v3-periphery/contracts/interfaces/external/IERC1271.sol b/lib/v3-periphery/contracts/interfaces/external/IERC1271.sol new file mode 100644 index 0000000..824b03e --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/external/IERC1271.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Interface for verifying contract-based account signatures +/// @notice Interface that verifies provided signature for the data +/// @dev Interface defined by EIP-1271 +interface IERC1271 { + /// @notice Returns whether the provided signature is valid for the provided data + /// @dev MUST return the bytes4 magic value 0x1626ba7e when function passes. + /// MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5). + /// MUST allow external calls. + /// @param hash Hash of the data to be signed + /// @param signature Signature byte array associated with _data + /// @return magicValue The bytes4 magic value 0x1626ba7e + function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); +} diff --git a/lib/v3-periphery/contracts/interfaces/external/IERC20PermitAllowed.sol b/lib/v3-periphery/contracts/interfaces/external/IERC20PermitAllowed.sol new file mode 100644 index 0000000..a817e1c --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/external/IERC20PermitAllowed.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Interface for permit +/// @notice Interface used by DAI/CHAI for permit +interface IERC20PermitAllowed { + /// @notice Approve the spender to spend some tokens via the holder signature + /// @dev This is the permit interface used by DAI and CHAI + /// @param holder The address of the token holder, the token owner + /// @param spender The address of the token spender + /// @param nonce The holder's nonce, increases at each call to permit + /// @param expiry The timestamp at which the permit is no longer valid + /// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0 + /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` + /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` + /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` + function permit( + address holder, + address spender, + uint256 nonce, + uint256 expiry, + bool allowed, + uint8 v, + bytes32 r, + bytes32 s + ) external; +} diff --git a/lib/v3-periphery/contracts/interfaces/external/IWETH9.sol b/lib/v3-periphery/contracts/interfaces/external/IWETH9.sol new file mode 100644 index 0000000..58ab43e --- /dev/null +++ b/lib/v3-periphery/contracts/interfaces/external/IWETH9.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; + +/// @title Interface for WETH9 +interface IWETH9 is IERC20 { + /// @notice Deposit ether to get wrapped ether + function deposit() external payable; + + /// @notice Withdraw wrapped ether to get ether + function withdraw(uint256) external; +} diff --git a/lib/v3-periphery/contracts/lens/Quoter.sol b/lib/v3-periphery/contracts/lens/Quoter.sol new file mode 100644 index 0000000..f4a9ed6 --- /dev/null +++ b/lib/v3-periphery/contracts/lens/Quoter.sol @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/libraries/SafeCast.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; + +import '../interfaces/IQuoter.sol'; +import '../base/PeripheryImmutableState.sol'; +import '../libraries/Path.sol'; +import '../libraries/PoolAddress.sol'; +import '../libraries/CallbackValidation.sol'; + +/// @title Provides quotes for swaps +/// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap +/// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute +/// the swap and check the amounts in the callback. +contract Quoter is IQuoter, IUniswapV3SwapCallback, PeripheryImmutableState { + using Path for bytes; + using SafeCast for uint256; + + /// @dev Transient storage variable used to check a safety condition in exact output swaps. + uint256 private amountOutCached; + + constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {} + + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) private view returns (IUniswapV3Pool) { + return IUniswapV3Pool(PoolAddress.computeAddress(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee))); + } + + /// @inheritdoc IUniswapV3SwapCallback + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes memory path + ) external view override { + require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported + (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool(); + CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); + + (bool isExactInput, uint256 amountToPay, uint256 amountReceived) = + amount0Delta > 0 + ? (tokenIn < tokenOut, uint256(amount0Delta), uint256(-amount1Delta)) + : (tokenOut < tokenIn, uint256(amount1Delta), uint256(-amount0Delta)); + if (isExactInput) { + assembly { + let ptr := mload(0x40) + mstore(ptr, amountReceived) + revert(ptr, 32) + } + } else { + // if the cache has been populated, ensure that the full output amount has been received + if (amountOutCached != 0) require(amountReceived == amountOutCached); + assembly { + let ptr := mload(0x40) + mstore(ptr, amountToPay) + revert(ptr, 32) + } + } + } + + /// @dev Parses a revert reason that should contain the numeric quote + function parseRevertReason(bytes memory reason) private pure returns (uint256) { + if (reason.length != 32) { + if (reason.length < 68) revert('Unexpected error'); + assembly { + reason := add(reason, 0x04) + } + revert(abi.decode(reason, (string))); + } + return abi.decode(reason, (uint256)); + } + + /// @inheritdoc IQuoter + function quoteExactInputSingle( + address tokenIn, + address tokenOut, + uint24 fee, + uint256 amountIn, + uint160 sqrtPriceLimitX96 + ) public override returns (uint256 amountOut) { + bool zeroForOne = tokenIn < tokenOut; + + try + getPool(tokenIn, tokenOut, fee).swap( + address(this), // address(0) might cause issues with some tokens + zeroForOne, + amountIn.toInt256(), + sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : sqrtPriceLimitX96, + abi.encodePacked(tokenIn, fee, tokenOut) + ) + {} catch (bytes memory reason) { + return parseRevertReason(reason); + } + } + + /// @inheritdoc IQuoter + function quoteExactInput(bytes memory path, uint256 amountIn) external override returns (uint256 amountOut) { + while (true) { + bool hasMultiplePools = path.hasMultiplePools(); + + (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool(); + + // the outputs of prior swaps become the inputs to subsequent ones + amountIn = quoteExactInputSingle(tokenIn, tokenOut, fee, amountIn, 0); + + // decide whether to continue or terminate + if (hasMultiplePools) { + path = path.skipToken(); + } else { + return amountIn; + } + } + } + + /// @inheritdoc IQuoter + function quoteExactOutputSingle( + address tokenIn, + address tokenOut, + uint24 fee, + uint256 amountOut, + uint160 sqrtPriceLimitX96 + ) public override returns (uint256 amountIn) { + bool zeroForOne = tokenIn < tokenOut; + + // if no price limit has been specified, cache the output amount for comparison in the swap callback + if (sqrtPriceLimitX96 == 0) amountOutCached = amountOut; + try + getPool(tokenIn, tokenOut, fee).swap( + address(this), // address(0) might cause issues with some tokens + zeroForOne, + -amountOut.toInt256(), + sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : sqrtPriceLimitX96, + abi.encodePacked(tokenOut, fee, tokenIn) + ) + {} catch (bytes memory reason) { + if (sqrtPriceLimitX96 == 0) delete amountOutCached; // clear cache + return parseRevertReason(reason); + } + } + + /// @inheritdoc IQuoter + function quoteExactOutput(bytes memory path, uint256 amountOut) external override returns (uint256 amountIn) { + while (true) { + bool hasMultiplePools = path.hasMultiplePools(); + + (address tokenOut, address tokenIn, uint24 fee) = path.decodeFirstPool(); + + // the inputs of prior swaps become the outputs of subsequent ones + amountOut = quoteExactOutputSingle(tokenIn, tokenOut, fee, amountOut, 0); + + // decide whether to continue or terminate + if (hasMultiplePools) { + path = path.skipToken(); + } else { + return amountOut; + } + } + } +} diff --git a/lib/v3-periphery/contracts/lens/QuoterV2.sol b/lib/v3-periphery/contracts/lens/QuoterV2.sol new file mode 100644 index 0000000..b82dddd --- /dev/null +++ b/lib/v3-periphery/contracts/lens/QuoterV2.sol @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/libraries/SafeCast.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/libraries/TickBitmap.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; + +import '../interfaces/IQuoterV2.sol'; +import '../base/PeripheryImmutableState.sol'; +import '../libraries/Path.sol'; +import '../libraries/PoolAddress.sol'; +import '../libraries/CallbackValidation.sol'; +import '../libraries/PoolTicksCounter.sol'; + +/// @title Provides quotes for swaps +/// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap +/// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute +/// the swap and check the amounts in the callback. +contract QuoterV2 is IQuoterV2, IUniswapV3SwapCallback, PeripheryImmutableState { + using Path for bytes; + using SafeCast for uint256; + using PoolTicksCounter for IUniswapV3Pool; + + /// @dev Transient storage variable used to check a safety condition in exact output swaps. + uint256 private amountOutCached; + + constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {} + + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) private view returns (IUniswapV3Pool) { + return IUniswapV3Pool(PoolAddress.computeAddress(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee))); + } + + /// @inheritdoc IUniswapV3SwapCallback + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes memory path + ) external view override { + require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported + (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool(); + CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee); + + (bool isExactInput, uint256 amountToPay, uint256 amountReceived) = + amount0Delta > 0 + ? (tokenIn < tokenOut, uint256(amount0Delta), uint256(-amount1Delta)) + : (tokenOut < tokenIn, uint256(amount1Delta), uint256(-amount0Delta)); + + IUniswapV3Pool pool = getPool(tokenIn, tokenOut, fee); + (uint160 sqrtPriceX96After, int24 tickAfter, , , , , ) = pool.slot0(); + + if (isExactInput) { + assembly { + let ptr := mload(0x40) + mstore(ptr, amountReceived) + mstore(add(ptr, 0x20), sqrtPriceX96After) + mstore(add(ptr, 0x40), tickAfter) + revert(ptr, 96) + } + } else { + // if the cache has been populated, ensure that the full output amount has been received + if (amountOutCached != 0) require(amountReceived == amountOutCached); + assembly { + let ptr := mload(0x40) + mstore(ptr, amountToPay) + mstore(add(ptr, 0x20), sqrtPriceX96After) + mstore(add(ptr, 0x40), tickAfter) + revert(ptr, 96) + } + } + } + + /// @dev Parses a revert reason that should contain the numeric quote + function parseRevertReason(bytes memory reason) + private + pure + returns ( + uint256 amount, + uint160 sqrtPriceX96After, + int24 tickAfter + ) + { + if (reason.length != 96) { + if (reason.length < 68) revert('Unexpected error'); + assembly { + reason := add(reason, 0x04) + } + revert(abi.decode(reason, (string))); + } + return abi.decode(reason, (uint256, uint160, int24)); + } + + function handleRevert( + bytes memory reason, + IUniswapV3Pool pool, + uint256 gasEstimate + ) + private + view + returns ( + uint256 amount, + uint160 sqrtPriceX96After, + uint32 initializedTicksCrossed, + uint256 + ) + { + int24 tickBefore; + int24 tickAfter; + (, tickBefore, , , , , ) = pool.slot0(); + (amount, sqrtPriceX96After, tickAfter) = parseRevertReason(reason); + + initializedTicksCrossed = pool.countInitializedTicksCrossed(tickBefore, tickAfter); + + return (amount, sqrtPriceX96After, initializedTicksCrossed, gasEstimate); + } + + function quoteExactInputSingle(QuoteExactInputSingleParams memory params) + public + override + returns ( + uint256 amountOut, + uint160 sqrtPriceX96After, + uint32 initializedTicksCrossed, + uint256 gasEstimate + ) + { + bool zeroForOne = params.tokenIn < params.tokenOut; + IUniswapV3Pool pool = getPool(params.tokenIn, params.tokenOut, params.fee); + + uint256 gasBefore = gasleft(); + try + pool.swap( + address(this), // address(0) might cause issues with some tokens + zeroForOne, + params.amountIn.toInt256(), + params.sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : params.sqrtPriceLimitX96, + abi.encodePacked(params.tokenIn, params.fee, params.tokenOut) + ) + {} catch (bytes memory reason) { + gasEstimate = gasBefore - gasleft(); + return handleRevert(reason, pool, gasEstimate); + } + } + + function quoteExactInput(bytes memory path, uint256 amountIn) + public + override + returns ( + uint256 amountOut, + uint160[] memory sqrtPriceX96AfterList, + uint32[] memory initializedTicksCrossedList, + uint256 gasEstimate + ) + { + sqrtPriceX96AfterList = new uint160[](path.numPools()); + initializedTicksCrossedList = new uint32[](path.numPools()); + + uint256 i = 0; + while (true) { + (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool(); + + // the outputs of prior swaps become the inputs to subsequent ones + (uint256 _amountOut, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate) = + quoteExactInputSingle( + QuoteExactInputSingleParams({ + tokenIn: tokenIn, + tokenOut: tokenOut, + fee: fee, + amountIn: amountIn, + sqrtPriceLimitX96: 0 + }) + ); + + sqrtPriceX96AfterList[i] = _sqrtPriceX96After; + initializedTicksCrossedList[i] = _initializedTicksCrossed; + amountIn = _amountOut; + gasEstimate += _gasEstimate; + i++; + + // decide whether to continue or terminate + if (path.hasMultiplePools()) { + path = path.skipToken(); + } else { + return (amountIn, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate); + } + } + } + + function quoteExactOutputSingle(QuoteExactOutputSingleParams memory params) + public + override + returns ( + uint256 amountIn, + uint160 sqrtPriceX96After, + uint32 initializedTicksCrossed, + uint256 gasEstimate + ) + { + bool zeroForOne = params.tokenIn < params.tokenOut; + IUniswapV3Pool pool = getPool(params.tokenIn, params.tokenOut, params.fee); + + // if no price limit has been specified, cache the output amount for comparison in the swap callback + if (params.sqrtPriceLimitX96 == 0) amountOutCached = params.amount; + uint256 gasBefore = gasleft(); + try + pool.swap( + address(this), // address(0) might cause issues with some tokens + zeroForOne, + -params.amount.toInt256(), + params.sqrtPriceLimitX96 == 0 + ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) + : params.sqrtPriceLimitX96, + abi.encodePacked(params.tokenOut, params.fee, params.tokenIn) + ) + {} catch (bytes memory reason) { + gasEstimate = gasBefore - gasleft(); + if (params.sqrtPriceLimitX96 == 0) delete amountOutCached; // clear cache + return handleRevert(reason, pool, gasEstimate); + } + } + + function quoteExactOutput(bytes memory path, uint256 amountOut) + public + override + returns ( + uint256 amountIn, + uint160[] memory sqrtPriceX96AfterList, + uint32[] memory initializedTicksCrossedList, + uint256 gasEstimate + ) + { + sqrtPriceX96AfterList = new uint160[](path.numPools()); + initializedTicksCrossedList = new uint32[](path.numPools()); + + uint256 i = 0; + while (true) { + (address tokenOut, address tokenIn, uint24 fee) = path.decodeFirstPool(); + + // the inputs of prior swaps become the outputs of subsequent ones + (uint256 _amountIn, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate) = + quoteExactOutputSingle( + QuoteExactOutputSingleParams({ + tokenIn: tokenIn, + tokenOut: tokenOut, + amount: amountOut, + fee: fee, + sqrtPriceLimitX96: 0 + }) + ); + + sqrtPriceX96AfterList[i] = _sqrtPriceX96After; + initializedTicksCrossedList[i] = _initializedTicksCrossed; + amountOut = _amountIn; + gasEstimate += _gasEstimate; + i++; + + // decide whether to continue or terminate + if (path.hasMultiplePools()) { + path = path.skipToken(); + } else { + return (amountOut, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate); + } + } + } +} diff --git a/lib/v3-periphery/contracts/lens/README.md b/lib/v3-periphery/contracts/lens/README.md new file mode 100644 index 0000000..8359711 --- /dev/null +++ b/lib/v3-periphery/contracts/lens/README.md @@ -0,0 +1,4 @@ +# lens + +These contracts are not designed to be called on-chain. They simplify +fetching on-chain data from off-chain. diff --git a/lib/v3-periphery/contracts/lens/TickLens.sol b/lib/v3-periphery/contracts/lens/TickLens.sol new file mode 100644 index 0000000..5e9be5f --- /dev/null +++ b/lib/v3-periphery/contracts/lens/TickLens.sol @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +import '../interfaces/ITickLens.sol'; + +/// @title Tick Lens contract +contract TickLens is ITickLens { + /// @inheritdoc ITickLens + function getPopulatedTicksInWord(address pool, int16 tickBitmapIndex) + public + view + override + returns (PopulatedTick[] memory populatedTicks) + { + // fetch bitmap + uint256 bitmap = IUniswapV3Pool(pool).tickBitmap(tickBitmapIndex); + + // calculate the number of populated ticks + uint256 numberOfPopulatedTicks; + for (uint256 i = 0; i < 256; i++) { + if (bitmap & (1 << i) > 0) numberOfPopulatedTicks++; + } + + // fetch populated tick data + int24 tickSpacing = IUniswapV3Pool(pool).tickSpacing(); + populatedTicks = new PopulatedTick[](numberOfPopulatedTicks); + for (uint256 i = 0; i < 256; i++) { + if (bitmap & (1 << i) > 0) { + int24 populatedTick = ((int24(tickBitmapIndex) << 8) + int24(i)) * tickSpacing; + (uint128 liquidityGross, int128 liquidityNet, , , , , , ) = IUniswapV3Pool(pool).ticks(populatedTick); + populatedTicks[--numberOfPopulatedTicks] = PopulatedTick({ + tick: populatedTick, + liquidityNet: liquidityNet, + liquidityGross: liquidityGross + }); + } + } + } +} diff --git a/lib/v3-periphery/contracts/lens/UniswapInterfaceMulticall.sol b/lib/v3-periphery/contracts/lens/UniswapInterfaceMulticall.sol new file mode 100644 index 0000000..54c62c9 --- /dev/null +++ b/lib/v3-periphery/contracts/lens/UniswapInterfaceMulticall.sol @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: MIT +pragma solidity =0.7.6; +pragma abicoder v2; + +/// @notice A fork of Multicall2 specifically tailored for the Uniswap Interface +contract UniswapInterfaceMulticall { + struct Call { + address target; + uint256 gasLimit; + bytes callData; + } + + struct Result { + bool success; + uint256 gasUsed; + bytes returnData; + } + + function getCurrentBlockTimestamp() public view returns (uint256 timestamp) { + timestamp = block.timestamp; + } + + function getEthBalance(address addr) public view returns (uint256 balance) { + balance = addr.balance; + } + + function multicall(Call[] memory calls) public returns (uint256 blockNumber, Result[] memory returnData) { + blockNumber = block.number; + returnData = new Result[](calls.length); + for (uint256 i = 0; i < calls.length; i++) { + (address target, uint256 gasLimit, bytes memory callData) = + (calls[i].target, calls[i].gasLimit, calls[i].callData); + uint256 gasLeftBefore = gasleft(); + (bool success, bytes memory ret) = target.call{gas: gasLimit}(callData); + uint256 gasUsed = gasLeftBefore - gasleft(); + returnData[i] = Result(success, gasUsed, ret); + } + } +} diff --git a/lib/v3-periphery/contracts/libraries/BytesLib.sol b/lib/v3-periphery/contracts/libraries/BytesLib.sol new file mode 100644 index 0000000..ca1ae84 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/BytesLib.sol @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * @title Solidity Bytes Arrays Utils + * @author Gonçalo Sá + * + * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. + * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. + */ +pragma solidity >=0.5.0 <0.8.0; + +library BytesLib { + function slice( + bytes memory _bytes, + uint256 _start, + uint256 _length + ) internal pure returns (bytes memory) { + require(_length + 31 >= _length, 'slice_overflow'); + require(_start + _length >= _start, 'slice_overflow'); + require(_bytes.length >= _start + _length, 'slice_outOfBounds'); + + bytes memory tempBytes; + + assembly { + switch iszero(_length) + case 0 { + // Get a location of some free memory and store it in tempBytes as + // Solidity does for memory variables. + tempBytes := mload(0x40) + + // The first word of the slice result is potentially a partial + // word read from the original array. To read it, we calculate + // the length of that partial word and start copying that many + // bytes into the array. The first word we copy will start with + // data we don't care about, but the last `lengthmod` bytes will + // land at the beginning of the contents of the new array. When + // we're done copying, we overwrite the full first word with + // the actual length of the slice. + let lengthmod := and(_length, 31) + + // The multiplication in the next line is necessary + // because when slicing multiples of 32 bytes (lengthmod == 0) + // the following copy loop was copying the origin's length + // and then ending prematurely not copying everything it should. + let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) + let end := add(mc, _length) + + for { + // The multiplication in the next line has the same exact purpose + // as the one above. + let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) + } lt(mc, end) { + mc := add(mc, 0x20) + cc := add(cc, 0x20) + } { + mstore(mc, mload(cc)) + } + + mstore(tempBytes, _length) + + //update free-memory pointer + //allocating the array padded to 32 bytes like the compiler does now + mstore(0x40, and(add(mc, 31), not(31))) + } + //if we want a zero-length slice let's just return a zero-length array + default { + tempBytes := mload(0x40) + //zero out the 32 bytes slice we are about to return + //we need to do it because Solidity does not garbage collect + mstore(tempBytes, 0) + + mstore(0x40, add(tempBytes, 0x20)) + } + } + + return tempBytes; + } + + function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { + require(_start + 20 >= _start, 'toAddress_overflow'); + require(_bytes.length >= _start + 20, 'toAddress_outOfBounds'); + address tempAddress; + + assembly { + tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) + } + + return tempAddress; + } + + function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) { + require(_start + 3 >= _start, 'toUint24_overflow'); + require(_bytes.length >= _start + 3, 'toUint24_outOfBounds'); + uint24 tempUint; + + assembly { + tempUint := mload(add(add(_bytes, 0x3), _start)) + } + + return tempUint; + } +} diff --git a/lib/v3-periphery/contracts/libraries/CallbackValidation.sol b/lib/v3-periphery/contracts/libraries/CallbackValidation.sol new file mode 100644 index 0000000..788109f --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/CallbackValidation.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import './PoolAddress.sol'; + +/// @notice Provides validation for callbacks from Uniswap V3 Pools +library CallbackValidation { + /// @notice Returns the address of a valid Uniswap V3 Pool + /// @param factory The contract address of the Uniswap V3 factory + /// @param tokenA The contract address of either token0 or token1 + /// @param tokenB The contract address of the other token + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @return pool The V3 pool contract address + function verifyCallback( + address factory, + address tokenA, + address tokenB, + uint24 fee + ) internal view returns (IUniswapV3Pool pool) { + return verifyCallback(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee)); + } + + /// @notice Returns the address of a valid Uniswap V3 Pool + /// @param factory The contract address of the Uniswap V3 factory + /// @param poolKey The identifying key of the V3 pool + /// @return pool The V3 pool contract address + function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey) + internal + view + returns (IUniswapV3Pool pool) + { + pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey)); + require(msg.sender == address(pool)); + } +} diff --git a/lib/v3-periphery/contracts/libraries/ChainId.sol b/lib/v3-periphery/contracts/libraries/ChainId.sol new file mode 100644 index 0000000..72cb8b7 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/ChainId.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.0; + +/// @title Function for getting the current chain ID +library ChainId { + /// @dev Gets the current chain ID + /// @return chainId The current chain ID + function get() internal pure returns (uint256 chainId) { + assembly { + chainId := chainid() + } + } +} diff --git a/lib/v3-periphery/contracts/libraries/HexStrings.sol b/lib/v3-periphery/contracts/libraries/HexStrings.sol new file mode 100644 index 0000000..8f82288 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/HexStrings.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +pragma solidity =0.7.6; + +library HexStrings { + bytes16 internal constant ALPHABET = '0123456789abcdef'; + + /// @notice Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. + /// @dev Credit to Open Zeppelin under MIT license https://github.com/OpenZeppelin/openzeppelin-contracts/blob/243adff49ce1700e0ecb99fe522fb16cff1d1ddc/contracts/utils/Strings.sol#L55 + function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { + bytes memory buffer = new bytes(2 * length + 2); + buffer[0] = '0'; + buffer[1] = 'x'; + for (uint256 i = 2 * length + 1; i > 1; --i) { + buffer[i] = ALPHABET[value & 0xf]; + value >>= 4; + } + require(value == 0, 'Strings: hex length insufficient'); + return string(buffer); + } + + function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory) { + bytes memory buffer = new bytes(2 * length); + for (uint256 i = buffer.length; i > 0; i--) { + buffer[i - 1] = ALPHABET[value & 0xf]; + value >>= 4; + } + return string(buffer); + } +} diff --git a/lib/v3-periphery/contracts/libraries/LiquidityAmounts.sol b/lib/v3-periphery/contracts/libraries/LiquidityAmounts.sol new file mode 100644 index 0000000..1427022 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/LiquidityAmounts.sol @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; +import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol'; + +/// @title Liquidity amount functions +/// @notice Provides functions for computing liquidity amounts from token amounts and prices +library LiquidityAmounts { + /// @notice Downcasts uint256 to uint128 + /// @param x The uint258 to be downcasted + /// @return y The passed value, downcasted to uint128 + function toUint128(uint256 x) private pure returns (uint128 y) { + require((y = uint128(x)) == x); + } + + /// @notice Computes the amount of liquidity received for a given amount of token0 and price range + /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount0 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96); + return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96)); + } + + /// @notice Computes the amount of liquidity received for a given amount of token1 and price range + /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount1 The amount1 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + return toUint128(FullMath.mulDiv(amount1, FixedPoint96.Q96, sqrtRatioBX96 - sqrtRatioAX96)); + } + + /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount of token0 being sent in + /// @param amount1 The amount of token1 being sent in + /// @return liquidity The maximum amount of liquidity received + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + liquidity = getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + uint128 liquidity0 = getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0); + uint128 liquidity1 = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1); + + liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; + } else { + liquidity = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); + } + } + + /// @notice Computes the amount of token0 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + function getAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + uint256(liquidity) << FixedPoint96.RESOLUTION, + sqrtRatioBX96 - sqrtRatioAX96, + sqrtRatioBX96 + ) / sqrtRatioAX96; + } + + /// @notice Computes the amount of token1 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount1 The amount of token1 + function getAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); + } + + /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + /// @return amount1 The amount of token1 + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0, uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + amount0 = getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + amount0 = getAmount0ForLiquidity(sqrtRatioX96, sqrtRatioBX96, liquidity); + amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioX96, liquidity); + } else { + amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); + } + } +} diff --git a/lib/v3-periphery/contracts/libraries/NFTDescriptor.sol b/lib/v3-periphery/contracts/libraries/NFTDescriptor.sol new file mode 100644 index 0000000..8414872 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/NFTDescriptor.sol @@ -0,0 +1,477 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.0; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/libraries/BitMath.sol'; +import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; +import '@openzeppelin/contracts/utils/Strings.sol'; +import '@openzeppelin/contracts/math/SafeMath.sol'; +import '@openzeppelin/contracts/math/SignedSafeMath.sol'; +import 'base64-sol/base64.sol'; +import './HexStrings.sol'; +import './NFTSVG.sol'; + +library NFTDescriptor { + using TickMath for int24; + using Strings for uint256; + using SafeMath for uint256; + using SafeMath for uint160; + using SafeMath for uint8; + using SignedSafeMath for int256; + using HexStrings for uint256; + + uint256 constant sqrt10X128 = 1076067327063303206878105757264492625226; + + struct ConstructTokenURIParams { + uint256 tokenId; + address quoteTokenAddress; + address baseTokenAddress; + string quoteTokenSymbol; + string baseTokenSymbol; + uint8 quoteTokenDecimals; + uint8 baseTokenDecimals; + bool flipRatio; + int24 tickLower; + int24 tickUpper; + int24 tickCurrent; + int24 tickSpacing; + uint24 fee; + address poolAddress; + } + + function constructTokenURI(ConstructTokenURIParams memory params) public pure returns (string memory) { + string memory name = generateName(params, feeToPercentString(params.fee)); + string memory descriptionPartOne = + generateDescriptionPartOne( + escapeQuotes(params.quoteTokenSymbol), + escapeQuotes(params.baseTokenSymbol), + addressToString(params.poolAddress) + ); + string memory descriptionPartTwo = + generateDescriptionPartTwo( + params.tokenId.toString(), + escapeQuotes(params.baseTokenSymbol), + addressToString(params.quoteTokenAddress), + addressToString(params.baseTokenAddress), + feeToPercentString(params.fee) + ); + string memory image = Base64.encode(bytes(generateSVGImage(params))); + + return + string( + abi.encodePacked( + 'data:application/json;base64,', + Base64.encode( + bytes( + abi.encodePacked( + '{"name":"', + name, + '", "description":"', + descriptionPartOne, + descriptionPartTwo, + '", "image": "', + 'data:image/svg+xml;base64,', + image, + '"}' + ) + ) + ) + ) + ); + } + + function escapeQuotes(string memory symbol) internal pure returns (string memory) { + bytes memory symbolBytes = bytes(symbol); + uint8 quotesCount = 0; + for (uint8 i = 0; i < symbolBytes.length; i++) { + if (symbolBytes[i] == '"') { + quotesCount++; + } + } + if (quotesCount > 0) { + bytes memory escapedBytes = new bytes(symbolBytes.length + (quotesCount)); + uint256 index; + for (uint8 i = 0; i < symbolBytes.length; i++) { + if (symbolBytes[i] == '"') { + escapedBytes[index++] = '\\'; + } + escapedBytes[index++] = symbolBytes[i]; + } + return string(escapedBytes); + } + return symbol; + } + + function generateDescriptionPartOne( + string memory quoteTokenSymbol, + string memory baseTokenSymbol, + string memory poolAddress + ) private pure returns (string memory) { + return + string( + abi.encodePacked( + 'This NFT represents a liquidity position in a Uniswap V3 ', + quoteTokenSymbol, + '-', + baseTokenSymbol, + ' pool. ', + 'The owner of this NFT can modify or redeem the position.\\n', + '\\nPool Address: ', + poolAddress, + '\\n', + quoteTokenSymbol + ) + ); + } + + function generateDescriptionPartTwo( + string memory tokenId, + string memory baseTokenSymbol, + string memory quoteTokenAddress, + string memory baseTokenAddress, + string memory feeTier + ) private pure returns (string memory) { + return + string( + abi.encodePacked( + ' Address: ', + quoteTokenAddress, + '\\n', + baseTokenSymbol, + ' Address: ', + baseTokenAddress, + '\\nFee Tier: ', + feeTier, + '\\nToken ID: ', + tokenId, + '\\n\\n', + unicode'⚠️ DISCLAIMER: Due diligence is imperative when assessing this NFT. Make sure token addresses match the expected tokens, as token symbols may be imitated.' + ) + ); + } + + function generateName(ConstructTokenURIParams memory params, string memory feeTier) + private + pure + returns (string memory) + { + return + string( + abi.encodePacked( + 'Uniswap - ', + feeTier, + ' - ', + escapeQuotes(params.quoteTokenSymbol), + '/', + escapeQuotes(params.baseTokenSymbol), + ' - ', + tickToDecimalString( + !params.flipRatio ? params.tickLower : params.tickUpper, + params.tickSpacing, + params.baseTokenDecimals, + params.quoteTokenDecimals, + params.flipRatio + ), + '<>', + tickToDecimalString( + !params.flipRatio ? params.tickUpper : params.tickLower, + params.tickSpacing, + params.baseTokenDecimals, + params.quoteTokenDecimals, + params.flipRatio + ) + ) + ); + } + + struct DecimalStringParams { + // significant figures of decimal + uint256 sigfigs; + // length of decimal string + uint8 bufferLength; + // ending index for significant figures (funtion works backwards when copying sigfigs) + uint8 sigfigIndex; + // index of decimal place (0 if no decimal) + uint8 decimalIndex; + // start index for trailing/leading 0's for very small/large numbers + uint8 zerosStartIndex; + // end index for trailing/leading 0's for very small/large numbers + uint8 zerosEndIndex; + // true if decimal number is less than one + bool isLessThanOne; + // true if string should include "%" + bool isPercent; + } + + function generateDecimalString(DecimalStringParams memory params) private pure returns (string memory) { + bytes memory buffer = new bytes(params.bufferLength); + if (params.isPercent) { + buffer[buffer.length - 1] = '%'; + } + if (params.isLessThanOne) { + buffer[0] = '0'; + buffer[1] = '.'; + } + + // add leading/trailing 0's + for (uint256 zerosCursor = params.zerosStartIndex; zerosCursor < params.zerosEndIndex.add(1); zerosCursor++) { + buffer[zerosCursor] = bytes1(uint8(48)); + } + // add sigfigs + while (params.sigfigs > 0) { + if (params.decimalIndex > 0 && params.sigfigIndex == params.decimalIndex) { + buffer[params.sigfigIndex--] = '.'; + } + buffer[params.sigfigIndex--] = bytes1(uint8(uint256(48).add(params.sigfigs % 10))); + params.sigfigs /= 10; + } + return string(buffer); + } + + function tickToDecimalString( + int24 tick, + int24 tickSpacing, + uint8 baseTokenDecimals, + uint8 quoteTokenDecimals, + bool flipRatio + ) internal pure returns (string memory) { + if (tick == (TickMath.MIN_TICK / tickSpacing) * tickSpacing) { + return !flipRatio ? 'MIN' : 'MAX'; + } else if (tick == (TickMath.MAX_TICK / tickSpacing) * tickSpacing) { + return !flipRatio ? 'MAX' : 'MIN'; + } else { + uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); + if (flipRatio) { + sqrtRatioX96 = uint160(uint256(1 << 192).div(sqrtRatioX96)); + } + return fixedPointToDecimalString(sqrtRatioX96, baseTokenDecimals, quoteTokenDecimals); + } + } + + function sigfigsRounded(uint256 value, uint8 digits) private pure returns (uint256, bool) { + bool extraDigit; + if (digits > 5) { + value = value.div((10**(digits - 5))); + } + bool roundUp = value % 10 > 4; + value = value.div(10); + if (roundUp) { + value = value + 1; + } + // 99999 -> 100000 gives an extra sigfig + if (value == 100000) { + value /= 10; + extraDigit = true; + } + return (value, extraDigit); + } + + function adjustForDecimalPrecision( + uint160 sqrtRatioX96, + uint8 baseTokenDecimals, + uint8 quoteTokenDecimals + ) private pure returns (uint256 adjustedSqrtRatioX96) { + uint256 difference = abs(int256(baseTokenDecimals).sub(int256(quoteTokenDecimals))); + if (difference > 0 && difference <= 18) { + if (baseTokenDecimals > quoteTokenDecimals) { + adjustedSqrtRatioX96 = sqrtRatioX96.mul(10**(difference.div(2))); + if (difference % 2 == 1) { + adjustedSqrtRatioX96 = FullMath.mulDiv(adjustedSqrtRatioX96, sqrt10X128, 1 << 128); + } + } else { + adjustedSqrtRatioX96 = sqrtRatioX96.div(10**(difference.div(2))); + if (difference % 2 == 1) { + adjustedSqrtRatioX96 = FullMath.mulDiv(adjustedSqrtRatioX96, 1 << 128, sqrt10X128); + } + } + } else { + adjustedSqrtRatioX96 = uint256(sqrtRatioX96); + } + } + + function abs(int256 x) private pure returns (uint256) { + return uint256(x >= 0 ? x : -x); + } + + // @notice Returns string that includes first 5 significant figures of a decimal number + // @param sqrtRatioX96 a sqrt price + function fixedPointToDecimalString( + uint160 sqrtRatioX96, + uint8 baseTokenDecimals, + uint8 quoteTokenDecimals + ) internal pure returns (string memory) { + uint256 adjustedSqrtRatioX96 = adjustForDecimalPrecision(sqrtRatioX96, baseTokenDecimals, quoteTokenDecimals); + uint256 value = FullMath.mulDiv(adjustedSqrtRatioX96, adjustedSqrtRatioX96, 1 << 64); + + bool priceBelow1 = adjustedSqrtRatioX96 < 2**96; + if (priceBelow1) { + // 10 ** 43 is precision needed to retreive 5 sigfigs of smallest possible price + 1 for rounding + value = FullMath.mulDiv(value, 10**44, 1 << 128); + } else { + // leave precision for 4 decimal places + 1 place for rounding + value = FullMath.mulDiv(value, 10**5, 1 << 128); + } + + // get digit count + uint256 temp = value; + uint8 digits; + while (temp != 0) { + digits++; + temp /= 10; + } + // don't count extra digit kept for rounding + digits = digits - 1; + + // address rounding + (uint256 sigfigs, bool extraDigit) = sigfigsRounded(value, digits); + if (extraDigit) { + digits++; + } + + DecimalStringParams memory params; + if (priceBelow1) { + // 7 bytes ( "0." and 5 sigfigs) + leading 0's bytes + params.bufferLength = uint8(uint8(7).add(uint8(43).sub(digits))); + params.zerosStartIndex = 2; + params.zerosEndIndex = uint8(uint256(43).sub(digits).add(1)); + params.sigfigIndex = uint8(params.bufferLength.sub(1)); + } else if (digits >= 9) { + // no decimal in price string + params.bufferLength = uint8(digits.sub(4)); + params.zerosStartIndex = 5; + params.zerosEndIndex = uint8(params.bufferLength.sub(1)); + params.sigfigIndex = 4; + } else { + // 5 sigfigs surround decimal + params.bufferLength = 6; + params.sigfigIndex = 5; + params.decimalIndex = uint8(digits.sub(5).add(1)); + } + params.sigfigs = sigfigs; + params.isLessThanOne = priceBelow1; + params.isPercent = false; + + return generateDecimalString(params); + } + + // @notice Returns string as decimal percentage of fee amount. + // @param fee fee amount + function feeToPercentString(uint24 fee) internal pure returns (string memory) { + if (fee == 0) { + return '0%'; + } + uint24 temp = fee; + uint256 digits; + uint8 numSigfigs; + while (temp != 0) { + if (numSigfigs > 0) { + // count all digits preceding least significant figure + numSigfigs++; + } else if (temp % 10 != 0) { + numSigfigs++; + } + digits++; + temp /= 10; + } + + DecimalStringParams memory params; + uint256 nZeros; + if (digits >= 5) { + // if decimal > 1 (5th digit is the ones place) + uint256 decimalPlace = digits.sub(numSigfigs) >= 4 ? 0 : 1; + nZeros = digits.sub(5) < (numSigfigs.sub(1)) ? 0 : digits.sub(5).sub(numSigfigs.sub(1)); + params.zerosStartIndex = numSigfigs; + params.zerosEndIndex = uint8(params.zerosStartIndex.add(nZeros).sub(1)); + params.sigfigIndex = uint8(params.zerosStartIndex.sub(1).add(decimalPlace)); + params.bufferLength = uint8(nZeros.add(numSigfigs.add(1)).add(decimalPlace)); + } else { + // else if decimal < 1 + nZeros = uint256(5).sub(digits); + params.zerosStartIndex = 2; + params.zerosEndIndex = uint8(nZeros.add(params.zerosStartIndex).sub(1)); + params.bufferLength = uint8(nZeros.add(numSigfigs.add(2))); + params.sigfigIndex = uint8((params.bufferLength).sub(2)); + params.isLessThanOne = true; + } + params.sigfigs = uint256(fee).div(10**(digits.sub(numSigfigs))); + params.isPercent = true; + params.decimalIndex = digits > 4 ? uint8(digits.sub(4)) : 0; + + return generateDecimalString(params); + } + + function addressToString(address addr) internal pure returns (string memory) { + return (uint256(addr)).toHexString(20); + } + + function generateSVGImage(ConstructTokenURIParams memory params) internal pure returns (string memory svg) { + NFTSVG.SVGParams memory svgParams = + NFTSVG.SVGParams({ + quoteToken: addressToString(params.quoteTokenAddress), + baseToken: addressToString(params.baseTokenAddress), + poolAddress: params.poolAddress, + quoteTokenSymbol: params.quoteTokenSymbol, + baseTokenSymbol: params.baseTokenSymbol, + feeTier: feeToPercentString(params.fee), + tickLower: params.tickLower, + tickUpper: params.tickUpper, + tickSpacing: params.tickSpacing, + overRange: overRange(params.tickLower, params.tickUpper, params.tickCurrent), + tokenId: params.tokenId, + color0: tokenToColorHex(uint256(params.quoteTokenAddress), 136), + color1: tokenToColorHex(uint256(params.baseTokenAddress), 136), + color2: tokenToColorHex(uint256(params.quoteTokenAddress), 0), + color3: tokenToColorHex(uint256(params.baseTokenAddress), 0), + x1: scale(getCircleCoord(uint256(params.quoteTokenAddress), 16, params.tokenId), 0, 255, 16, 274), + y1: scale(getCircleCoord(uint256(params.baseTokenAddress), 16, params.tokenId), 0, 255, 100, 484), + x2: scale(getCircleCoord(uint256(params.quoteTokenAddress), 32, params.tokenId), 0, 255, 16, 274), + y2: scale(getCircleCoord(uint256(params.baseTokenAddress), 32, params.tokenId), 0, 255, 100, 484), + x3: scale(getCircleCoord(uint256(params.quoteTokenAddress), 48, params.tokenId), 0, 255, 16, 274), + y3: scale(getCircleCoord(uint256(params.baseTokenAddress), 48, params.tokenId), 0, 255, 100, 484) + }); + + return NFTSVG.generateSVG(svgParams); + } + + function overRange( + int24 tickLower, + int24 tickUpper, + int24 tickCurrent + ) private pure returns (int8) { + if (tickCurrent < tickLower) { + return -1; + } else if (tickCurrent > tickUpper) { + return 1; + } else { + return 0; + } + } + + function scale( + uint256 n, + uint256 inMn, + uint256 inMx, + uint256 outMn, + uint256 outMx + ) private pure returns (string memory) { + return (n.sub(inMn).mul(outMx.sub(outMn)).div(inMx.sub(inMn)).add(outMn)).toString(); + } + + function tokenToColorHex(uint256 token, uint256 offset) internal pure returns (string memory str) { + return string((token >> offset).toHexStringNoPrefix(3)); + } + + function getCircleCoord( + uint256 tokenAddress, + uint256 offset, + uint256 tokenId + ) internal pure returns (uint256) { + return (sliceTokenHex(tokenAddress, offset) * tokenId) % 255; + } + + function sliceTokenHex(uint256 token, uint256 offset) internal pure returns (uint256) { + return uint256(uint8(token >> offset)); + } +} diff --git a/lib/v3-periphery/contracts/libraries/NFTSVG.sol b/lib/v3-periphery/contracts/libraries/NFTSVG.sol new file mode 100644 index 0000000..2d5ce83 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/NFTSVG.sol @@ -0,0 +1,406 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.7.6; + +import '@openzeppelin/contracts/utils/Strings.sol'; +import '@uniswap/v3-core/contracts/libraries/BitMath.sol'; +import 'base64-sol/base64.sol'; + +/// @title NFTSVG +/// @notice Provides a function for generating an SVG associated with a Uniswap NFT +library NFTSVG { + using Strings for uint256; + + string constant curve1 = 'M1 1C41 41 105 105 145 145'; + string constant curve2 = 'M1 1C33 49 97 113 145 145'; + string constant curve3 = 'M1 1C33 57 89 113 145 145'; + string constant curve4 = 'M1 1C25 65 81 121 145 145'; + string constant curve5 = 'M1 1C17 73 73 129 145 145'; + string constant curve6 = 'M1 1C9 81 65 137 145 145'; + string constant curve7 = 'M1 1C1 89 57.5 145 145 145'; + string constant curve8 = 'M1 1C1 97 49 145 145 145'; + + struct SVGParams { + string quoteToken; + string baseToken; + address poolAddress; + string quoteTokenSymbol; + string baseTokenSymbol; + string feeTier; + int24 tickLower; + int24 tickUpper; + int24 tickSpacing; + int8 overRange; + uint256 tokenId; + string color0; + string color1; + string color2; + string color3; + string x1; + string y1; + string x2; + string y2; + string x3; + string y3; + } + + function generateSVG(SVGParams memory params) internal pure returns (string memory svg) { + /* + address: "0xe8ab59d3bcde16a29912de83a90eb39628cfc163", + msg: "Forged in SVG for Uniswap in 2021 by 0xe8ab59d3bcde16a29912de83a90eb39628cfc163", + sig: "0x2df0e99d9cbfec33a705d83f75666d98b22dea7c1af412c584f7d626d83f02875993df740dc87563b9c73378f8462426da572d7989de88079a382ad96c57b68d1b", + version: "2" + */ + return + string( + abi.encodePacked( + generateSVGDefs(params), + generateSVGBorderText( + params.quoteToken, + params.baseToken, + params.quoteTokenSymbol, + params.baseTokenSymbol + ), + generateSVGCardMantle(params.quoteTokenSymbol, params.baseTokenSymbol, params.feeTier), + generageSvgCurve(params.tickLower, params.tickUpper, params.tickSpacing, params.overRange), + generateSVGPositionDataAndLocationCurve( + params.tokenId.toString(), + params.tickLower, + params.tickUpper + ), + generateSVGRareSparkle(params.tokenId, params.poolAddress), + '' + ) + ); + } + + function generateSVGDefs(SVGParams memory params) private pure returns (string memory svg) { + svg = string( + abi.encodePacked( + '", + '', + '" + ) + ) + ), + '"/>" + ) + ) + ), + '"/>" + ) + ) + ), + '" />', + '" + ) + ) + ), + '" /> ', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ' ', + '', + '', + '' + ) + ); + } + + function generateSVGBorderText( + string memory quoteToken, + string memory baseToken, + string memory quoteTokenSymbol, + string memory baseTokenSymbol + ) private pure returns (string memory svg) { + svg = string( + abi.encodePacked( + '', + '', + baseToken, + unicode' • ', + baseTokenSymbol, + ' ', + ' ', + baseToken, + unicode' • ', + baseTokenSymbol, + ' ', + '', + quoteToken, + unicode' • ', + quoteTokenSymbol, + ' ', + quoteToken, + unicode' • ', + quoteTokenSymbol, + ' ' + ) + ); + } + + function generateSVGCardMantle( + string memory quoteTokenSymbol, + string memory baseTokenSymbol, + string memory feeTier + ) private pure returns (string memory svg) { + svg = string( + abi.encodePacked( + ' ', + quoteTokenSymbol, + '/', + baseTokenSymbol, + '', + feeTier, + '', + '' + ) + ); + } + + function generageSvgCurve( + int24 tickLower, + int24 tickUpper, + int24 tickSpacing, + int8 overRange + ) private pure returns (string memory svg) { + string memory fade = overRange == 1 ? '#fade-up' : overRange == -1 ? '#fade-down' : '#none'; + string memory curve = getCurve(tickLower, tickUpper, tickSpacing); + svg = string( + abi.encodePacked( + '' + '' + '', + '', + '', + '', + generateSVGCurveCircle(overRange) + ) + ); + } + + function getCurve( + int24 tickLower, + int24 tickUpper, + int24 tickSpacing + ) internal pure returns (string memory curve) { + int24 tickRange = (tickUpper - tickLower) / tickSpacing; + if (tickRange <= 4) { + curve = curve1; + } else if (tickRange <= 8) { + curve = curve2; + } else if (tickRange <= 16) { + curve = curve3; + } else if (tickRange <= 32) { + curve = curve4; + } else if (tickRange <= 64) { + curve = curve5; + } else if (tickRange <= 128) { + curve = curve6; + } else if (tickRange <= 256) { + curve = curve7; + } else { + curve = curve8; + } + } + + function generateSVGCurveCircle(int8 overRange) internal pure returns (string memory svg) { + string memory curvex1 = '73'; + string memory curvey1 = '190'; + string memory curvex2 = '217'; + string memory curvey2 = '334'; + if (overRange == 1 || overRange == -1) { + svg = string( + abi.encodePacked( + '' + ) + ); + } else { + svg = string( + abi.encodePacked( + '', + '' + ) + ); + } + } + + function generateSVGPositionDataAndLocationCurve( + string memory tokenId, + int24 tickLower, + int24 tickUpper + ) private pure returns (string memory svg) { + string memory tickLowerStr = tickToString(tickLower); + string memory tickUpperStr = tickToString(tickUpper); + uint256 str1length = bytes(tokenId).length + 4; + uint256 str2length = bytes(tickLowerStr).length + 10; + uint256 str3length = bytes(tickUpperStr).length + 10; + (string memory xCoord, string memory yCoord) = rangeLocation(tickLower, tickUpper); + svg = string( + abi.encodePacked( + ' ', + '', + 'ID: ', + tokenId, + '', + ' ', + '', + 'Min Tick: ', + tickLowerStr, + '', + ' ', + '', + 'Max Tick: ', + tickUpperStr, + '' + '', + '', + '', + '' + ) + ); + } + + function tickToString(int24 tick) private pure returns (string memory) { + string memory sign = ''; + if (tick < 0) { + tick = tick * -1; + sign = '-'; + } + return string(abi.encodePacked(sign, uint256(tick).toString())); + } + + function rangeLocation(int24 tickLower, int24 tickUpper) internal pure returns (string memory, string memory) { + int24 midPoint = (tickLower + tickUpper) / 2; + if (midPoint < -125_000) { + return ('8', '7'); + } else if (midPoint < -75_000) { + return ('8', '10.5'); + } else if (midPoint < -25_000) { + return ('8', '14.25'); + } else if (midPoint < -5_000) { + return ('10', '18'); + } else if (midPoint < 0) { + return ('11', '21'); + } else if (midPoint < 5_000) { + return ('13', '23'); + } else if (midPoint < 25_000) { + return ('15', '25'); + } else if (midPoint < 75_000) { + return ('18', '26'); + } else if (midPoint < 125_000) { + return ('21', '27'); + } else { + return ('24', '27'); + } + } + + function generateSVGRareSparkle(uint256 tokenId, address poolAddress) private pure returns (string memory svg) { + if (isRare(tokenId, poolAddress)) { + svg = string( + abi.encodePacked( + '', + '', + '' + ) + ); + } else { + svg = ''; + } + } + + function isRare(uint256 tokenId, address poolAddress) internal pure returns (bool) { + bytes32 h = keccak256(abi.encodePacked(tokenId, poolAddress)); + return uint256(h) < type(uint256).max / (1 + BitMath.mostSignificantBit(tokenId) * 2); + } +} diff --git a/lib/v3-periphery/contracts/libraries/OracleLibrary.sol b/lib/v3-periphery/contracts/libraries/OracleLibrary.sol new file mode 100644 index 0000000..ddb82be --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/OracleLibrary.sol @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0 <0.8.0; + +import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +/// @title Oracle library +/// @notice Provides functions to integrate with V3 pool oracle +library OracleLibrary { + /// @notice Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool + /// @param pool Address of the pool that we want to observe + /// @param secondsAgo Number of seconds in the past from which to calculate the time-weighted means + /// @return arithmeticMeanTick The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp + /// @return harmonicMeanLiquidity The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp + function consult(address pool, uint32 secondsAgo) + internal + view + returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity) + { + require(secondsAgo != 0, 'BP'); + + uint32[] memory secondsAgos = new uint32[](2); + secondsAgos[0] = secondsAgo; + secondsAgos[1] = 0; + + (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) = + IUniswapV3Pool(pool).observe(secondsAgos); + + int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0]; + uint160 secondsPerLiquidityCumulativesDelta = + secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0]; + + arithmeticMeanTick = int24(tickCumulativesDelta / secondsAgo); + // Always round to negative infinity + if (tickCumulativesDelta < 0 && (tickCumulativesDelta % secondsAgo != 0)) arithmeticMeanTick--; + + // We are multiplying here instead of shifting to ensure that harmonicMeanLiquidity doesn't overflow uint128 + uint192 secondsAgoX160 = uint192(secondsAgo) * type(uint160).max; + harmonicMeanLiquidity = uint128(secondsAgoX160 / (uint192(secondsPerLiquidityCumulativesDelta) << 32)); + } + + /// @notice Given a tick and a token amount, calculates the amount of token received in exchange + /// @param tick Tick value used to calculate the quote + /// @param baseAmount Amount of token to be converted + /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination + /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination + /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken + function getQuoteAtTick( + int24 tick, + uint128 baseAmount, + address baseToken, + address quoteToken + ) internal pure returns (uint256 quoteAmount) { + uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick); + + // Calculate quoteAmount with better precision if it doesn't overflow when multiplied by itself + if (sqrtRatioX96 <= type(uint128).max) { + uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96; + quoteAmount = baseToken < quoteToken + ? FullMath.mulDiv(ratioX192, baseAmount, 1 << 192) + : FullMath.mulDiv(1 << 192, baseAmount, ratioX192); + } else { + uint256 ratioX128 = FullMath.mulDiv(sqrtRatioX96, sqrtRatioX96, 1 << 64); + quoteAmount = baseToken < quoteToken + ? FullMath.mulDiv(ratioX128, baseAmount, 1 << 128) + : FullMath.mulDiv(1 << 128, baseAmount, ratioX128); + } + } + + /// @notice Given a pool, it returns the number of seconds ago of the oldest stored observation + /// @param pool Address of Uniswap V3 pool that we want to observe + /// @return secondsAgo The number of seconds ago of the oldest observation stored for the pool + function getOldestObservationSecondsAgo(address pool) internal view returns (uint32 secondsAgo) { + (, , uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0(); + require(observationCardinality > 0, 'NI'); + + (uint32 observationTimestamp, , , bool initialized) = + IUniswapV3Pool(pool).observations((observationIndex + 1) % observationCardinality); + + // The next index might not be initialized if the cardinality is in the process of increasing + // In this case the oldest observation is always in index 0 + if (!initialized) { + (observationTimestamp, , , ) = IUniswapV3Pool(pool).observations(0); + } + + secondsAgo = uint32(block.timestamp) - observationTimestamp; + } + + /// @notice Given a pool, it returns the tick value as of the start of the current block + /// @param pool Address of Uniswap V3 pool + /// @return The tick that the pool was in at the start of the current block + function getBlockStartingTickAndLiquidity(address pool) internal view returns (int24, uint128) { + (, int24 tick, uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0(); + + // 2 observations are needed to reliably calculate the block starting tick + require(observationCardinality > 1, 'NEO'); + + // If the latest observation occurred in the past, then no tick-changing trades have happened in this block + // therefore the tick in `slot0` is the same as at the beginning of the current block. + // We don't need to check if this observation is initialized - it is guaranteed to be. + (uint32 observationTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, ) = + IUniswapV3Pool(pool).observations(observationIndex); + if (observationTimestamp != uint32(block.timestamp)) { + return (tick, IUniswapV3Pool(pool).liquidity()); + } + + uint256 prevIndex = (uint256(observationIndex) + observationCardinality - 1) % observationCardinality; + ( + uint32 prevObservationTimestamp, + int56 prevTickCumulative, + uint160 prevSecondsPerLiquidityCumulativeX128, + bool prevInitialized + ) = IUniswapV3Pool(pool).observations(prevIndex); + + require(prevInitialized, 'ONI'); + + uint32 delta = observationTimestamp - prevObservationTimestamp; + tick = int24((tickCumulative - prevTickCumulative) / delta); + uint128 liquidity = + uint128( + (uint192(delta) * type(uint160).max) / + (uint192(secondsPerLiquidityCumulativeX128 - prevSecondsPerLiquidityCumulativeX128) << 32) + ); + return (tick, liquidity); + } + + /// @notice Information for calculating a weighted arithmetic mean tick + struct WeightedTickData { + int24 tick; + uint128 weight; + } + + /// @notice Given an array of ticks and weights, calculates the weighted arithmetic mean tick + /// @param weightedTickData An array of ticks and weights + /// @return weightedArithmeticMeanTick The weighted arithmetic mean tick + /// @dev Each entry of `weightedTickData` should represents ticks from pools with the same underlying pool tokens. If they do not, + /// extreme care must be taken to ensure that ticks are comparable (including decimal differences). + /// @dev Note that the weighted arithmetic mean tick corresponds to the weighted geometric mean price. + function getWeightedArithmeticMeanTick(WeightedTickData[] memory weightedTickData) + internal + pure + returns (int24 weightedArithmeticMeanTick) + { + // Accumulates the sum of products between each tick and its weight + int256 numerator; + + // Accumulates the sum of the weights + uint256 denominator; + + // Products fit in 152 bits, so it would take an array of length ~2**104 to overflow this logic + for (uint256 i; i < weightedTickData.length; i++) { + numerator += weightedTickData[i].tick * int256(weightedTickData[i].weight); + denominator += weightedTickData[i].weight; + } + + weightedArithmeticMeanTick = int24(numerator / int256(denominator)); + // Always round to negative infinity + if (numerator < 0 && (numerator % int256(denominator) != 0)) weightedArithmeticMeanTick--; + } + + /// @notice Returns the "synthetic" tick which represents the price of the first entry in `tokens` in terms of the last + /// @dev Useful for calculating relative prices along routes. + /// @dev There must be one tick for each pairwise set of tokens. + /// @param tokens The token contract addresses + /// @param ticks The ticks, representing the price of each token pair in `tokens` + /// @return syntheticTick The synthetic tick, representing the relative price of the outermost tokens in `tokens` + function getChainedPrice(address[] memory tokens, int24[] memory ticks) + internal + pure + returns (int256 syntheticTick) + { + require(tokens.length - 1 == ticks.length, 'DL'); + for (uint256 i = 1; i <= ticks.length; i++) { + // check the tokens for address sort order, then accumulate the + // ticks into the running synthetic tick, ensuring that intermediate tokens "cancel out" + tokens[i - 1] < tokens[i] ? syntheticTick += ticks[i - 1] : syntheticTick -= ticks[i - 1]; + } + } +} diff --git a/lib/v3-periphery/contracts/libraries/Path.sol b/lib/v3-periphery/contracts/libraries/Path.sol new file mode 100644 index 0000000..d6ee864 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/Path.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.6.0; + +import './BytesLib.sol'; + +/// @title Functions for manipulating path data for multihop swaps +library Path { + using BytesLib for bytes; + + /// @dev The length of the bytes encoded address + uint256 private constant ADDR_SIZE = 20; + /// @dev The length of the bytes encoded fee + uint256 private constant FEE_SIZE = 3; + + /// @dev The offset of a single token address and pool fee + uint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE; + /// @dev The offset of an encoded pool key + uint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE; + /// @dev The minimum length of an encoding that contains 2 or more pools + uint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET; + + /// @notice Returns true iff the path contains two or more pools + /// @param path The encoded swap path + /// @return True if path contains two or more pools, otherwise false + function hasMultiplePools(bytes memory path) internal pure returns (bool) { + return path.length >= MULTIPLE_POOLS_MIN_LENGTH; + } + + /// @notice Returns the number of pools in the path + /// @param path The encoded swap path + /// @return The number of pools in the path + function numPools(bytes memory path) internal pure returns (uint256) { + // Ignore the first token address. From then on every fee and token offset indicates a pool. + return ((path.length - ADDR_SIZE) / NEXT_OFFSET); + } + + /// @notice Decodes the first pool in path + /// @param path The bytes encoded swap path + /// @return tokenA The first token of the given pool + /// @return tokenB The second token of the given pool + /// @return fee The fee level of the pool + function decodeFirstPool(bytes memory path) + internal + pure + returns ( + address tokenA, + address tokenB, + uint24 fee + ) + { + tokenA = path.toAddress(0); + fee = path.toUint24(ADDR_SIZE); + tokenB = path.toAddress(NEXT_OFFSET); + } + + /// @notice Gets the segment corresponding to the first pool in the path + /// @param path The bytes encoded swap path + /// @return The segment containing all data necessary to target the first pool in the path + function getFirstPool(bytes memory path) internal pure returns (bytes memory) { + return path.slice(0, POP_OFFSET); + } + + /// @notice Skips a token + fee element from the buffer and returns the remainder + /// @param path The swap path + /// @return The remaining token + fee elements in the path + function skipToken(bytes memory path) internal pure returns (bytes memory) { + return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET); + } +} diff --git a/lib/v3-periphery/contracts/libraries/PoolAddress.sol b/lib/v3-periphery/contracts/libraries/PoolAddress.sol new file mode 100644 index 0000000..60de385 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/PoolAddress.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee +library PoolAddress { + bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54; + + /// @notice The identifying key of the pool + struct PoolKey { + address token0; + address token1; + uint24 fee; + } + + /// @notice Returns PoolKey: the ordered tokens with the matched fee levels + /// @param tokenA The first token of a pool, unsorted + /// @param tokenB The second token of a pool, unsorted + /// @param fee The fee level of the pool + /// @return Poolkey The pool details with ordered token0 and token1 assignments + function getPoolKey( + address tokenA, + address tokenB, + uint24 fee + ) internal pure returns (PoolKey memory) { + if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA); + return PoolKey({token0: tokenA, token1: tokenB, fee: fee}); + } + + /// @notice Deterministically computes the pool address given the factory and PoolKey + /// @param factory The Uniswap V3 factory contract address + /// @param key The PoolKey + /// @return pool The contract address of the V3 pool + function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) { + require(key.token0 < key.token1); + pool = address( + uint256( + keccak256( + abi.encodePacked( + hex'ff', + factory, + keccak256(abi.encode(key.token0, key.token1, key.fee)), + POOL_INIT_CODE_HASH + ) + ) + ) + ); + } +} diff --git a/lib/v3-periphery/contracts/libraries/PoolTicksCounter.sol b/lib/v3-periphery/contracts/libraries/PoolTicksCounter.sol new file mode 100644 index 0000000..fb0682f --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/PoolTicksCounter.sol @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.6.0; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +library PoolTicksCounter { + /// @dev This function counts the number of initialized ticks that would incur a gas cost between tickBefore and tickAfter. + /// When tickBefore and/or tickAfter themselves are initialized, the logic over whether we should count them depends on the + /// direction of the swap. If we are swapping upwards (tickAfter > tickBefore) we don't want to count tickBefore but we do + /// want to count tickAfter. The opposite is true if we are swapping downwards. + function countInitializedTicksCrossed( + IUniswapV3Pool self, + int24 tickBefore, + int24 tickAfter + ) internal view returns (uint32 initializedTicksCrossed) { + int16 wordPosLower; + int16 wordPosHigher; + uint8 bitPosLower; + uint8 bitPosHigher; + bool tickBeforeInitialized; + bool tickAfterInitialized; + + { + // Get the key and offset in the tick bitmap of the active tick before and after the swap. + int16 wordPos = int16((tickBefore / self.tickSpacing()) >> 8); + uint8 bitPos = uint8((tickBefore / self.tickSpacing()) % 256); + + int16 wordPosAfter = int16((tickAfter / self.tickSpacing()) >> 8); + uint8 bitPosAfter = uint8((tickAfter / self.tickSpacing()) % 256); + + // In the case where tickAfter is initialized, we only want to count it if we are swapping downwards. + // If the initializable tick after the swap is initialized, our original tickAfter is a + // multiple of tick spacing, and we are swapping downwards we know that tickAfter is initialized + // and we shouldn't count it. + tickAfterInitialized = + ((self.tickBitmap(wordPosAfter) & (1 << bitPosAfter)) > 0) && + ((tickAfter % self.tickSpacing()) == 0) && + (tickBefore > tickAfter); + + // In the case where tickBefore is initialized, we only want to count it if we are swapping upwards. + // Use the same logic as above to decide whether we should count tickBefore or not. + tickBeforeInitialized = + ((self.tickBitmap(wordPos) & (1 << bitPos)) > 0) && + ((tickBefore % self.tickSpacing()) == 0) && + (tickBefore < tickAfter); + + if (wordPos < wordPosAfter || (wordPos == wordPosAfter && bitPos <= bitPosAfter)) { + wordPosLower = wordPos; + bitPosLower = bitPos; + wordPosHigher = wordPosAfter; + bitPosHigher = bitPosAfter; + } else { + wordPosLower = wordPosAfter; + bitPosLower = bitPosAfter; + wordPosHigher = wordPos; + bitPosHigher = bitPos; + } + } + + // Count the number of initialized ticks crossed by iterating through the tick bitmap. + // Our first mask should include the lower tick and everything to its left. + uint256 mask = type(uint256).max << bitPosLower; + while (wordPosLower <= wordPosHigher) { + // If we're on the final tick bitmap page, ensure we only count up to our + // ending tick. + if (wordPosLower == wordPosHigher) { + mask = mask & (type(uint256).max >> (255 - bitPosHigher)); + } + + uint256 masked = self.tickBitmap(wordPosLower) & mask; + initializedTicksCrossed += countOneBits(masked); + wordPosLower++; + // Reset our mask so we consider all bits on the next iteration. + mask = type(uint256).max; + } + + if (tickAfterInitialized) { + initializedTicksCrossed -= 1; + } + + if (tickBeforeInitialized) { + initializedTicksCrossed -= 1; + } + + return initializedTicksCrossed; + } + + function countOneBits(uint256 x) private pure returns (uint16) { + uint16 bits = 0; + while (x != 0) { + bits++; + x &= (x - 1); + } + return bits; + } +} diff --git a/lib/v3-periphery/contracts/libraries/PositionKey.sol b/lib/v3-periphery/contracts/libraries/PositionKey.sol new file mode 100644 index 0000000..a60fc18 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/PositionKey.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +library PositionKey { + /// @dev Returns the key of the position in the core library + function compute( + address owner, + int24 tickLower, + int24 tickUpper + ) internal pure returns (bytes32) { + return keccak256(abi.encodePacked(owner, tickLower, tickUpper)); + } +} diff --git a/lib/v3-periphery/contracts/libraries/PositionValue.sol b/lib/v3-periphery/contracts/libraries/PositionValue.sol new file mode 100644 index 0000000..265fc04 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/PositionValue.sol @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.6.8 <0.8.0; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@uniswap/v3-core/contracts/libraries/FixedPoint128.sol'; +import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; +import '@uniswap/v3-core/contracts/libraries/Tick.sol'; +import '../interfaces/INonfungiblePositionManager.sol'; +import './LiquidityAmounts.sol'; +import './PoolAddress.sol'; +import './PositionKey.sol'; + +/// @title Returns information about the token value held in a Uniswap V3 NFT +library PositionValue { + /// @notice Returns the total amounts of token0 and token1, i.e. the sum of fees and principal + /// that a given nonfungible position manager token is worth + /// @param positionManager The Uniswap V3 NonfungiblePositionManager + /// @param tokenId The tokenId of the token for which to get the total value + /// @param sqrtRatioX96 The square root price X96 for which to calculate the principal amounts + /// @return amount0 The total amount of token0 including principal and fees + /// @return amount1 The total amount of token1 including principal and fees + function total( + INonfungiblePositionManager positionManager, + uint256 tokenId, + uint160 sqrtRatioX96 + ) internal view returns (uint256 amount0, uint256 amount1) { + (uint256 amount0Principal, uint256 amount1Principal) = principal(positionManager, tokenId, sqrtRatioX96); + (uint256 amount0Fee, uint256 amount1Fee) = fees(positionManager, tokenId); + return (amount0Principal + amount0Fee, amount1Principal + amount1Fee); + } + + /// @notice Calculates the principal (currently acting as liquidity) owed to the token owner in the event + /// that the position is burned + /// @param positionManager The Uniswap V3 NonfungiblePositionManager + /// @param tokenId The tokenId of the token for which to get the total principal owed + /// @param sqrtRatioX96 The square root price X96 for which to calculate the principal amounts + /// @return amount0 The principal amount of token0 + /// @return amount1 The principal amount of token1 + function principal( + INonfungiblePositionManager positionManager, + uint256 tokenId, + uint160 sqrtRatioX96 + ) internal view returns (uint256 amount0, uint256 amount1) { + (, , , , , int24 tickLower, int24 tickUpper, uint128 liquidity, , , , ) = positionManager.positions(tokenId); + + return + LiquidityAmounts.getAmountsForLiquidity( + sqrtRatioX96, + TickMath.getSqrtRatioAtTick(tickLower), + TickMath.getSqrtRatioAtTick(tickUpper), + liquidity + ); + } + + struct FeeParams { + address token0; + address token1; + uint24 fee; + int24 tickLower; + int24 tickUpper; + uint128 liquidity; + uint256 positionFeeGrowthInside0LastX128; + uint256 positionFeeGrowthInside1LastX128; + uint256 tokensOwed0; + uint256 tokensOwed1; + } + + /// @notice Calculates the total fees owed to the token owner + /// @param positionManager The Uniswap V3 NonfungiblePositionManager + /// @param tokenId The tokenId of the token for which to get the total fees owed + /// @return amount0 The amount of fees owed in token0 + /// @return amount1 The amount of fees owed in token1 + function fees(INonfungiblePositionManager positionManager, uint256 tokenId) + internal + view + returns (uint256 amount0, uint256 amount1) + { + ( + , + , + address token0, + address token1, + uint24 fee, + int24 tickLower, + int24 tickUpper, + uint128 liquidity, + uint256 positionFeeGrowthInside0LastX128, + uint256 positionFeeGrowthInside1LastX128, + uint256 tokensOwed0, + uint256 tokensOwed1 + ) = positionManager.positions(tokenId); + + return + _fees( + positionManager, + FeeParams({ + token0: token0, + token1: token1, + fee: fee, + tickLower: tickLower, + tickUpper: tickUpper, + liquidity: liquidity, + positionFeeGrowthInside0LastX128: positionFeeGrowthInside0LastX128, + positionFeeGrowthInside1LastX128: positionFeeGrowthInside1LastX128, + tokensOwed0: tokensOwed0, + tokensOwed1: tokensOwed1 + }) + ); + } + + function _fees(INonfungiblePositionManager positionManager, FeeParams memory feeParams) + private + view + returns (uint256 amount0, uint256 amount1) + { + (uint256 poolFeeGrowthInside0LastX128, uint256 poolFeeGrowthInside1LastX128) = + _getFeeGrowthInside( + IUniswapV3Pool( + PoolAddress.computeAddress( + positionManager.factory(), + PoolAddress.PoolKey({token0: feeParams.token0, token1: feeParams.token1, fee: feeParams.fee}) + ) + ), + feeParams.tickLower, + feeParams.tickUpper + ); + + amount0 = + FullMath.mulDiv( + poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128, + feeParams.liquidity, + FixedPoint128.Q128 + ) + + feeParams.tokensOwed0; + + amount1 = + FullMath.mulDiv( + poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128, + feeParams.liquidity, + FixedPoint128.Q128 + ) + + feeParams.tokensOwed1; + } + + function _getFeeGrowthInside( + IUniswapV3Pool pool, + int24 tickLower, + int24 tickUpper + ) private view returns (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) { + (, int24 tickCurrent, , , , , ) = pool.slot0(); + (, , uint256 lowerFeeGrowthOutside0X128, uint256 lowerFeeGrowthOutside1X128, , , , ) = pool.ticks(tickLower); + (, , uint256 upperFeeGrowthOutside0X128, uint256 upperFeeGrowthOutside1X128, , , , ) = pool.ticks(tickUpper); + + if (tickCurrent < tickLower) { + feeGrowthInside0X128 = lowerFeeGrowthOutside0X128 - upperFeeGrowthOutside0X128; + feeGrowthInside1X128 = lowerFeeGrowthOutside1X128 - upperFeeGrowthOutside1X128; + } else if (tickCurrent < tickUpper) { + uint256 feeGrowthGlobal0X128 = pool.feeGrowthGlobal0X128(); + uint256 feeGrowthGlobal1X128 = pool.feeGrowthGlobal1X128(); + feeGrowthInside0X128 = feeGrowthGlobal0X128 - lowerFeeGrowthOutside0X128 - upperFeeGrowthOutside0X128; + feeGrowthInside1X128 = feeGrowthGlobal1X128 - lowerFeeGrowthOutside1X128 - upperFeeGrowthOutside1X128; + } else { + feeGrowthInside0X128 = upperFeeGrowthOutside0X128 - lowerFeeGrowthOutside0X128; + feeGrowthInside1X128 = upperFeeGrowthOutside1X128 - lowerFeeGrowthOutside1X128; + } + } +} diff --git a/lib/v3-periphery/contracts/libraries/SqrtPriceMathPartial.sol b/lib/v3-periphery/contracts/libraries/SqrtPriceMathPartial.sol new file mode 100644 index 0000000..bb8c769 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/SqrtPriceMathPartial.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; +import '@uniswap/v3-core/contracts/libraries/UnsafeMath.sol'; +import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol'; + +/// @title Functions based on Q64.96 sqrt price and liquidity +/// @notice Exposes two functions from @uniswap/v3-core SqrtPriceMath +/// that use square root of price as a Q64.96 and liquidity to compute deltas +library SqrtPriceMathPartial { + /// @notice Gets the amount0 delta between two prices + /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), + /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up or down + /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; + + require(sqrtRatioAX96 > 0); + + return + roundUp + ? UnsafeMath.divRoundingUp( + FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96), + sqrtRatioAX96 + ) + : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96; + } + + /// @notice Gets the amount1 delta between two prices + /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up, or down + /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + roundUp + ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96) + : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96); + } +} diff --git a/lib/v3-periphery/contracts/libraries/TokenRatioSortOrder.sol b/lib/v3-periphery/contracts/libraries/TokenRatioSortOrder.sol new file mode 100644 index 0000000..d9a2c9e --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/TokenRatioSortOrder.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: MIT +pragma solidity =0.7.6; + +library TokenRatioSortOrder { + int256 constant NUMERATOR_MOST = 300; + int256 constant NUMERATOR_MORE = 200; + int256 constant NUMERATOR = 100; + + int256 constant DENOMINATOR_MOST = -300; + int256 constant DENOMINATOR_MORE = -200; + int256 constant DENOMINATOR = -100; +} diff --git a/lib/v3-periphery/contracts/libraries/TransferHelper.sol b/lib/v3-periphery/contracts/libraries/TransferHelper.sol new file mode 100644 index 0000000..7fc2797 --- /dev/null +++ b/lib/v3-periphery/contracts/libraries/TransferHelper.sol @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.6.0; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; + +library TransferHelper { + /// @notice Transfers tokens from the targeted address to the given destination + /// @notice Errors with 'STF' if transfer fails + /// @param token The contract address of the token to be transferred + /// @param from The originating address from which the tokens will be transferred + /// @param to The destination address of the transfer + /// @param value The amount to be transferred + function safeTransferFrom( + address token, + address from, + address to, + uint256 value + ) internal { + (bool success, bytes memory data) = + token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); + require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF'); + } + + /// @notice Transfers tokens from msg.sender to a recipient + /// @dev Errors with ST if transfer fails + /// @param token The contract address of the token which will be transferred + /// @param to The recipient of the transfer + /// @param value The value of the transfer + function safeTransfer( + address token, + address to, + uint256 value + ) internal { + (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); + require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); + } + + /// @notice Approves the stipulated contract to spend the given allowance in the given token + /// @dev Errors with 'SA' if transfer fails + /// @param token The contract address of the token to be approved + /// @param to The target of the approval + /// @param value The amount of the given token the target will be allowed to spend + function safeApprove( + address token, + address to, + uint256 value + ) internal { + (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); + require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA'); + } + + /// @notice Transfers ETH to the recipient address + /// @dev Fails with `STE` + /// @param to The destination of the transfer + /// @param value The value to be transferred + function safeTransferETH(address to, uint256 value) internal { + (bool success, ) = to.call{value: value}(new bytes(0)); + require(success, 'STE'); + } +} diff --git a/lib/v3-periphery/contracts/test/Base64Test.sol b/lib/v3-periphery/contracts/test/Base64Test.sol new file mode 100644 index 0000000..cb66a87 --- /dev/null +++ b/lib/v3-periphery/contracts/test/Base64Test.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import 'base64-sol/base64.sol'; + +contract Base64Test { + function encode(bytes memory data) external pure returns (string memory) { + return Base64.encode(data); + } + + function getGasCostOfEncode(bytes memory data) external view returns (uint256) { + uint256 gasBefore = gasleft(); + Base64.encode(data); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/LiquidityAmountsTest.sol b/lib/v3-periphery/contracts/test/LiquidityAmountsTest.sol new file mode 100644 index 0000000..dad61c0 --- /dev/null +++ b/lib/v3-periphery/contracts/test/LiquidityAmountsTest.sol @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/LiquidityAmounts.sol'; + +contract LiquidityAmountsTest { + function getLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) external pure returns (uint128 liquidity) { + return LiquidityAmounts.getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); + } + + function getGasCostOfGetLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0); + return gasBefore - gasleft(); + } + + function getLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) external pure returns (uint128 liquidity) { + return LiquidityAmounts.getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); + } + + function getGasCostOfGetLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1); + return gasBefore - gasleft(); + } + + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) external pure returns (uint128 liquidity) { + return LiquidityAmounts.getLiquidityForAmounts(sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1); + } + + function getGasCostOfGetLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getLiquidityForAmounts(sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, amount0, amount1); + return gasBefore - gasleft(); + } + + function getAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external pure returns (uint256 amount0) { + return LiquidityAmounts.getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); + } + + function getGasCostOfGetAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); + return gasBefore - gasleft(); + } + + function getAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external pure returns (uint256 amount1) { + return LiquidityAmounts.getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity); + } + + function getGasCostOfGetAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, liquidity); + return gasBefore - gasleft(); + } + + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external pure returns (uint256 amount0, uint256 amount1) { + return LiquidityAmounts.getAmountsForLiquidity(sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, liquidity); + } + + function getGasCostOfGetAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + LiquidityAmounts.getAmountsForLiquidity(sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, liquidity); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/MockObservable.sol b/lib/v3-periphery/contracts/test/MockObservable.sol new file mode 100644 index 0000000..19e8674 --- /dev/null +++ b/lib/v3-periphery/contracts/test/MockObservable.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +contract MockObservable { + Observation private observation0; + Observation private observation1; + + struct Observation { + uint32 secondsAgo; + int56 tickCumulatives; + uint160 secondsPerLiquidityCumulativeX128s; + } + + constructor( + uint32[] memory secondsAgos, + int56[] memory tickCumulatives, + uint160[] memory secondsPerLiquidityCumulativeX128s + ) { + require( + secondsAgos.length == 2 && tickCumulatives.length == 2 && secondsPerLiquidityCumulativeX128s.length == 2, + 'Invalid test case size' + ); + + observation0 = Observation(secondsAgos[0], tickCumulatives[0], secondsPerLiquidityCumulativeX128s[0]); + observation1 = Observation(secondsAgos[1], tickCumulatives[1], secondsPerLiquidityCumulativeX128s[1]); + } + + function observe(uint32[] calldata secondsAgos) + external + view + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) + { + require( + secondsAgos[0] == observation0.secondsAgo && secondsAgos[1] == observation1.secondsAgo, + 'Invalid test case' + ); + + int56[] memory _tickCumulatives = new int56[](2); + _tickCumulatives[0] = observation0.tickCumulatives; + _tickCumulatives[1] = observation1.tickCumulatives; + + uint160[] memory _secondsPerLiquidityCumulativeX128s = new uint160[](2); + _secondsPerLiquidityCumulativeX128s[0] = observation0.secondsPerLiquidityCumulativeX128s; + _secondsPerLiquidityCumulativeX128s[1] = observation1.secondsPerLiquidityCumulativeX128s; + + return (_tickCumulatives, _secondsPerLiquidityCumulativeX128s); + } +} diff --git a/lib/v3-periphery/contracts/test/MockObservations.sol b/lib/v3-periphery/contracts/test/MockObservations.sol new file mode 100644 index 0000000..81b5c75 --- /dev/null +++ b/lib/v3-periphery/contracts/test/MockObservations.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '@uniswap/v3-core/contracts/libraries/Oracle.sol'; + +contract MockObservations { + Oracle.Observation[4] internal oracleObservations; + + int24 slot0Tick; + uint16 internal slot0ObservationCardinality; + uint16 internal slot0ObservationIndex; + uint128 public liquidity; + + bool internal lastObservationCurrentTimestamp; + + constructor( + uint32[4] memory _blockTimestamps, + int56[4] memory _tickCumulatives, + uint128[4] memory _secondsPerLiquidityCumulativeX128s, + bool[4] memory _initializeds, + int24 _tick, + uint16 _observationCardinality, + uint16 _observationIndex, + bool _lastObservationCurrentTimestamp, + uint128 _liquidity + ) { + for (uint256 i = 0; i < _blockTimestamps.length; i++) { + oracleObservations[i] = Oracle.Observation({ + blockTimestamp: _blockTimestamps[i], + tickCumulative: _tickCumulatives[i], + secondsPerLiquidityCumulativeX128: _secondsPerLiquidityCumulativeX128s[i], + initialized: _initializeds[i] + }); + } + + slot0Tick = _tick; + slot0ObservationCardinality = _observationCardinality; + slot0ObservationIndex = _observationIndex; + lastObservationCurrentTimestamp = _lastObservationCurrentTimestamp; + liquidity = _liquidity; + } + + function slot0() + external + view + returns ( + uint160, + int24, + uint16, + uint16, + uint16, + uint8, + bool + ) + { + return (0, slot0Tick, slot0ObservationIndex, slot0ObservationCardinality, 0, 0, false); + } + + function observations(uint256 index) + external + view + returns ( + uint32, + int56, + uint160, + bool + ) + { + Oracle.Observation memory observation = oracleObservations[index]; + if (lastObservationCurrentTimestamp) { + observation.blockTimestamp = + uint32(block.timestamp) - + (oracleObservations[slot0ObservationIndex].blockTimestamp - observation.blockTimestamp); + } + return ( + observation.blockTimestamp, + observation.tickCumulative, + observation.secondsPerLiquidityCumulativeX128, + observation.initialized + ); + } +} diff --git a/lib/v3-periphery/contracts/test/MockTimeNonfungiblePositionManager.sol b/lib/v3-periphery/contracts/test/MockTimeNonfungiblePositionManager.sol new file mode 100644 index 0000000..4b1c1f9 --- /dev/null +++ b/lib/v3-periphery/contracts/test/MockTimeNonfungiblePositionManager.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../NonfungiblePositionManager.sol'; + +contract MockTimeNonfungiblePositionManager is NonfungiblePositionManager { + uint256 time; + + constructor( + address _factory, + address _WETH9, + address _tokenDescriptor + ) NonfungiblePositionManager(_factory, _WETH9, _tokenDescriptor) {} + + function _blockTimestamp() internal view override returns (uint256) { + return time; + } + + function setTime(uint256 _time) external { + time = _time; + } +} diff --git a/lib/v3-periphery/contracts/test/MockTimeSwapRouter.sol b/lib/v3-periphery/contracts/test/MockTimeSwapRouter.sol new file mode 100644 index 0000000..984707b --- /dev/null +++ b/lib/v3-periphery/contracts/test/MockTimeSwapRouter.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../SwapRouter.sol'; + +contract MockTimeSwapRouter is SwapRouter { + uint256 time; + + constructor(address _factory, address _WETH9) SwapRouter(_factory, _WETH9) {} + + function _blockTimestamp() internal view override returns (uint256) { + return time; + } + + function setTime(uint256 _time) external { + time = _time; + } +} diff --git a/lib/v3-periphery/contracts/test/NFTDescriptorTest.sol b/lib/v3-periphery/contracts/test/NFTDescriptorTest.sol new file mode 100644 index 0000000..89f783b --- /dev/null +++ b/lib/v3-periphery/contracts/test/NFTDescriptorTest.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../libraries/NFTDescriptor.sol'; +import '../libraries/NFTSVG.sol'; +import '../libraries/HexStrings.sol'; + +contract NFTDescriptorTest { + using HexStrings for uint256; + + function constructTokenURI(NFTDescriptor.ConstructTokenURIParams calldata params) + public + pure + returns (string memory) + { + return NFTDescriptor.constructTokenURI(params); + } + + function getGasCostOfConstructTokenURI(NFTDescriptor.ConstructTokenURIParams calldata params) + public + view + returns (uint256) + { + uint256 gasBefore = gasleft(); + NFTDescriptor.constructTokenURI(params); + return gasBefore - gasleft(); + } + + function tickToDecimalString( + int24 tick, + int24 tickSpacing, + uint8 token0Decimals, + uint8 token1Decimals, + bool flipRatio + ) public pure returns (string memory) { + return NFTDescriptor.tickToDecimalString(tick, tickSpacing, token0Decimals, token1Decimals, flipRatio); + } + + function fixedPointToDecimalString( + uint160 sqrtRatioX96, + uint8 token0Decimals, + uint8 token1Decimals + ) public pure returns (string memory) { + return NFTDescriptor.fixedPointToDecimalString(sqrtRatioX96, token0Decimals, token1Decimals); + } + + function feeToPercentString(uint24 fee) public pure returns (string memory) { + return NFTDescriptor.feeToPercentString(fee); + } + + function addressToString(address _address) public pure returns (string memory) { + return NFTDescriptor.addressToString(_address); + } + + function generateSVGImage(NFTDescriptor.ConstructTokenURIParams memory params) public pure returns (string memory) { + return NFTDescriptor.generateSVGImage(params); + } + + function tokenToColorHex(address token, uint256 offset) public pure returns (string memory) { + return NFTDescriptor.tokenToColorHex(uint256(token), offset); + } + + function sliceTokenHex(address token, uint256 offset) public pure returns (uint256) { + return NFTDescriptor.sliceTokenHex(uint256(token), offset); + } + + function rangeLocation(int24 tickLower, int24 tickUpper) public pure returns (string memory, string memory) { + return NFTSVG.rangeLocation(tickLower, tickUpper); + } + + function isRare(uint256 tokenId, address poolAddress) public pure returns (bool) { + return NFTSVG.isRare(tokenId, poolAddress); + } +} diff --git a/lib/v3-periphery/contracts/test/NonfungiblePositionManagerPositionsGasTest.sol b/lib/v3-periphery/contracts/test/NonfungiblePositionManagerPositionsGasTest.sol new file mode 100644 index 0000000..7bec623 --- /dev/null +++ b/lib/v3-periphery/contracts/test/NonfungiblePositionManagerPositionsGasTest.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/INonfungiblePositionManager.sol'; + +contract NonfungiblePositionManagerPositionsGasTest { + INonfungiblePositionManager immutable nonfungiblePositionManager; + + constructor(INonfungiblePositionManager _nonfungiblePositionManager) { + nonfungiblePositionManager = _nonfungiblePositionManager; + } + + function getGasCostOfPositions(uint256 tokenId) external view returns (uint256) { + uint256 gasBefore = gasleft(); + nonfungiblePositionManager.positions(tokenId); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/OracleTest.sol b/lib/v3-periphery/contracts/test/OracleTest.sol new file mode 100644 index 0000000..b0cf921 --- /dev/null +++ b/lib/v3-periphery/contracts/test/OracleTest.sol @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../libraries/OracleLibrary.sol'; + +contract OracleTest { + function consult(address pool, uint32 secondsAgo) + public + view + returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity) + { + return OracleLibrary.consult(pool, secondsAgo); + } + + function getQuoteAtTick( + int24 tick, + uint128 baseAmount, + address baseToken, + address quoteToken + ) public pure returns (uint256 quoteAmount) { + quoteAmount = OracleLibrary.getQuoteAtTick(tick, baseAmount, baseToken, quoteToken); + } + + // For gas snapshot test + function getGasCostOfConsult(address pool, uint32 period) public view returns (uint256) { + uint256 gasBefore = gasleft(); + OracleLibrary.consult(pool, period); + return gasBefore - gasleft(); + } + + function getGasCostOfGetQuoteAtTick( + int24 tick, + uint128 baseAmount, + address baseToken, + address quoteToken + ) public view returns (uint256) { + uint256 gasBefore = gasleft(); + OracleLibrary.getQuoteAtTick(tick, baseAmount, baseToken, quoteToken); + return gasBefore - gasleft(); + } + + function getOldestObservationSecondsAgo(address pool) + public + view + returns (uint32 secondsAgo, uint32 currentTimestamp) + { + secondsAgo = OracleLibrary.getOldestObservationSecondsAgo(pool); + currentTimestamp = uint32(block.timestamp); + } + + function getBlockStartingTickAndLiquidity(address pool) public view returns (int24, uint128) { + return OracleLibrary.getBlockStartingTickAndLiquidity(pool); + } + + function getWeightedArithmeticMeanTick(OracleLibrary.WeightedTickData[] memory observations) + public + pure + returns (int24 arithmeticMeanWeightedTick) + { + return OracleLibrary.getWeightedArithmeticMeanTick(observations); + } + + function getChainedPrice(address[] memory tokens, int24[] memory ticks) public view returns (int256 syntheticTick) { + return OracleLibrary.getChainedPrice(tokens, ticks); + } +} diff --git a/lib/v3-periphery/contracts/test/PathTest.sol b/lib/v3-periphery/contracts/test/PathTest.sol new file mode 100644 index 0000000..1a7280e --- /dev/null +++ b/lib/v3-periphery/contracts/test/PathTest.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/Path.sol'; + +contract PathTest { + function hasMultiplePools(bytes memory path) public pure returns (bool) { + return Path.hasMultiplePools(path); + } + + function decodeFirstPool(bytes memory path) + public + pure + returns ( + address tokenA, + address tokenB, + uint24 fee + ) + { + return Path.decodeFirstPool(path); + } + + function getFirstPool(bytes memory path) public pure returns (bytes memory) { + return Path.getFirstPool(path); + } + + function skipToken(bytes memory path) public pure returns (bytes memory) { + return Path.skipToken(path); + } + + // gas funcs + function getGasCostOfDecodeFirstPool(bytes memory path) public view returns (uint256) { + uint256 gasBefore = gasleft(); + Path.decodeFirstPool(path); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/PeripheryImmutableStateTest.sol b/lib/v3-periphery/contracts/test/PeripheryImmutableStateTest.sol new file mode 100644 index 0000000..6298162 --- /dev/null +++ b/lib/v3-periphery/contracts/test/PeripheryImmutableStateTest.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity =0.7.6; + +import '../base/PeripheryImmutableState.sol'; + +contract PeripheryImmutableStateTest is PeripheryImmutableState { + constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {} +} diff --git a/lib/v3-periphery/contracts/test/PoolAddressTest.sol b/lib/v3-periphery/contracts/test/PoolAddressTest.sol new file mode 100644 index 0000000..c1571e4 --- /dev/null +++ b/lib/v3-periphery/contracts/test/PoolAddressTest.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/PoolAddress.sol'; + +contract PoolAddressTest { + function POOL_INIT_CODE_HASH() external pure returns (bytes32) { + return PoolAddress.POOL_INIT_CODE_HASH; + } + + function computeAddress( + address factory, + address token0, + address token1, + uint24 fee + ) external pure returns (address) { + return PoolAddress.computeAddress(factory, PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee})); + } + + function getGasCostOfComputeAddress( + address factory, + address token0, + address token1, + uint24 fee + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + PoolAddress.computeAddress(factory, PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee})); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/PoolTicksCounterTest.sol b/lib/v3-periphery/contracts/test/PoolTicksCounterTest.sol new file mode 100644 index 0000000..3d47bf7 --- /dev/null +++ b/lib/v3-periphery/contracts/test/PoolTicksCounterTest.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; + +pragma solidity >=0.6.0; + +import '../libraries/PoolTicksCounter.sol'; + +contract PoolTicksCounterTest { + using PoolTicksCounter for IUniswapV3Pool; + + function countInitializedTicksCrossed( + IUniswapV3Pool pool, + int24 tickBefore, + int24 tickAfter + ) external view returns (uint32 initializedTicksCrossed) { + return pool.countInitializedTicksCrossed(tickBefore, tickAfter); + } +} diff --git a/lib/v3-periphery/contracts/test/PositionValueTest.sol b/lib/v3-periphery/contracts/test/PositionValueTest.sol new file mode 100644 index 0000000..7752f7a --- /dev/null +++ b/lib/v3-periphery/contracts/test/PositionValueTest.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/PositionValue.sol'; +import '../interfaces/INonfungiblePositionManager.sol'; + +contract PositionValueTest { + function total( + INonfungiblePositionManager nft, + uint256 tokenId, + uint160 sqrtRatioX96 + ) external view returns (uint256 amount0, uint256 amount1) { + return PositionValue.total(nft, tokenId, sqrtRatioX96); + } + + function principal( + INonfungiblePositionManager nft, + uint256 tokenId, + uint160 sqrtRatioX96 + ) external view returns (uint256 amount0, uint256 amount1) { + return PositionValue.principal(nft, tokenId, sqrtRatioX96); + } + + function fees(INonfungiblePositionManager nft, uint256 tokenId) + external + view + returns (uint256 amount0, uint256 amount1) + { + return PositionValue.fees(nft, tokenId); + } + + function totalGas( + INonfungiblePositionManager nft, + uint256 tokenId, + uint160 sqrtRatioX96 + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + PositionValue.total(nft, tokenId, sqrtRatioX96); + return gasBefore - gasleft(); + } + + function principalGas( + INonfungiblePositionManager nft, + uint256 tokenId, + uint160 sqrtRatioX96 + ) external view returns (uint256) { + uint256 gasBefore = gasleft(); + PositionValue.principal(nft, tokenId, sqrtRatioX96); + return gasBefore - gasleft(); + } + + function feesGas(INonfungiblePositionManager nft, uint256 tokenId) external view returns (uint256) { + uint256 gasBefore = gasleft(); + PositionValue.fees(nft, tokenId); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/contracts/test/SelfPermitTest.sol b/lib/v3-periphery/contracts/test/SelfPermitTest.sol new file mode 100644 index 0000000..1a3c022 --- /dev/null +++ b/lib/v3-periphery/contracts/test/SelfPermitTest.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../base/SelfPermit.sol'; + +/// @dev Same as SelfPermit but not abstract +contract SelfPermitTest is SelfPermit { + +} diff --git a/lib/v3-periphery/contracts/test/TestCallbackValidation.sol b/lib/v3-periphery/contracts/test/TestCallbackValidation.sol new file mode 100644 index 0000000..e0c2eeb --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestCallbackValidation.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../libraries/CallbackValidation.sol'; + +contract TestCallbackValidation { + function verifyCallback( + address factory, + address tokenA, + address tokenB, + uint24 fee + ) external view returns (IUniswapV3Pool pool) { + return CallbackValidation.verifyCallback(factory, tokenA, tokenB, fee); + } +} diff --git a/lib/v3-periphery/contracts/test/TestERC20.sol b/lib/v3-periphery/contracts/test/TestERC20.sol new file mode 100644 index 0000000..66ed4ac --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestERC20.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '@openzeppelin/contracts/drafts/ERC20Permit.sol'; + +contract TestERC20 is ERC20Permit { + constructor(uint256 amountToMint) ERC20('Test ERC20', 'TEST') ERC20Permit('Test ERC20') { + _mint(msg.sender, amountToMint); + } +} diff --git a/lib/v3-periphery/contracts/test/TestERC20Metadata.sol b/lib/v3-periphery/contracts/test/TestERC20Metadata.sol new file mode 100644 index 0000000..af94bf6 --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestERC20Metadata.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '@openzeppelin/contracts/drafts/ERC20Permit.sol'; + +contract TestERC20Metadata is ERC20Permit { + constructor( + uint256 amountToMint, + string memory name, + string memory symbol + ) ERC20(name, symbol) ERC20Permit(name) { + _mint(msg.sender, amountToMint); + } +} diff --git a/lib/v3-periphery/contracts/test/TestERC20PermitAllowed.sol b/lib/v3-periphery/contracts/test/TestERC20PermitAllowed.sol new file mode 100644 index 0000000..1bdf8ab --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestERC20PermitAllowed.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import './TestERC20.sol'; +import '../interfaces/external/IERC20PermitAllowed.sol'; + +// has a fake permit that just uses the other signature type for type(uint256).max +contract TestERC20PermitAllowed is TestERC20, IERC20PermitAllowed { + constructor(uint256 amountToMint) TestERC20(amountToMint) {} + + function permit( + address holder, + address spender, + uint256 nonce, + uint256 expiry, + bool allowed, + uint8 v, + bytes32 r, + bytes32 s + ) external override { + require(this.nonces(holder) == nonce, 'TestERC20PermitAllowed::permit: wrong nonce'); + permit(holder, spender, allowed ? type(uint256).max : 0, expiry, v, r, s); + } +} diff --git a/lib/v3-periphery/contracts/test/TestMulticall.sol b/lib/v3-periphery/contracts/test/TestMulticall.sol new file mode 100644 index 0000000..5d351d3 --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestMulticall.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; +pragma abicoder v2; + +import '../base/Multicall.sol'; + +contract TestMulticall is Multicall { + function functionThatRevertsWithError(string memory error) external pure { + revert(error); + } + + struct Tuple { + uint256 a; + uint256 b; + } + + function functionThatReturnsTuple(uint256 a, uint256 b) external pure returns (Tuple memory tuple) { + tuple = Tuple({b: a, a: b}); + } + + uint256 public paid; + + function pays() external payable { + paid += msg.value; + } + + function returnSender() external view returns (address) { + return msg.sender; + } +} diff --git a/lib/v3-periphery/contracts/test/TestPositionNFTOwner.sol b/lib/v3-periphery/contracts/test/TestPositionNFTOwner.sol new file mode 100644 index 0000000..58f1818 --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestPositionNFTOwner.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '../interfaces/external/IERC1271.sol'; + +contract TestPositionNFTOwner is IERC1271 { + address public owner; + + function setOwner(address _owner) external { + owner = _owner; + } + + function isValidSignature(bytes32 hash, bytes memory signature) external view override returns (bytes4 magicValue) { + bytes32 r; + bytes32 s; + uint8 v; + assembly { + r := mload(add(signature, 0x20)) + s := mload(add(signature, 0x40)) + v := byte(0, mload(add(signature, 0x60))) + } + if (ecrecover(hash, v, r, s) == owner) { + return bytes4(0x1626ba7e); + } else { + return bytes4(0); + } + } +} diff --git a/lib/v3-periphery/contracts/test/TestUniswapV3Callee.sol b/lib/v3-periphery/contracts/test/TestUniswapV3Callee.sol new file mode 100644 index 0000000..1400bd6 --- /dev/null +++ b/lib/v3-periphery/contracts/test/TestUniswapV3Callee.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity =0.7.6; + +import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; +import '@uniswap/v3-core/contracts/libraries/SafeCast.sol'; +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; + +contract TestUniswapV3Callee is IUniswapV3SwapCallback { + using SafeCast for uint256; + + function swapExact0For1( + address pool, + uint256 amount0In, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, true, amount0In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swap0ForExact1( + address pool, + uint256 amount1Out, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, true, -amount1Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swapExact1For0( + address pool, + uint256 amount1In, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, false, amount1In.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function swap1ForExact0( + address pool, + uint256 amount0Out, + address recipient, + uint160 sqrtPriceLimitX96 + ) external { + IUniswapV3Pool(pool).swap(recipient, false, -amount0Out.toInt256(), sqrtPriceLimitX96, abi.encode(msg.sender)); + } + + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external override { + address sender = abi.decode(data, (address)); + + if (amount0Delta > 0) { + IERC20(IUniswapV3Pool(msg.sender).token0()).transferFrom(sender, msg.sender, uint256(amount0Delta)); + } else { + assert(amount1Delta > 0); + IERC20(IUniswapV3Pool(msg.sender).token1()).transferFrom(sender, msg.sender, uint256(amount1Delta)); + } + } +} diff --git a/lib/v3-periphery/contracts/test/TickLensTest.sol b/lib/v3-periphery/contracts/test/TickLensTest.sol new file mode 100644 index 0000000..55cb7fd --- /dev/null +++ b/lib/v3-periphery/contracts/test/TickLensTest.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; +pragma abicoder v2; + +import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; +import '../lens/TickLens.sol'; + +/// @title Tick Lens contract +contract TickLensTest is TickLens { + function getGasCostOfGetPopulatedTicksInWord(address pool, int16 tickBitmapIndex) external view returns (uint256) { + uint256 gasBefore = gasleft(); + getPopulatedTicksInWord(pool, tickBitmapIndex); + return gasBefore - gasleft(); + } +} diff --git a/lib/v3-periphery/deploys.md b/lib/v3-periphery/deploys.md new file mode 100644 index 0000000..c0af53c --- /dev/null +++ b/lib/v3-periphery/deploys.md @@ -0,0 +1,25 @@ +# Deployment addresses + +The latest version of `@uniswap/v3-core`, `@uniswap/v3-periphery`, `@uniswap/swap-router-contracts`, and `@uniswap/v3-staker` are deployed at the addresses listed below. Integrators should **no longer assume that they are deployed to the same addresses across chains** and be extremely careful to confirm mappings below. + +| Contract | Mainnet, Polygon, Optimism, Arbitrum, Testnets Address | Celo Address | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | -------------------------------------------- | +| [UniswapV3Factory](https://github.com/Uniswap/uniswap-v3-core/blob/v1.0.0/contracts/UniswapV3Factory.sol) | `0x1F98431c8aD98523631AE4a59f267346ea31F984` | `0xAfE208a311B21f13EF87E33A90049fC17A7acDEc` | +| [Multicall2](https://etherscan.io/address/0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696#code) | `0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696` | `0x633987602DE5C4F337e3DbF265303A1080324204` | +| [ProxyAdmin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.1-solc-0.7-2/contracts/proxy/ProxyAdmin.sol) | `0xB753548F6E010e7e680BA186F9Ca1BdAB2E90cf2` | `0xc1b262Dd7643D4B7cA9e51631bBd900a564BF49A` | +| [TickLens](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/lens/TickLens.sol) | `0xbfd8137f7d1516D3ea5cA83523914859ec47F573` | `0x5f115D9113F88e0a0Db1b5033D90D4a9690AcD3D` | +| [Quoter](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/lens/Quoter.sol) | `0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6` | `0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8` | +| [SwapRouter](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/SwapRouter.sol) | `0xE592427A0AEce92De3Edee1F18E0157C05861564` | `0x5615CDAb10dc425a742d643d949a7F474C01abc4` | +| [NFTDescriptor](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/libraries/NFTDescriptor.sol) | `0x42B24A95702b9986e82d421cC3568932790A48Ec` | `0xa9Fd765d85938D278cb0b108DbE4BF7186831186` | +| [NonfungibleTokenPositionDescriptor](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/NonfungibleTokenPositionDescriptor.sol) | `0x91ae842A5Ffd8d12023116943e72A606179294f3` | `0x644023b316bB65175C347DE903B60a756F6dd554` | +| [TransparentUpgradeableProxy](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.1-solc-0.7-2/contracts/proxy/TransparentUpgradeableProxy.sol) | `0xEe6A57eC80ea46401049E92587E52f5Ec1c24785` | `0x505B43c452AA4443e0a6B84bb37771494633Fde9` | +| [NonfungiblePositionManager](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/NonfungiblePositionManager.sol) | `0xC36442b4a4522E871399CD717aBDD847Ab11FE88` | `0x3d79EdAaBC0EaB6F08ED885C05Fc0B014290D95A` | +| [V3Migrator](https://github.com/Uniswap/uniswap-v3-periphery/blob/v1.0.0/contracts/V3Migrator.sol) | `0xA5644E29708357803b5A882D272c41cC0dF92B34` | `0x3cFd4d48EDfDCC53D3f173F596f621064614C582` | + +These addresses are final and were deployed from these npm package versions: + +- `@uniswap/v3-core`: [`1.0.0`](https://github.com/Uniswap/uniswap-v3-core/tree/v1.0.0) +- `@uniswap/v3-periphery`: [`1.0.0`](https://github.com/Uniswap/uniswap-v3-periphery/tree/v1.0.0) + +The source code is verified with Etherscan on all networks, for all contracts except `UniswapV3Pool`. +We are working on getting the `UniswapV3Pool` contract verified with Etherscan. diff --git a/lib/v3-periphery/hardhat.config.ts b/lib/v3-periphery/hardhat.config.ts new file mode 100644 index 0000000..57343da --- /dev/null +++ b/lib/v3-periphery/hardhat.config.ts @@ -0,0 +1,104 @@ +import '@nomiclabs/hardhat-ethers' +import '@nomiclabs/hardhat-etherscan' +import '@nomiclabs/hardhat-waffle' +import 'hardhat-typechain' +import 'hardhat-watcher' + +const LOW_OPTIMIZER_COMPILER_SETTINGS = { + version: '0.7.6', + settings: { + evmVersion: 'istanbul', + optimizer: { + enabled: true, + runs: 2_000, + }, + metadata: { + bytecodeHash: 'none', + }, + }, +} + +const LOWEST_OPTIMIZER_COMPILER_SETTINGS = { + version: '0.7.6', + settings: { + evmVersion: 'istanbul', + optimizer: { + enabled: true, + runs: 1_000, + }, + metadata: { + bytecodeHash: 'none', + }, + }, +} + +const DEFAULT_COMPILER_SETTINGS = { + version: '0.7.6', + settings: { + evmVersion: 'istanbul', + optimizer: { + enabled: true, + runs: 1_000_000, + }, + metadata: { + bytecodeHash: 'none', + }, + }, +} + +export default { + networks: { + hardhat: { + allowUnlimitedContractSize: false, + }, + mainnet: { + url: `https://mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + ropsten: { + url: `https://ropsten.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + rinkeby: { + url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + goerli: { + url: `https://goerli.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + kovan: { + url: `https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + arbitrumRinkeby: { + url: `https://arbitrum-rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + arbitrum: { + url: `https://arbitrum-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + optimismKovan: { + url: `https://optimism-kovan.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + optimism: { + url: `https://optimism-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, + }, + }, + etherscan: { + // Your API key for Etherscan + // Obtain one at https://etherscan.io/ + apiKey: process.env.ETHERSCAN_API_KEY, + }, + solidity: { + compilers: [DEFAULT_COMPILER_SETTINGS], + overrides: { + 'contracts/NonfungiblePositionManager.sol': LOW_OPTIMIZER_COMPILER_SETTINGS, + 'contracts/test/MockTimeNonfungiblePositionManager.sol': LOW_OPTIMIZER_COMPILER_SETTINGS, + 'contracts/test/NFTDescriptorTest.sol': LOWEST_OPTIMIZER_COMPILER_SETTINGS, + 'contracts/NonfungibleTokenPositionDescriptor.sol': LOWEST_OPTIMIZER_COMPILER_SETTINGS, + 'contracts/libraries/NFTDescriptor.sol': LOWEST_OPTIMIZER_COMPILER_SETTINGS, + }, + }, + watcher: { + test: { + tasks: [{ command: 'test', params: { testFiles: ['{path}'] } }], + files: ['./test/**/*'], + verbose: true, + }, + }, +} diff --git a/lib/v3-periphery/package.json b/lib/v3-periphery/package.json new file mode 100644 index 0000000..33ed0f9 --- /dev/null +++ b/lib/v3-periphery/package.json @@ -0,0 +1,68 @@ +{ + "name": "@uniswap/v3-periphery", + "description": "🎚 Peripheral smart contracts for interacting with Uniswap V3", + "license": "GPL-2.0-or-later", + "publishConfig": { + "access": "public" + }, + "version": "1.4.4", + "homepage": "https://uniswap.org", + "keywords": [ + "uniswap", + "periphery", + "v3" + ], + "repository": { + "type": "git", + "url": "https://github.com/Uniswap/uniswap-v3-periphery" + }, + "files": [ + "contracts/base", + "contracts/interfaces", + "contracts/libraries", + "artifacts/contracts/**/*.json", + "!artifacts/contracts/**/*.dbg.json", + "!artifacts/contracts/test/**/*", + "!artifacts/contracts/base/**/*" + ], + "engines": { + "node": ">=10" + }, + "dependencies": { + "@openzeppelin/contracts": "3.4.2-solc-0.7", + "@uniswap/lib": "^4.0.1-alpha", + "@uniswap/v2-core": "^1.0.1", + "@uniswap/v3-core": "^1.0.0", + "base64-sol": "1.0.1" + }, + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.2", + "@nomiclabs/hardhat-etherscan": "^2.1.8", + "@nomiclabs/hardhat-waffle": "^2.0.1", + "@typechain/ethers-v5": "^4.0.0", + "@types/chai": "^4.2.6", + "@types/mocha": "^5.2.7", + "chai": "^4.2.0", + "decimal.js": "^10.2.1", + "ethereum-waffle": "^3.0.2", + "ethers": "^5.0.8", + "hardhat": "^2.6.8", + "hardhat-typechain": "^0.3.5", + "hardhat-watcher": "^2.1.1", + "is-svg": "^4.3.1", + "mocha": "^6.2.2", + "mocha-chai-jest-snapshot": "^1.1.0", + "prettier": "^2.0.5", + "prettier-plugin-solidity": "^1.0.0-beta.10", + "solhint": "^3.2.1", + "solhint-plugin-prettier": "^0.0.5", + "ts-generator": "^0.1.1", + "ts-node": "^8.5.4", + "typechain": "^4.0.0", + "typescript": "^3.7.3" + }, + "scripts": { + "compile": "hardhat compile", + "test": "hardhat test" + } +} diff --git a/lib/v3-periphery/test/Base64.spec.ts b/lib/v3-periphery/test/Base64.spec.ts new file mode 100644 index 0000000..5baef4b --- /dev/null +++ b/lib/v3-periphery/test/Base64.spec.ts @@ -0,0 +1,81 @@ +import { ethers } from 'hardhat' +import { base64Encode } from './shared/base64' +import { expect } from './shared/expect' +import { Base64Test } from '../typechain' +import { randomBytes } from 'crypto' +import snapshotGasCost from './shared/snapshotGasCost' + +function stringToHex(str: string): string { + return `0x${Buffer.from(str, 'utf8').toString('hex')}` +} + +describe('Base64', () => { + let base64: Base64Test + before('deploy test contract', async () => { + base64 = (await (await ethers.getContractFactory('Base64Test')).deploy()) as Base64Test + }) + + describe('#encode', () => { + it('is correct for empty bytes', async () => { + expect(await base64.encode(stringToHex(''))).to.eq('') + }) + + for (const example of [ + 'test string', + 'this is a test', + 'alphabet soup', + 'aLpHaBeT', + 'includes\nnewlines', + '', + '😀', + 'f', + 'fo', + 'foo', + 'foob', + 'fooba', + 'foobar', + 'this is a very long string that should cost a lot of gas to encode :)', + ]) { + it(`works for "${example}"`, async () => { + expect(await base64.encode(stringToHex(example))).to.eq(base64Encode(example)) + }) + + it(`gas cost of encode(${example})`, async () => { + await snapshotGasCost(base64.getGasCostOfEncode(stringToHex(example))) + }) + } + + describe('max size string (24kB)', () => { + let str: string + before(() => { + str = Array(24 * 1024) + .fill(null) + .map((_, i) => String.fromCharCode(i % 1024)) + .join('') + }) + it('correctness', async () => { + expect(await base64.encode(stringToHex(str))).to.eq(base64Encode(str)) + }) + it('gas cost', async () => { + await snapshotGasCost(base64.getGasCostOfEncode(stringToHex(str))) + }) + }) + + it('tiny fuzzing', async () => { + const inputs = [] + for (let i = 0; i < 100; i++) { + inputs.push(randomBytes(Math.random() * 100)) + } + + const promises = inputs.map((input) => { + return base64.encode(`0x${input.toString('hex')}`) + }) + + const results = await Promise.all(promises) + + for (let i = 0; i < inputs.length; i++) { + expect(inputs[i].toString('base64')).to.eq(results[i]) + } + }).timeout(300_000) + }) +}) diff --git a/lib/v3-periphery/test/CallbackValidation.spec.ts b/lib/v3-periphery/test/CallbackValidation.spec.ts new file mode 100644 index 0000000..98eea96 --- /dev/null +++ b/lib/v3-periphery/test/CallbackValidation.spec.ts @@ -0,0 +1,56 @@ +import { Contract, constants, Wallet } from 'ethers' +import { waffle, ethers } from 'hardhat' +import { Fixture } from 'ethereum-waffle' +import completeFixture from './shared/completeFixture' +import { expect } from './shared/expect' +import { TestERC20, TestCallbackValidation } from '../typechain' +import { FeeAmount } from './shared/constants' + +describe('CallbackValidation', () => { + let nonpairAddr: Wallet, wallets: Wallet[] + + const callbackValidationFixture: Fixture<{ + callbackValidation: TestCallbackValidation + tokens: [TestERC20, TestERC20] + factory: Contract + }> = async (wallets, provider) => { + const { factory } = await completeFixture(wallets, provider) + const tokenFactory = await ethers.getContractFactory('TestERC20') + const callbackValidationFactory = await ethers.getContractFactory('TestCallbackValidation') + const tokens: [TestERC20, TestERC20] = [ + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, // do not use maxu256 to avoid overflowing + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + ] + const callbackValidation = (await callbackValidationFactory.deploy()) as TestCallbackValidation + + return { + tokens, + callbackValidation, + factory, + } + } + + let callbackValidation: TestCallbackValidation + let tokens: [TestERC20, TestERC20] + let factory: Contract + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + ;[nonpairAddr, ...wallets] = await (ethers as any).getSigners() + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ callbackValidation, tokens, factory } = await loadFixture(callbackValidationFixture)) + }) + + it('reverts when called from an address other than the associated UniswapV3Pool', async () => { + expect( + callbackValidation + .connect(nonpairAddr) + .verifyCallback(factory.address, tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + ).to.be.reverted + }) +}) diff --git a/lib/v3-periphery/test/LiquidityAmounts.spec.ts b/lib/v3-periphery/test/LiquidityAmounts.spec.ts new file mode 100644 index 0000000..b24dd3c --- /dev/null +++ b/lib/v3-periphery/test/LiquidityAmounts.spec.ts @@ -0,0 +1,241 @@ +import { ethers } from 'hardhat' +import { LiquidityAmountsTest } from '../typechain/LiquidityAmountsTest' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expect } from './shared/expect' + +import snapshotGasCost from './shared/snapshotGasCost' + +describe('LiquidityAmounts', async () => { + let liquidityFromAmounts: LiquidityAmountsTest + + before('deploy test library', async () => { + const liquidityFromAmountsTestFactory = await ethers.getContractFactory('LiquidityAmountsTest') + liquidityFromAmounts = (await liquidityFromAmountsTestFactory.deploy()) as LiquidityAmountsTest + }) + + describe('#getLiquidityForAmount0', () => { + it('gas', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost(liquidityFromAmounts.getGasCostOfGetLiquidityForAmount0(sqrtPriceAX96, sqrtPriceBX96, 100)) + }) + }) + + describe('#getLiquidityForAmount1', () => { + it('gas', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost(liquidityFromAmounts.getGasCostOfGetLiquidityForAmount1(sqrtPriceAX96, sqrtPriceBX96, 100)) + }) + }) + + describe('#getLiquidityForAmounts', () => { + it('amounts for price inside', async () => { + const sqrtPriceX96 = encodePriceSqrt(1, 1) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const liquidity = await liquidityFromAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 100, + 200 + ) + expect(liquidity).to.eq(2148) + }) + + it('amounts for price below', async () => { + const sqrtPriceX96 = encodePriceSqrt(99, 110) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const liquidity = await liquidityFromAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 100, + 200 + ) + expect(liquidity).to.eq(1048) + }) + + it('amounts for price above', async () => { + const sqrtPriceX96 = encodePriceSqrt(111, 100) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const liquidity = await liquidityFromAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 100, + 200 + ) + expect(liquidity).to.eq(2097) + }) + + it('amounts for price equal to lower boundary', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceX96 = sqrtPriceAX96 + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const liquidity = await liquidityFromAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 100, + 200 + ) + expect(liquidity).to.eq(1048) + }) + + it('amounts for price equal to upper boundary', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const sqrtPriceX96 = sqrtPriceBX96 + const liquidity = await liquidityFromAmounts.getLiquidityForAmounts( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 100, + 200 + ) + expect(liquidity).to.eq(2097) + }) + + it('gas for price below', async () => { + const sqrtPriceX96 = encodePriceSqrt(99, 110) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetLiquidityForAmounts(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 100, 200) + ) + }) + it('gas for price above', async () => { + const sqrtPriceX96 = encodePriceSqrt(111, 100) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetLiquidityForAmounts(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 100, 200) + ) + }) + it('gas for price inside', async () => { + const sqrtPriceX96 = encodePriceSqrt(1, 1) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetLiquidityForAmounts(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 100, 200) + ) + }) + }) + + describe('#getAmount0ForLiquidity', () => { + it('gas', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost(liquidityFromAmounts.getGasCostOfGetAmount0ForLiquidity(sqrtPriceAX96, sqrtPriceBX96, 100)) + }) + }) + + describe('#getLiquidityForAmount1', () => { + it('gas', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost(liquidityFromAmounts.getGasCostOfGetAmount1ForLiquidity(sqrtPriceAX96, sqrtPriceBX96, 100)) + }) + }) + + describe('#getAmountsForLiquidity', () => { + it('amounts for price inside', async () => { + const sqrtPriceX96 = encodePriceSqrt(1, 1) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const { amount0, amount1 } = await liquidityFromAmounts.getAmountsForLiquidity( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 2148 + ) + expect(amount0).to.eq(99) + expect(amount1).to.eq(99) + }) + + it('amounts for price below', async () => { + const sqrtPriceX96 = encodePriceSqrt(99, 110) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const { amount0, amount1 } = await liquidityFromAmounts.getAmountsForLiquidity( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 1048 + ) + expect(amount0).to.eq(99) + expect(amount1).to.eq(0) + }) + + it('amounts for price above', async () => { + const sqrtPriceX96 = encodePriceSqrt(111, 100) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const { amount0, amount1 } = await liquidityFromAmounts.getAmountsForLiquidity( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 2097 + ) + expect(amount0).to.eq(0) + expect(amount1).to.eq(199) + }) + + it('amounts for price on lower boundary', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceX96 = sqrtPriceAX96 + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const { amount0, amount1 } = await liquidityFromAmounts.getAmountsForLiquidity( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 1048 + ) + expect(amount0).to.eq(99) + expect(amount1).to.eq(0) + }) + + it('amounts for price on upper boundary', async () => { + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + const sqrtPriceX96 = sqrtPriceBX96 + const { amount0, amount1 } = await liquidityFromAmounts.getAmountsForLiquidity( + sqrtPriceX96, + sqrtPriceAX96, + sqrtPriceBX96, + 2097 + ) + expect(amount0).to.eq(0) + expect(amount1).to.eq(199) + }) + + it('gas for price below', async () => { + const sqrtPriceX96 = encodePriceSqrt(99, 110) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetAmountsForLiquidity(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 2148) + ) + }) + it('gas for price above', async () => { + const sqrtPriceX96 = encodePriceSqrt(111, 100) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetAmountsForLiquidity(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 1048) + ) + }) + it('gas for price inside', async () => { + const sqrtPriceX96 = encodePriceSqrt(1, 1) + const sqrtPriceAX96 = encodePriceSqrt(100, 110) + const sqrtPriceBX96 = encodePriceSqrt(110, 100) + await snapshotGasCost( + liquidityFromAmounts.getGasCostOfGetAmountsForLiquidity(sqrtPriceX96, sqrtPriceAX96, sqrtPriceBX96, 2097) + ) + }) + }) +}) diff --git a/lib/v3-periphery/test/Multicall.spec.ts b/lib/v3-periphery/test/Multicall.spec.ts new file mode 100644 index 0000000..44ca334 --- /dev/null +++ b/lib/v3-periphery/test/Multicall.spec.ts @@ -0,0 +1,65 @@ +import { Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { TestMulticall } from '../typechain/TestMulticall' +import { expect } from './shared/expect' + +import snapshotGasCost from './shared/snapshotGasCost' + +describe('Multicall', async () => { + let wallets: Wallet[] + + let multicall: TestMulticall + + before('get wallets', async () => { + wallets = await (ethers as any).getSigners() + }) + + beforeEach('create multicall', async () => { + const multicallTestFactory = await ethers.getContractFactory('TestMulticall') + multicall = (await multicallTestFactory.deploy()) as TestMulticall + }) + + it('revert messages are returned', async () => { + await expect( + multicall.multicall([multicall.interface.encodeFunctionData('functionThatRevertsWithError', ['abcdef'])]) + ).to.be.revertedWith('abcdef') + }) + + it('return data is properly encoded', async () => { + const [data] = await multicall.callStatic.multicall([ + multicall.interface.encodeFunctionData('functionThatReturnsTuple', ['1', '2']), + ]) + const { + tuple: { a, b }, + } = multicall.interface.decodeFunctionResult('functionThatReturnsTuple', data) + expect(b).to.eq(1) + expect(a).to.eq(2) + }) + + describe('context is preserved', () => { + it('msg.value', async () => { + await multicall.multicall([multicall.interface.encodeFunctionData('pays')], { value: 3 }) + expect(await multicall.paid()).to.eq(3) + }) + + it('msg.value used twice', async () => { + await multicall.multicall( + [multicall.interface.encodeFunctionData('pays'), multicall.interface.encodeFunctionData('pays')], + { value: 3 } + ) + expect(await multicall.paid()).to.eq(6) + }) + + it('msg.sender', async () => { + expect(await multicall.returnSender()).to.eq(wallets[0].address) + }) + }) + + it('gas cost of pay w/o multicall', async () => { + await snapshotGasCost(multicall.pays({ value: 3 })) + }) + + it('gas cost of pay w/ multicall', async () => { + await snapshotGasCost(multicall.multicall([multicall.interface.encodeFunctionData('pays')], { value: 3 })) + }) +}) diff --git a/lib/v3-periphery/test/NFTDescriptor.spec.ts b/lib/v3-periphery/test/NFTDescriptor.spec.ts new file mode 100644 index 0000000..fce07b1 --- /dev/null +++ b/lib/v3-periphery/test/NFTDescriptor.spec.ts @@ -0,0 +1,907 @@ +import { BigNumber, constants, Wallet } from 'ethers' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { waffle, ethers } from 'hardhat' +import { expect } from './shared/expect' +import { TestERC20Metadata, NFTDescriptorTest } from '../typechain' +import { Fixture } from 'ethereum-waffle' +import { FeeAmount, TICK_SPACINGS } from './shared/constants' +import snapshotGasCost from './shared/snapshotGasCost' +import { formatSqrtRatioX96 } from './shared/formatSqrtRatioX96' +import { getMaxTick, getMinTick } from './shared/ticks' +import { randomBytes } from 'crypto' +import { extractJSONFromURI } from './shared/extractJSONFromURI' +import fs from 'fs' +import isSvg from 'is-svg' + +const TEN = BigNumber.from(10) +const LOWEST_SQRT_RATIO = 4310618292 +const HIGHEST_SQRT_RATIO = BigNumber.from(33849).mul(TEN.pow(34)) + +describe('NFTDescriptor', () => { + let wallets: Wallet[] + + const nftDescriptorFixture: Fixture<{ + tokens: [TestERC20Metadata, TestERC20Metadata, TestERC20Metadata, TestERC20Metadata] + nftDescriptor: NFTDescriptorTest + }> = async (wallets, provider) => { + const nftDescriptorLibraryFactory = await ethers.getContractFactory('NFTDescriptor') + const nftDescriptorLibrary = await nftDescriptorLibraryFactory.deploy() + + const tokenFactory = await ethers.getContractFactory('TestERC20Metadata') + const NFTDescriptorFactory = await ethers.getContractFactory('NFTDescriptorTest', { + libraries: { + NFTDescriptor: nftDescriptorLibrary.address, + }, + }) + const nftDescriptor = (await NFTDescriptorFactory.deploy()) as NFTDescriptorTest + const TestERC20Metadata = tokenFactory.deploy(constants.MaxUint256.div(2), 'Test ERC20', 'TEST1') + const tokens: [TestERC20Metadata, TestERC20Metadata, TestERC20Metadata, TestERC20Metadata] = [ + (await tokenFactory.deploy(constants.MaxUint256.div(2), 'Test ERC20', 'TEST1')) as TestERC20Metadata, // do not use maxu256 to avoid overflowing + (await tokenFactory.deploy(constants.MaxUint256.div(2), 'Test ERC20', 'TEST2')) as TestERC20Metadata, + (await tokenFactory.deploy(constants.MaxUint256.div(2), 'Test ERC20', 'TEST3')) as TestERC20Metadata, + (await tokenFactory.deploy(constants.MaxUint256.div(2), 'Test ERC20', 'TEST4')) as TestERC20Metadata, + ] + tokens.sort((a, b) => (a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1)) + return { + nftDescriptor, + tokens, + } + } + + let nftDescriptor: NFTDescriptorTest + let tokens: [TestERC20Metadata, TestERC20Metadata, TestERC20Metadata, TestERC20Metadata] + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + wallets = await (ethers as any).getSigners() + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ nftDescriptor, tokens } = await loadFixture(nftDescriptorFixture)) + }) + + describe('#constructTokenURI', () => { + let tokenId: number + let baseTokenAddress: string + let quoteTokenAddress: string + let baseTokenSymbol: string + let quoteTokenSymbol: string + let baseTokenDecimals: number + let quoteTokenDecimals: number + let flipRatio: boolean + let tickLower: number + let tickUpper: number + let tickCurrent: number + let tickSpacing: number + let fee: number + let poolAddress: string + + beforeEach(async () => { + tokenId = 123 + baseTokenAddress = tokens[0].address + quoteTokenAddress = tokens[1].address + baseTokenSymbol = await tokens[0].symbol() + quoteTokenSymbol = await tokens[1].symbol() + baseTokenDecimals = await tokens[0].decimals() + quoteTokenDecimals = await tokens[1].decimals() + flipRatio = false + tickLower = getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]) + tickUpper = getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]) + tickCurrent = 0 + tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] + fee = 3000 + poolAddress = `0x${'b'.repeat(40)}` + }) + + it('returns the valid JSON string with min and max ticks', async () => { + const json = extractJSONFromURI( + await nftDescriptor.constructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + + const tokenUri = constructTokenMetadata( + tokenId, + quoteTokenAddress, + baseTokenAddress, + poolAddress, + quoteTokenSymbol, + baseTokenSymbol, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + '0.3%', + 'MIN<>MAX' + ) + + expect(json.description).to.equal(tokenUri.description) + expect(json.name).to.equal(tokenUri.name) + }) + + it('returns the valid JSON string with mid ticks', async () => { + tickLower = -10 + tickUpper = 10 + tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] + fee = 3000 + + const json = extractJSONFromURI( + await nftDescriptor.constructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + + const tokenMetadata = constructTokenMetadata( + tokenId, + quoteTokenAddress, + baseTokenAddress, + poolAddress, + quoteTokenSymbol, + baseTokenSymbol, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + '0.3%', + '0.99900<>1.0010' + ) + + expect(json.description).to.equal(tokenMetadata.description) + expect(json.name).to.equal(tokenMetadata.name) + }) + + it('returns valid JSON when token symbols contain quotes', async () => { + quoteTokenSymbol = '"TES"T1"' + const json = extractJSONFromURI( + await nftDescriptor.constructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + + const tokenMetadata = constructTokenMetadata( + tokenId, + quoteTokenAddress, + baseTokenAddress, + poolAddress, + quoteTokenSymbol, + baseTokenSymbol, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + '0.3%', + 'MIN<>MAX' + ) + + expect(json.description).to.equal(tokenMetadata.description) + expect(json.name).to.equal(tokenMetadata.name) + }) + + describe('when the token ratio is flipped', () => { + it('returns the valid JSON for mid ticks', async () => { + flipRatio = true + tickLower = -10 + tickUpper = 10 + + const json = extractJSONFromURI( + await nftDescriptor.constructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + + const tokenMetadata = constructTokenMetadata( + tokenId, + quoteTokenAddress, + baseTokenAddress, + poolAddress, + quoteTokenSymbol, + baseTokenSymbol, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + '0.3%', + '0.99900<>1.0010' + ) + + expect(json.description).to.equal(tokenMetadata.description) + expect(json.name).to.equal(tokenMetadata.name) + }) + + it('returns the valid JSON for min/max ticks', async () => { + flipRatio = true + + const json = extractJSONFromURI( + await nftDescriptor.constructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + + const tokenMetadata = constructTokenMetadata( + tokenId, + quoteTokenAddress, + baseTokenAddress, + poolAddress, + quoteTokenSymbol, + baseTokenSymbol, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + '0.3%', + 'MIN<>MAX' + ) + + expect(json.description).to.equal(tokenMetadata.description) + expect(json.name).to.equal(tokenMetadata.name) + }) + }) + + it('gas', async () => { + await snapshotGasCost( + nftDescriptor.getGasCostOfConstructTokenURI({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ) + }) + + it('snapshot matches', async () => { + // get snapshot with super rare special sparkle + tokenId = 1 + poolAddress = `0x${'b'.repeat(40)}` + // get a snapshot with svg fade + tickCurrent = -1 + tickLower = 0 + tickUpper = 1000 + tickSpacing = TICK_SPACINGS[FeeAmount.LOW] + fee = FeeAmount.LOW + quoteTokenAddress = '0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf' + baseTokenAddress = '0x1234567890123456789123456789012345678901' + quoteTokenSymbol = 'UNI' + baseTokenSymbol = 'WETH' + expect( + await nftDescriptor.constructTokenURI({ + tokenId, + quoteTokenAddress, + baseTokenAddress, + quoteTokenSymbol, + baseTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + ).toMatchSnapshot() + }) + }) + + describe('#addressToString', () => { + it('returns the correct string for a given address', async () => { + let addressStr = await nftDescriptor.addressToString(`0x${'1234abcdef'.repeat(4)}`) + expect(addressStr).to.eq('0x1234abcdef1234abcdef1234abcdef1234abcdef') + addressStr = await nftDescriptor.addressToString(`0x${'1'.repeat(40)}`) + expect(addressStr).to.eq(`0x${'1'.repeat(40)}`) + }) + }) + + describe('#tickToDecimalString', () => { + let tickSpacing: number + let minTick: number + let maxTick: number + + describe('when tickspacing is 10', () => { + before(() => { + tickSpacing = TICK_SPACINGS[FeeAmount.LOW] + minTick = getMinTick(tickSpacing) + maxTick = getMaxTick(tickSpacing) + }) + + it('returns MIN on lowest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(minTick, tickSpacing, 18, 18, false)).to.equal('MIN') + }) + + it('returns MAX on the highest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(maxTick, tickSpacing, 18, 18, false)).to.equal('MAX') + }) + + it('returns the correct decimal string when the tick is in range', async () => { + expect(await nftDescriptor.tickToDecimalString(1, tickSpacing, 18, 18, false)).to.equal('1.0001') + }) + + it('returns the correct decimal string when tick is mintick for different tickspace', async () => { + const otherMinTick = getMinTick(TICK_SPACINGS[FeeAmount.HIGH]) + expect(await nftDescriptor.tickToDecimalString(otherMinTick, tickSpacing, 18, 18, false)).to.equal( + '0.0000000000000000000000000000000000000029387' + ) + }) + }) + + describe('when tickspacing is 60', () => { + before(() => { + tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] + minTick = getMinTick(tickSpacing) + maxTick = getMaxTick(tickSpacing) + }) + + it('returns MIN on lowest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(minTick, tickSpacing, 18, 18, false)).to.equal('MIN') + }) + + it('returns MAX on the highest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(maxTick, tickSpacing, 18, 18, false)).to.equal('MAX') + }) + + it('returns the correct decimal string when the tick is in range', async () => { + expect(await nftDescriptor.tickToDecimalString(-1, tickSpacing, 18, 18, false)).to.equal('0.99990') + }) + + it('returns the correct decimal string when tick is mintick for different tickspace', async () => { + const otherMinTick = getMinTick(TICK_SPACINGS[FeeAmount.HIGH]) + expect(await nftDescriptor.tickToDecimalString(otherMinTick, tickSpacing, 18, 18, false)).to.equal( + '0.0000000000000000000000000000000000000029387' + ) + }) + }) + + describe('when tickspacing is 200', () => { + before(() => { + tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + minTick = getMinTick(tickSpacing) + maxTick = getMaxTick(tickSpacing) + }) + + it('returns MIN on lowest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(minTick, tickSpacing, 18, 18, false)).to.equal('MIN') + }) + + it('returns MAX on the highest tick', async () => { + expect(await nftDescriptor.tickToDecimalString(maxTick, tickSpacing, 18, 18, false)).to.equal('MAX') + }) + + it('returns the correct decimal string when the tick is in range', async () => { + expect(await nftDescriptor.tickToDecimalString(0, tickSpacing, 18, 18, false)).to.equal('1.0000') + }) + + it('returns the correct decimal string when tick is mintick for different tickspace', async () => { + const otherMinTick = getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]) + expect(await nftDescriptor.tickToDecimalString(otherMinTick, tickSpacing, 18, 18, false)).to.equal( + '0.0000000000000000000000000000000000000029387' + ) + }) + }) + + describe('when token ratio is flipped', () => { + it('returns the inverse of default ratio for medium sized numbers', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + expect(await nftDescriptor.tickToDecimalString(10, tickSpacing, 18, 18, false)).to.eq('1.0010') + expect(await nftDescriptor.tickToDecimalString(10, tickSpacing, 18, 18, true)).to.eq('0.99900') + }) + + it('returns the inverse of default ratio for large numbers', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + expect(await nftDescriptor.tickToDecimalString(487272, tickSpacing, 18, 18, false)).to.eq( + '1448400000000000000000' + ) + expect(await nftDescriptor.tickToDecimalString(487272, tickSpacing, 18, 18, true)).to.eq( + '0.00000000000000000000069041' + ) + }) + + it('returns the inverse of default ratio for small numbers', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + expect(await nftDescriptor.tickToDecimalString(-387272, tickSpacing, 18, 18, false)).to.eq( + '0.000000000000000015200' + ) + expect(await nftDescriptor.tickToDecimalString(-387272, tickSpacing, 18, 18, true)).to.eq('65791000000000000') + }) + + it('returns the correct string with differing token decimals', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + expect(await nftDescriptor.tickToDecimalString(1000, tickSpacing, 18, 18, true)).to.eq('0.90484') + expect(await nftDescriptor.tickToDecimalString(1000, tickSpacing, 18, 10, true)).to.eq('90484000') + expect(await nftDescriptor.tickToDecimalString(1000, tickSpacing, 10, 18, true)).to.eq('0.0000000090484') + }) + + it('returns MIN for highest tick', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + const lowestTick = getMinTick(TICK_SPACINGS[FeeAmount.HIGH]) + expect(await nftDescriptor.tickToDecimalString(lowestTick, tickSpacing, 18, 18, true)).to.eq('MAX') + }) + + it('returns MAX for lowest tick', async () => { + const tickSpacing = TICK_SPACINGS[FeeAmount.HIGH] + const highestTick = getMaxTick(TICK_SPACINGS[FeeAmount.HIGH]) + expect(await nftDescriptor.tickToDecimalString(highestTick, tickSpacing, 18, 18, true)).to.eq('MIN') + }) + }) + }) + + describe('#fixedPointToDecimalString', () => { + describe('returns the correct string for', () => { + it('the highest possible price', async () => { + const ratio = encodePriceSqrt(33849, 1 / 10 ** 34) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq( + '338490000000000000000000000000000000000' + ) + }) + + it('large numbers', async () => { + let ratio = encodePriceSqrt(25811, 1 / 10 ** 11) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('2581100000000000') + ratio = encodePriceSqrt(17662, 1 / 10 ** 5) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('1766200000') + }) + + it('exactly 5 sigfig whole number', async () => { + const ratio = encodePriceSqrt(42026, 1) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('42026') + }) + + it('when the decimal is at index 4', async () => { + const ratio = encodePriceSqrt(12087, 10) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('1208.7') + }) + + it('when the decimal is at index 3', async () => { + const ratio = encodePriceSqrt(12087, 100) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('120.87') + }) + + it('when the decimal is at index 2', async () => { + const ratio = encodePriceSqrt(12087, 1000) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('12.087') + }) + + it('when the decimal is at index 1', async () => { + const ratio = encodePriceSqrt(12345, 10000) + const bla = await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('1.2345') + }) + + it('when sigfigs have trailing 0s after the decimal', async () => { + const ratio = encodePriceSqrt(1, 1) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('1.0000') + }) + + it('when there are exactly 5 numbers after the decimal', async () => { + const ratio = encodePriceSqrt(12345, 100000) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('0.12345') + }) + + it('very small numbers', async () => { + let ratio = encodePriceSqrt(38741, 10 ** 20) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq('0.00000000000000038741') + ratio = encodePriceSqrt(88498, 10 ** 35) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq( + '0.00000000000000000000000000000088498' + ) + }) + + it('smallest number', async () => { + const ratio = encodePriceSqrt(39000, 10 ** 43) + expect(await nftDescriptor.fixedPointToDecimalString(ratio, 18, 18)).to.eq( + '0.0000000000000000000000000000000000000029387' + ) + }) + }) + + describe('when tokens have different decimal precision', () => { + describe('when baseToken has more precision decimals than quoteToken', () => { + it('returns the correct string when the decimal difference is even', async () => { + expect(await nftDescriptor.fixedPointToDecimalString(encodePriceSqrt(1, 1), 18, 16)).to.eq('100.00') + }) + + it('returns the correct string when the decimal difference is odd', async () => { + const tenRatio = encodePriceSqrt(10, 1) + expect(await nftDescriptor.fixedPointToDecimalString(tenRatio, 18, 17)).to.eq('100.00') + }) + + it('does not account for higher token0 precision if difference is more than 18', async () => { + expect(await nftDescriptor.fixedPointToDecimalString(encodePriceSqrt(1, 1), 24, 5)).to.eq('1.0000') + }) + }) + + describe('when quoteToken has more precision decimals than baseToken', () => { + it('returns the correct string when the decimal difference is even', async () => { + expect(await nftDescriptor.fixedPointToDecimalString(encodePriceSqrt(1, 1), 10, 18)).to.eq('0.000000010000') + }) + + it('returns the correct string when the decimal difference is odd', async () => { + expect(await nftDescriptor.fixedPointToDecimalString(encodePriceSqrt(1, 1), 7, 18)).to.eq('0.000000000010000') + }) + + // TODO: provide compatibility token prices that breach minimum price due to token decimal differences + it.skip('returns the correct string when the decimal difference brings ratio below the minimum', async () => { + const lowRatio = encodePriceSqrt(88498, 10 ** 35) + expect(await nftDescriptor.fixedPointToDecimalString(lowRatio, 10, 20)).to.eq( + '0.000000000000000000000000000000000000000088498' + ) + }) + + it('does not account for higher token1 precision if difference is more than 18', async () => { + expect(await nftDescriptor.fixedPointToDecimalString(encodePriceSqrt(1, 1), 24, 5)).to.eq('1.0000') + }) + }) + + it('some fuzz', async () => { + const random = (min: number, max: number): number => { + return Math.floor(min + ((Math.random() * 100) % (max + 1 - min))) + } + + const inputs: [BigNumber, number, number][] = [] + let i = 0 + while (i <= 20) { + const ratio = BigNumber.from(`0x${randomBytes(random(7, 20)).toString('hex')}`) + const decimals0 = random(3, 21) + const decimals1 = random(3, 21) + const decimalDiff = Math.abs(decimals0 - decimals1) + + // TODO: Address edgecase out of bounds prices due to decimal differences + if ( + ratio.div(TEN.pow(decimalDiff)).gt(LOWEST_SQRT_RATIO) && + ratio.mul(TEN.pow(decimalDiff)).lt(HIGHEST_SQRT_RATIO) + ) { + inputs.push([ratio, decimals0, decimals1]) + i++ + } + } + + for (let i in inputs) { + let ratio: BigNumber | number + let decimals0: number + let decimals1: number + ;[ratio, decimals0, decimals1] = inputs[i] + let result = await nftDescriptor.fixedPointToDecimalString(ratio, decimals0, decimals1) + expect(formatSqrtRatioX96(ratio, decimals0, decimals1)).to.eq(result) + } + }).timeout(300_000) + }) + }) + + describe('#feeToPercentString', () => { + it('returns the correct fee for 0', async () => { + expect(await nftDescriptor.feeToPercentString(0)).to.eq('0%') + }) + + it('returns the correct fee for 1', async () => { + expect(await nftDescriptor.feeToPercentString(1)).to.eq('0.0001%') + }) + + it('returns the correct fee for 30', async () => { + expect(await nftDescriptor.feeToPercentString(30)).to.eq('0.003%') + }) + + it('returns the correct fee for 33', async () => { + expect(await nftDescriptor.feeToPercentString(33)).to.eq('0.0033%') + }) + + it('returns the correct fee for 500', async () => { + expect(await nftDescriptor.feeToPercentString(500)).to.eq('0.05%') + }) + + it('returns the correct fee for 2500', async () => { + expect(await nftDescriptor.feeToPercentString(2500)).to.eq('0.25%') + }) + + it('returns the correct fee for 3000', async () => { + expect(await nftDescriptor.feeToPercentString(3000)).to.eq('0.3%') + }) + + it('returns the correct fee for 10000', async () => { + expect(await nftDescriptor.feeToPercentString(10000)).to.eq('1%') + }) + + it('returns the correct fee for 17000', async () => { + expect(await nftDescriptor.feeToPercentString(17000)).to.eq('1.7%') + }) + + it('returns the correct fee for 100000', async () => { + expect(await nftDescriptor.feeToPercentString(100000)).to.eq('10%') + }) + + it('returns the correct fee for 150000', async () => { + expect(await nftDescriptor.feeToPercentString(150000)).to.eq('15%') + }) + + it('returns the correct fee for 102000', async () => { + expect(await nftDescriptor.feeToPercentString(102000)).to.eq('10.2%') + }) + + it('returns the correct fee for 10000000', async () => { + expect(await nftDescriptor.feeToPercentString(1000000)).to.eq('100%') + }) + + it('returns the correct fee for 1005000', async () => { + expect(await nftDescriptor.feeToPercentString(1005000)).to.eq('100.5%') + }) + + it('returns the correct fee for 10000000', async () => { + expect(await nftDescriptor.feeToPercentString(10000000)).to.eq('1000%') + }) + + it('returns the correct fee for 12300000', async () => { + expect(await nftDescriptor.feeToPercentString(12300000)).to.eq('1230%') + }) + }) + + describe('#tokenToColorHex', () => { + function tokenToColorHex(tokenAddress: string, startIndex: number): string { + return `${tokenAddress.slice(startIndex, startIndex + 6).toLowerCase()}` + } + + it('returns the correct hash for the first 3 bytes of the token address', async () => { + expect(await nftDescriptor.tokenToColorHex(tokens[0].address, 136)).to.eq(tokenToColorHex(tokens[0].address, 2)) + expect(await nftDescriptor.tokenToColorHex(tokens[1].address, 136)).to.eq(tokenToColorHex(tokens[1].address, 2)) + }) + + it('returns the correct hash for the last 3 bytes of the address', async () => { + expect(await nftDescriptor.tokenToColorHex(tokens[0].address, 0)).to.eq(tokenToColorHex(tokens[0].address, 36)) + expect(await nftDescriptor.tokenToColorHex(tokens[1].address, 0)).to.eq(tokenToColorHex(tokens[1].address, 36)) + }) + }) + + describe('#rangeLocation', () => { + it('returns the correct coordinates when range midpoint under -125_000', async () => { + const coords = await nftDescriptor.rangeLocation(-887_272, -887_100) + expect(coords[0]).to.eq('8') + expect(coords[1]).to.eq('7') + }) + + it('returns the correct coordinates when range midpoint is between -125_000 and -75_000', async () => { + const coords = await nftDescriptor.rangeLocation(-100_000, -90_000) + expect(coords[0]).to.eq('8') + expect(coords[1]).to.eq('10.5') + }) + + it('returns the correct coordinates when range midpoint is between -75_000 and -25_000', async () => { + const coords = await nftDescriptor.rangeLocation(-50_000, -20_000) + expect(coords[0]).to.eq('8') + expect(coords[1]).to.eq('14.25') + }) + + it('returns the correct coordinates when range midpoint is between -25_000 and -5_000', async () => { + const coords = await nftDescriptor.rangeLocation(-10_000, -5_000) + expect(coords[0]).to.eq('10') + expect(coords[1]).to.eq('18') + }) + + it('returns the correct coordinates when range midpoint is between -5_000 and 0', async () => { + const coords = await nftDescriptor.rangeLocation(-5_000, -4_000) + expect(coords[0]).to.eq('11') + expect(coords[1]).to.eq('21') + }) + + it('returns the correct coordinates when range midpoint is between 0 and 5_000', async () => { + const coords = await nftDescriptor.rangeLocation(4_000, 5_000) + expect(coords[0]).to.eq('13') + expect(coords[1]).to.eq('23') + }) + + it('returns the correct coordinates when range midpoint is between 5_000 and 25_000', async () => { + const coords = await nftDescriptor.rangeLocation(10_000, 15_000) + expect(coords[0]).to.eq('15') + expect(coords[1]).to.eq('25') + }) + + it('returns the correct coordinates when range midpoint is between 25_000 and 75_000', async () => { + const coords = await nftDescriptor.rangeLocation(25_000, 50_000) + expect(coords[0]).to.eq('18') + expect(coords[1]).to.eq('26') + }) + + it('returns the correct coordinates when range midpoint is between 75_000 and 125_000', async () => { + const coords = await nftDescriptor.rangeLocation(100_000, 125_000) + expect(coords[0]).to.eq('21') + expect(coords[1]).to.eq('27') + }) + + it('returns the correct coordinates when range midpoint is above 125_000', async () => { + const coords = await nftDescriptor.rangeLocation(200_000, 100_000) + expect(coords[0]).to.eq('24') + expect(coords[1]).to.eq('27') + }) + + it('math does not overflow on max value', async () => { + const coords = await nftDescriptor.rangeLocation(887_272, 887_272) + expect(coords[0]).to.eq('24') + expect(coords[1]).to.eq('27') + }) + }) + + describe('#svgImage', () => { + let tokenId: number + let baseTokenAddress: string + let quoteTokenAddress: string + let baseTokenSymbol: string + let quoteTokenSymbol: string + let baseTokenDecimals: number + let quoteTokenDecimals: number + let flipRatio: boolean + let tickLower: number + let tickUpper: number + let tickCurrent: number + let tickSpacing: number + let fee: number + let poolAddress: string + + beforeEach(async () => { + tokenId = 123 + quoteTokenAddress = '0x1234567890123456789123456789012345678901' + baseTokenAddress = '0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf' + quoteTokenSymbol = 'UNI' + baseTokenSymbol = 'WETH' + tickLower = -1000 + tickUpper = 2000 + tickCurrent = 40 + fee = 500 + baseTokenDecimals = await tokens[0].decimals() + quoteTokenDecimals = await tokens[1].decimals() + flipRatio = false + tickSpacing = TICK_SPACINGS[FeeAmount.MEDIUM] + poolAddress = `0x${'b'.repeat(40)}` + }) + + it('matches the current snapshot', async () => { + const svg = await nftDescriptor.generateSVGImage({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + + expect(svg).toMatchSnapshot() + fs.writeFileSync('./test/__snapshots__/NFTDescriptor.svg', svg) + }) + + it('returns a valid SVG', async () => { + const svg = await nftDescriptor.generateSVGImage({ + tokenId, + baseTokenAddress, + quoteTokenAddress, + baseTokenSymbol, + quoteTokenSymbol, + baseTokenDecimals, + quoteTokenDecimals, + flipRatio, + tickLower, + tickUpper, + tickCurrent, + tickSpacing, + fee, + poolAddress, + }) + expect(isSvg(svg)).to.eq(true) + }) + }) + + describe('#isRare', () => { + it('returns true sometimes', async () => { + expect(await nftDescriptor.isRare(1, `0x${'b'.repeat(40)}`)).to.eq(true) + }) + + it('returns false sometimes', async () => { + expect(await nftDescriptor.isRare(2, `0x${'b'.repeat(40)}`)).to.eq(false) + }) + }) + + function constructTokenMetadata( + tokenId: number, + quoteTokenAddress: string, + baseTokenAddress: string, + poolAddress: string, + quoteTokenSymbol: string, + baseTokenSymbol: string, + flipRatio: boolean, + tickLower: number, + tickUpper: number, + tickCurrent: number, + feeTier: string, + prices: string + ): { name: string; description: string } { + quoteTokenSymbol = quoteTokenSymbol.replace(/"/gi, '"') + baseTokenSymbol = baseTokenSymbol.replace(/"/gi, '"') + return { + name: `Uniswap - ${feeTier} - ${quoteTokenSymbol}/${baseTokenSymbol} - ${prices}`, + description: `This NFT represents a liquidity position in a Uniswap V3 ${quoteTokenSymbol}-${baseTokenSymbol} pool. The owner of this NFT can modify or redeem the position.\n\ +\nPool Address: ${poolAddress}\n${quoteTokenSymbol} Address: ${quoteTokenAddress.toLowerCase()}\n${baseTokenSymbol} Address: ${baseTokenAddress.toLowerCase()}\n\ +Fee Tier: ${feeTier}\nToken ID: ${tokenId}\n\n⚠️ DISCLAIMER: Due diligence is imperative when assessing this NFT. Make sure token addresses match the expected tokens, as \ +token symbols may be imitated.`, + } + } +}) diff --git a/lib/v3-periphery/test/NonfungiblePositionManager.spec.ts b/lib/v3-periphery/test/NonfungiblePositionManager.spec.ts new file mode 100644 index 0000000..98215ad --- /dev/null +++ b/lib/v3-periphery/test/NonfungiblePositionManager.spec.ts @@ -0,0 +1,1304 @@ +import { abi as IUniswapV3PoolABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json' +import { Fixture } from 'ethereum-waffle' +import { BigNumberish, constants, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { + IUniswapV3Factory, + IWETH9, + MockTimeNonfungiblePositionManager, + NonfungiblePositionManagerPositionsGasTest, + SwapRouter, + TestERC20, + TestPositionNFTOwner, +} from '../typechain' +import completeFixture from './shared/completeFixture' +import { computePoolAddress } from './shared/computePoolAddress' +import { FeeAmount, MaxUint128, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { expect } from './shared/expect' +import { extractJSONFromURI } from './shared/extractJSONFromURI' +import getPermitNFTSignature from './shared/getPermitNFTSignature' +import { encodePath } from './shared/path' +import poolAtAddress from './shared/poolAtAddress' +import snapshotGasCost from './shared/snapshotGasCost' +import { getMaxTick, getMinTick } from './shared/ticks' +import { sortedTokens } from './shared/tokenSort' + +describe('NonfungiblePositionManager', () => { + let wallets: Wallet[] + let wallet: Wallet, other: Wallet + + const nftFixture: Fixture<{ + nft: MockTimeNonfungiblePositionManager + factory: IUniswapV3Factory + tokens: [TestERC20, TestERC20, TestERC20] + weth9: IWETH9 + router: SwapRouter + }> = async (wallets, provider) => { + const { weth9, factory, tokens, nft, router } = await completeFixture(wallets, provider) + + // approve & fund wallets + for (const token of tokens) { + await token.approve(nft.address, constants.MaxUint256) + await token.connect(other).approve(nft.address, constants.MaxUint256) + await token.transfer(other.address, expandTo18Decimals(1_000_000)) + } + + return { + nft, + factory, + tokens, + weth9, + router, + } + } + + let factory: IUniswapV3Factory + let nft: MockTimeNonfungiblePositionManager + let tokens: [TestERC20, TestERC20, TestERC20] + let weth9: IWETH9 + let router: SwapRouter + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + wallets = await (ethers as any).getSigners() + ;[wallet, other] = wallets + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ nft, factory, tokens, weth9, router } = await loadFixture(nftFixture)) + }) + + it('bytecode size', async () => { + expect(((await nft.provider.getCode(nft.address)).length - 2) / 2).to.matchSnapshot() + }) + + describe('#createAndInitializePoolIfNecessary', () => { + it('creates the pool at the expected address', async () => { + const expectedAddress = computePoolAddress( + factory.address, + [tokens[0].address, tokens[1].address], + FeeAmount.MEDIUM + ) + const code = await wallet.provider.getCode(expectedAddress) + expect(code).to.eq('0x') + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + const codeAfter = await wallet.provider.getCode(expectedAddress) + expect(codeAfter).to.not.eq('0x') + }) + + it('is payable', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1), + { value: 1 } + ) + }) + + it('works if pool is created but not initialized', async () => { + const expectedAddress = computePoolAddress( + factory.address, + [tokens[0].address, tokens[1].address], + FeeAmount.MEDIUM + ) + await factory.createPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + const code = await wallet.provider.getCode(expectedAddress) + expect(code).to.not.eq('0x') + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(2, 1) + ) + }) + + it('works if pool is created and initialized', async () => { + const expectedAddress = computePoolAddress( + factory.address, + [tokens[0].address, tokens[1].address], + FeeAmount.MEDIUM + ) + await factory.createPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + const pool = new ethers.Contract(expectedAddress, IUniswapV3PoolABI, wallet) + + await pool.initialize(encodePriceSqrt(3, 1)) + const code = await wallet.provider.getCode(expectedAddress) + expect(code).to.not.eq('0x') + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(4, 1) + ) + }) + + it('could theoretically use eth via multicall', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[0]) + + const createAndInitializePoolIfNecessaryData = nft.interface.encodeFunctionData( + 'createAndInitializePoolIfNecessary', + [token0.address, token1.address, FeeAmount.MEDIUM, encodePriceSqrt(1, 1)] + ) + + await nft.multicall([createAndInitializePoolIfNecessaryData], { value: expandTo18Decimals(1) }) + }) + + it('gas', async () => { + await snapshotGasCost( + nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + ) + }) + }) + + describe('#mint', () => { + it('fails if pool does not exist', async () => { + await expect( + nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + recipient: wallet.address, + deadline: 1, + fee: FeeAmount.MEDIUM, + }) + ).to.be.reverted + }) + + it('fails if cannot transfer', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + await tokens[0].approve(nft.address, 0) + await expect( + nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + recipient: wallet.address, + deadline: 1, + }) + ).to.be.revertedWith('STF') + }) + + it('creates a token', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 15, + amount1Desired: 15, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + expect(await nft.balanceOf(other.address)).to.eq(1) + expect(await nft.tokenOfOwnerByIndex(other.address, 0)).to.eq(1) + const { + fee, + token0, + token1, + tickLower, + tickUpper, + liquidity, + tokensOwed0, + tokensOwed1, + feeGrowthInside0LastX128, + feeGrowthInside1LastX128, + } = await nft.positions(1) + expect(token0).to.eq(tokens[0].address) + expect(token1).to.eq(tokens[1].address) + expect(fee).to.eq(FeeAmount.MEDIUM) + expect(tickLower).to.eq(getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(tickUpper).to.eq(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(liquidity).to.eq(15) + expect(tokensOwed0).to.eq(0) + expect(tokensOwed1).to.eq(0) + expect(feeGrowthInside0LastX128).to.eq(0) + expect(feeGrowthInside1LastX128).to.eq(0) + }) + + it('can use eth via multicall', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[0]) + + // remove any approval + await weth9.approve(nft.address, 0) + + const createAndInitializeData = nft.interface.encodeFunctionData('createAndInitializePoolIfNecessary', [ + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1), + ]) + + const mintData = nft.interface.encodeFunctionData('mint', [ + { + token0: token0.address, + token1: token1.address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }, + ]) + + const refundETHData = nft.interface.encodeFunctionData('refundETH') + + const balanceBefore = await wallet.getBalance() + const tx = await nft.multicall([createAndInitializeData, mintData, refundETHData], { + value: expandTo18Decimals(1), + }) + const receipt = await tx.wait() + const balanceAfter = await wallet.getBalance() + expect(balanceBefore).to.eq(balanceAfter.add(receipt.gasUsed.mul(tx.gasPrice)).add(100)) + }) + + it('emits an event') + + it('gas first mint for pool', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await snapshotGasCost( + nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + ) + }) + + it('gas first mint for pool using eth with zero refund', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[0]) + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await snapshotGasCost( + nft.multicall( + [ + nft.interface.encodeFunctionData('mint', [ + { + token0: token0.address, + token1: token1.address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }, + ]), + nft.interface.encodeFunctionData('refundETH'), + ], + { value: 100 } + ) + ) + }) + + it('gas first mint for pool using eth with non-zero refund', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[0]) + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await snapshotGasCost( + nft.multicall( + [ + nft.interface.encodeFunctionData('mint', [ + { + token0: token0.address, + token1: token1.address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }, + ]), + nft.interface.encodeFunctionData('refundETH'), + ], + { value: 1000 } + ) + ) + }) + + it('gas mint on same ticks', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await snapshotGasCost( + nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + ) + }) + + it('gas mint for same pool, different ticks', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await snapshotGasCost( + nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]) + TICK_SPACINGS[FeeAmount.MEDIUM], + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]) - TICK_SPACINGS[FeeAmount.MEDIUM], + fee: FeeAmount.MEDIUM, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + ) + }) + }) + + describe('#increaseLiquidity', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 1000, + amount1Desired: 1000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('increases position liquidity', async () => { + await nft.increaseLiquidity({ + tokenId: tokenId, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + const { liquidity } = await nft.positions(tokenId) + expect(liquidity).to.eq(1100) + }) + + it('emits an event') + + it('can be paid with ETH', async () => { + const [token0, token1] = sortedTokens(tokens[0], weth9) + + const tokenId = 1 + + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + const mintData = nft.interface.encodeFunctionData('mint', [ + { + token0: token0.address, + token1: token1.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }, + ]) + const refundETHData = nft.interface.encodeFunctionData('unwrapWETH9', [0, other.address]) + await nft.multicall([mintData, refundETHData], { value: expandTo18Decimals(1) }) + + const increaseLiquidityData = nft.interface.encodeFunctionData('increaseLiquidity', [ + { + tokenId: tokenId, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }, + ]) + await nft.multicall([increaseLiquidityData, refundETHData], { value: expandTo18Decimals(1) }) + }) + + it('gas', async () => { + await snapshotGasCost( + nft.increaseLiquidity({ + tokenId: tokenId, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + ) + }) + }) + + describe('#decreaseLiquidity', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('emits an event') + + it('fails if past deadline', async () => { + await nft.setTime(2) + await expect( + nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ).to.be.revertedWith('Transaction too old') + }) + + it('cannot be called by other addresses', async () => { + await expect( + nft.decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ).to.be.revertedWith('Not approved') + }) + + it('decreases position liquidity', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 25, amount0Min: 0, amount1Min: 0, deadline: 1 }) + const { liquidity } = await nft.positions(tokenId) + expect(liquidity).to.eq(75) + }) + + it('is payable', async () => { + await nft + .connect(other) + .decreaseLiquidity({ tokenId, liquidity: 25, amount0Min: 0, amount1Min: 0, deadline: 1 }, { value: 1 }) + }) + + it('accounts for tokens owed', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 25, amount0Min: 0, amount1Min: 0, deadline: 1 }) + const { tokensOwed0, tokensOwed1 } = await nft.positions(tokenId) + expect(tokensOwed0).to.eq(24) + expect(tokensOwed1).to.eq(24) + }) + + it('can decrease for all the liquidity', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 100, amount0Min: 0, amount1Min: 0, deadline: 1 }) + const { liquidity } = await nft.positions(tokenId) + expect(liquidity).to.eq(0) + }) + + it('cannot decrease for more than all the liquidity', async () => { + await expect( + nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 101, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ).to.be.reverted + }) + + it('cannot decrease for more than the liquidity of the nft position', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 200, + amount1Desired: 200, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + await expect( + nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 101, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ).to.be.reverted + }) + + it('gas partial decrease', async () => { + await snapshotGasCost( + nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ) + }) + + it('gas complete decrease', async () => { + await snapshotGasCost( + nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 100, amount0Min: 0, amount1Min: 0, deadline: 1 }) + ) + }) + }) + + describe('#collect', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('emits an event') + + it('cannot be called by other addresses', async () => { + await expect( + nft.collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ).to.be.revertedWith('Not approved') + }) + + it('cannot be called with 0 for both amounts', async () => { + await expect( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: 0, + amount1Max: 0, + }) + ).to.be.reverted + }) + + it('no op if no tokens are owed', async () => { + await expect( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ) + .to.not.emit(tokens[0], 'Transfer') + .to.not.emit(tokens[1], 'Transfer') + }) + + it('transfers tokens owed from burn', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + const poolAddress = computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM) + await expect( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ) + .to.emit(tokens[0], 'Transfer') + .withArgs(poolAddress, wallet.address, 49) + .to.emit(tokens[1], 'Transfer') + .withArgs(poolAddress, wallet.address, 49) + }) + + it('gas transfers both', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await snapshotGasCost( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ) + }) + + it('gas transfers token0 only', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await snapshotGasCost( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: 0, + }) + ) + }) + + it('gas transfers token1 only', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await snapshotGasCost( + nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: 0, + amount1Max: MaxUint128, + }) + ) + }) + }) + + describe('#burn', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('emits an event') + + it('cannot be called by other addresses', async () => { + await expect(nft.burn(tokenId)).to.be.revertedWith('Not approved') + }) + + it('cannot be called while there is still liquidity', async () => { + await expect(nft.connect(other).burn(tokenId)).to.be.revertedWith('Not cleared') + }) + + it('cannot be called while there is still partial liquidity', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 50, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await expect(nft.connect(other).burn(tokenId)).to.be.revertedWith('Not cleared') + }) + + it('cannot be called while there is still tokens owed', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 100, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await expect(nft.connect(other).burn(tokenId)).to.be.revertedWith('Not cleared') + }) + + it('deletes the token', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 100, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + await nft.connect(other).burn(tokenId) + await expect(nft.positions(tokenId)).to.be.revertedWith('Invalid token ID') + }) + + it('gas', async () => { + await nft.connect(other).decreaseLiquidity({ tokenId, liquidity: 100, amount0Min: 0, amount1Min: 0, deadline: 1 }) + await nft.connect(other).collect({ + tokenId, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + await snapshotGasCost(nft.connect(other).burn(tokenId)) + }) + }) + + describe('#transferFrom', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('can only be called by authorized or owner', async () => { + await expect(nft.transferFrom(other.address, wallet.address, tokenId)).to.be.revertedWith( + 'ERC721: transfer caller is not owner nor approved' + ) + }) + + it('changes the owner', async () => { + await nft.connect(other).transferFrom(other.address, wallet.address, tokenId) + expect(await nft.ownerOf(tokenId)).to.eq(wallet.address) + }) + + it('removes existing approval', async () => { + await nft.connect(other).approve(wallet.address, tokenId) + expect(await nft.getApproved(tokenId)).to.eq(wallet.address) + await nft.transferFrom(other.address, wallet.address, tokenId) + expect(await nft.getApproved(tokenId)).to.eq(constants.AddressZero) + }) + + it('gas', async () => { + await snapshotGasCost(nft.connect(other).transferFrom(other.address, wallet.address, tokenId)) + }) + + it('gas comes from approved', async () => { + await nft.connect(other).approve(wallet.address, tokenId) + await snapshotGasCost(nft.transferFrom(other.address, wallet.address, tokenId)) + }) + }) + + describe('#permit', () => { + it('emits an event') + + describe('owned by eoa', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('changes the operator of the position and increments the nonce', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await nft.permit(wallet.address, tokenId, 1, v, r, s) + expect((await nft.positions(tokenId)).nonce).to.eq(1) + expect((await nft.positions(tokenId)).operator).to.eq(wallet.address) + }) + + it('cannot be called twice with the same signature', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await nft.permit(wallet.address, tokenId, 1, v, r, s) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.reverted + }) + + it('fails with invalid signature', async () => { + const { v, r, s } = await getPermitNFTSignature(wallet, nft, wallet.address, tokenId, 1) + await expect(nft.permit(wallet.address, tokenId, 1, v + 3, r, s)).to.be.revertedWith('Invalid signature') + }) + + it('fails with signature not from owner', async () => { + const { v, r, s } = await getPermitNFTSignature(wallet, nft, wallet.address, tokenId, 1) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.revertedWith('Unauthorized') + }) + + it('fails with expired signature', async () => { + await nft.setTime(2) + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.revertedWith('Permit expired') + }) + + it('gas', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await snapshotGasCost(nft.permit(wallet.address, tokenId, 1, v, r, s)) + }) + }) + describe('owned by verifying contract', () => { + const tokenId = 1 + let testPositionNFTOwner: TestPositionNFTOwner + + beforeEach('deploy test owner and create a position', async () => { + testPositionNFTOwner = (await ( + await ethers.getContractFactory('TestPositionNFTOwner') + ).deploy()) as TestPositionNFTOwner + + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: testPositionNFTOwner.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('changes the operator of the position and increments the nonce', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await testPositionNFTOwner.setOwner(other.address) + await nft.permit(wallet.address, tokenId, 1, v, r, s) + expect((await nft.positions(tokenId)).nonce).to.eq(1) + expect((await nft.positions(tokenId)).operator).to.eq(wallet.address) + }) + + it('fails if owner contract is owned by different address', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await testPositionNFTOwner.setOwner(wallet.address) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.revertedWith('Unauthorized') + }) + + it('fails with signature not from owner', async () => { + const { v, r, s } = await getPermitNFTSignature(wallet, nft, wallet.address, tokenId, 1) + await testPositionNFTOwner.setOwner(other.address) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.revertedWith('Unauthorized') + }) + + it('fails with expired signature', async () => { + await nft.setTime(2) + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await testPositionNFTOwner.setOwner(other.address) + await expect(nft.permit(wallet.address, tokenId, 1, v, r, s)).to.be.revertedWith('Permit expired') + }) + + it('gas', async () => { + const { v, r, s } = await getPermitNFTSignature(other, nft, wallet.address, tokenId, 1) + await testPositionNFTOwner.setOwner(other.address) + await snapshotGasCost(nft.permit(wallet.address, tokenId, 1, v, r, s)) + }) + }) + }) + + describe('multicall exit', () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + async function exit({ + nft, + liquidity, + tokenId, + amount0Min, + amount1Min, + recipient, + }: { + nft: MockTimeNonfungiblePositionManager + tokenId: BigNumberish + liquidity: BigNumberish + amount0Min: BigNumberish + amount1Min: BigNumberish + recipient: string + }) { + const decreaseLiquidityData = nft.interface.encodeFunctionData('decreaseLiquidity', [ + { tokenId, liquidity, amount0Min, amount1Min, deadline: 1 }, + ]) + const collectData = nft.interface.encodeFunctionData('collect', [ + { + tokenId, + recipient, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }, + ]) + const burnData = nft.interface.encodeFunctionData('burn', [tokenId]) + + return nft.multicall([decreaseLiquidityData, collectData, burnData]) + } + + it('executes all the actions', async () => { + const pool = poolAtAddress( + computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM), + wallet + ) + await expect( + exit({ + nft: nft.connect(other), + tokenId, + liquidity: 100, + amount0Min: 0, + amount1Min: 0, + recipient: wallet.address, + }) + ) + .to.emit(pool, 'Burn') + .to.emit(pool, 'Collect') + }) + + it('gas', async () => { + await snapshotGasCost( + exit({ + nft: nft.connect(other), + tokenId, + liquidity: 100, + amount0Min: 0, + amount1Min: 0, + recipient: wallet.address, + }) + ) + }) + }) + + describe('#tokenURI', async () => { + const tokenId = 1 + beforeEach('create a position', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: other.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + }) + + it('reverts for invalid token id', async () => { + await expect(nft.tokenURI(tokenId + 1)).to.be.reverted + }) + + it('returns a data URI with correct mime type', async () => { + expect(await nft.tokenURI(tokenId)).to.match(/data:application\/json;base64,.+/) + }) + + it('content is valid JSON and structure', async () => { + const content = extractJSONFromURI(await nft.tokenURI(tokenId)) + expect(content).to.haveOwnProperty('name').is.a('string') + expect(content).to.haveOwnProperty('description').is.a('string') + expect(content).to.haveOwnProperty('image').is.a('string') + }) + }) + + describe('fees accounting', () => { + beforeEach('create two positions', async () => { + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + // nft 1 earns 25% of fees + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + recipient: wallet.address, + }) + // nft 2 earns 75% of fees + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + + amount0Desired: 300, + amount1Desired: 300, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + recipient: wallet.address, + }) + }) + + describe('10k of token0 fees collect', () => { + beforeEach('swap for ~10k of fees', async () => { + const swapAmount = 3_333_333 + await tokens[0].approve(router.address, swapAmount) + await router.exactInput({ + recipient: wallet.address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + }) + it('expected amounts', async () => { + const { amount0: nft1Amount0, amount1: nft1Amount1 } = await nft.callStatic.collect({ + tokenId: 1, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + const { amount0: nft2Amount0, amount1: nft2Amount1 } = await nft.callStatic.collect({ + tokenId: 2, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + expect(nft1Amount0).to.eq(2501) + expect(nft1Amount1).to.eq(0) + expect(nft2Amount0).to.eq(7503) + expect(nft2Amount1).to.eq(0) + }) + + it('actually collected', async () => { + const poolAddress = computePoolAddress( + factory.address, + [tokens[0].address, tokens[1].address], + FeeAmount.MEDIUM + ) + + await expect( + nft.collect({ + tokenId: 1, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ) + .to.emit(tokens[0], 'Transfer') + .withArgs(poolAddress, wallet.address, 2501) + .to.not.emit(tokens[1], 'Transfer') + await expect( + nft.collect({ + tokenId: 2, + recipient: wallet.address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + ) + .to.emit(tokens[0], 'Transfer') + .withArgs(poolAddress, wallet.address, 7503) + .to.not.emit(tokens[1], 'Transfer') + }) + }) + }) + + describe('#positions', async () => { + it('gas', async () => { + const positionsGasTestFactory = await ethers.getContractFactory('NonfungiblePositionManagerPositionsGasTest') + const positionsGasTest = (await positionsGasTestFactory.deploy( + nft.address + )) as NonfungiblePositionManagerPositionsGasTest + + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: other.address, + amount0Desired: 15, + amount1Desired: 15, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await snapshotGasCost(positionsGasTest.getGasCostOfPositions(1)) + }) + }) +}) diff --git a/lib/v3-periphery/test/NonfungibleTokenPositionDescriptor.spec.ts b/lib/v3-periphery/test/NonfungibleTokenPositionDescriptor.spec.ts new file mode 100644 index 0000000..783ce4a --- /dev/null +++ b/lib/v3-periphery/test/NonfungibleTokenPositionDescriptor.spec.ts @@ -0,0 +1,217 @@ +import { constants, Wallet } from 'ethers' +import { waffle, ethers } from 'hardhat' +import { expect } from './shared/expect' +import { Fixture } from 'ethereum-waffle' +import { NonfungibleTokenPositionDescriptor, MockTimeNonfungiblePositionManager, TestERC20 } from '../typechain' +import completeFixture from './shared/completeFixture' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { FeeAmount, TICK_SPACINGS } from './shared/constants' +import { getMaxTick, getMinTick } from './shared/ticks' +import { sortedTokens } from './shared/tokenSort' +import { extractJSONFromURI } from './shared/extractJSONFromURI' + +const DAI = '0x6B175474E89094C44Da98b954EedeAC495271d0F' +const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' +const USDT = '0xdAC17F958D2ee523a2206206994597C13D831ec7' +const TBTC = '0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa' +const WBTC = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' + +describe('NonfungibleTokenPositionDescriptor', () => { + let wallets: Wallet[] + + const nftPositionDescriptorCompleteFixture: Fixture<{ + nftPositionDescriptor: NonfungibleTokenPositionDescriptor + tokens: [TestERC20, TestERC20, TestERC20] + nft: MockTimeNonfungiblePositionManager + }> = async (wallets, provider) => { + const { factory, nft, router, nftDescriptor } = await completeFixture(wallets, provider) + const tokenFactory = await ethers.getContractFactory('TestERC20') + const tokens: [TestERC20, TestERC20, TestERC20] = [ + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, // do not use maxu256 to avoid overflowing + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + ] + tokens.sort((a, b) => (a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1)) + + return { + nftPositionDescriptor: nftDescriptor, + tokens, + nft, + } + } + + let nftPositionDescriptor: NonfungibleTokenPositionDescriptor + let tokens: [TestERC20, TestERC20, TestERC20] + let nft: MockTimeNonfungiblePositionManager + let weth9: TestERC20 + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + wallets = await (ethers as any).getSigners() + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ tokens, nft, nftPositionDescriptor } = await loadFixture(nftPositionDescriptorCompleteFixture)) + const tokenFactory = await ethers.getContractFactory('TestERC20') + weth9 = tokenFactory.attach(await nftPositionDescriptor.WETH9()) as TestERC20 + }) + + describe('#tokenRatioPriority', () => { + it('returns -100 for WETH9', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(weth9.address, 1)).to.eq(-100) + }) + + it('returns 200 for USDC', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(USDC, 1)).to.eq(300) + }) + + it('returns 100 for DAI', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(DAI, 1)).to.eq(100) + }) + + it('returns 150 for USDT', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(USDT, 1)).to.eq(200) + }) + + it('returns -200 for TBTC', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(TBTC, 1)).to.eq(-200) + }) + + it('returns -250 for WBTC', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(WBTC, 1)).to.eq(-300) + }) + + it('returns 0 for any non-ratioPriority token', async () => { + expect(await nftPositionDescriptor.tokenRatioPriority(tokens[0].address, 1)).to.eq(0) + }) + }) + + describe('#flipRatio', () => { + it('returns false if neither token has priority ordering', async () => { + expect(await nftPositionDescriptor.flipRatio(tokens[0].address, tokens[2].address, 1)).to.eq(false) + }) + + it('returns true if both tokens are numerators but token0 has a higher priority ordering', async () => { + expect(await nftPositionDescriptor.flipRatio(USDC, DAI, 1)).to.eq(true) + }) + + it('returns true if both tokens are denominators but token1 has lower priority ordering', async () => { + expect(await nftPositionDescriptor.flipRatio(weth9.address, WBTC, 1)).to.eq(true) + }) + + it('returns true if token0 is a numerator and token1 is a denominator', async () => { + expect(await nftPositionDescriptor.flipRatio(DAI, WBTC, 1)).to.eq(true) + }) + + it('returns false if token1 is a numerator and token0 is a denominator', async () => { + expect(await nftPositionDescriptor.flipRatio(WBTC, DAI, 1)).to.eq(false) + }) + }) + + describe('#tokenURI', () => { + it('displays ETH as token symbol for WETH token', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[1]) + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + await weth9.approve(nft.address, 100) + await tokens[1].approve(nft.address, 100) + await nft.mint({ + token0: token0.address, + token1: token1.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallets[0].address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + + const metadata = extractJSONFromURI(await nft.tokenURI(1)) + expect(metadata.name).to.match(/(\sETH\/TEST|TEST\/ETH)/) + expect(metadata.description).to.match(/(TEST-ETH|\sETH-TEST)/) + expect(metadata.description).to.match(/(\nETH\sAddress)/) + }) + + it('displays returned token symbols when neither token is WETH ', async () => { + const [token0, token1] = sortedTokens(tokens[2], tokens[1]) + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + await tokens[1].approve(nft.address, 100) + await tokens[2].approve(nft.address, 100) + await nft.mint({ + token0: token0.address, + token1: token1.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallets[0].address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + + const metadata = extractJSONFromURI(await nft.tokenURI(1)) + expect(metadata.name).to.match(/TEST\/TEST/) + expect(metadata.description).to.match(/TEST-TEST/) + }) + + it('can render a different label for native currencies', async () => { + const [token0, token1] = sortedTokens(weth9, tokens[1]) + await nft.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + await weth9.approve(nft.address, 100) + await tokens[1].approve(nft.address, 100) + await nft.mint({ + token0: token0.address, + token1: token1.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallets[0].address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + + const nftDescriptorLibraryFactory = await ethers.getContractFactory('NFTDescriptor') + const nftDescriptorLibrary = await nftDescriptorLibraryFactory.deploy() + const positionDescriptorFactory = await ethers.getContractFactory('NonfungibleTokenPositionDescriptor', { + libraries: { + NFTDescriptor: nftDescriptorLibrary.address, + }, + }) + const nftDescriptor = (await positionDescriptorFactory.deploy( + weth9.address, + // 'FUNNYMONEY' as a bytes32 string + '0x46554e4e594d4f4e455900000000000000000000000000000000000000000000' + )) as NonfungibleTokenPositionDescriptor + + const metadata = extractJSONFromURI(await nftDescriptor.tokenURI(nft.address, 1)) + expect(metadata.name).to.match(/(\sFUNNYMONEY\/TEST|TEST\/FUNNYMONEY)/) + expect(metadata.description).to.match(/(TEST-FUNNYMONEY|\sFUNNYMONEY-TEST)/) + expect(metadata.description).to.match(/(\nFUNNYMONEY\sAddress)/) + }) + }) +}) diff --git a/lib/v3-periphery/test/OracleLibrary.spec.ts b/lib/v3-periphery/test/OracleLibrary.spec.ts new file mode 100644 index 0000000..d15864e --- /dev/null +++ b/lib/v3-periphery/test/OracleLibrary.spec.ts @@ -0,0 +1,675 @@ +import { expect } from 'chai' +import { ethers, waffle } from 'hardhat' +import { BigNumber, BigNumberish, constants, ContractFactory, Contract } from 'ethers' +import { OracleTest, TestERC20 } from '../typechain' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('OracleLibrary', () => { + let loadFixture: ReturnType + let tokens: TestERC20[] + let oracle: OracleTest + + const BN0 = BigNumber.from(0) + + const oracleTestFixture = async () => { + const tokenFactory = await ethers.getContractFactory('TestERC20') + const tokens: [TestERC20, TestERC20, TestERC20] = [ + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, // do not use maxu256 to avoid overflowing + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + ] + + tokens.sort((a, b) => (a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1)) + + const oracleFactory = await ethers.getContractFactory('OracleTest') + const oracle = await oracleFactory.deploy() + + return { + tokens: tokens as TestERC20[], + oracle: oracle as OracleTest, + } + } + + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(await (ethers as any).getSigners()) + }) + + beforeEach('deploy fixture', async () => { + const fixtures = await loadFixture(oracleTestFixture) + tokens = fixtures['tokens'] + oracle = fixtures['oracle'] + }) + + describe('#consult', () => { + let mockObservableFactory: ContractFactory + + before('create mockObservableFactory', async () => { + mockObservableFactory = await ethers.getContractFactory('MockObservable') + }) + + it('reverts when period is 0', async () => { + await expect(oracle.consult(oracle.address, 0)).to.be.revertedWith('BP') + }) + + it('correct output when tick is 0', async () => { + const period = 3 + const secondsPerLiqCumulatives: [BigNumberish, BigNumberish] = [10, 20] + const mockObservable = await observableWith({ + period, + tickCumulatives: [12, 12], + secondsPerLiqCumulatives, + }) + const { arithmeticMeanTick, harmonicMeanLiquidity } = await oracle.consult(mockObservable.address, period) + + expect(arithmeticMeanTick).to.equal(0) + expect(harmonicMeanLiquidity).to.equal(calculateHarmonicAvgLiq(period, secondsPerLiqCumulatives)) + }) + + it('correct rounding for .5 negative tick', async () => { + const period = 4 + + const secondsPerLiqCumulatives: [BigNumberish, BigNumberish] = [10, 15] + const mockObservable = await observableWith({ + period, + tickCumulatives: [-10, -12], + secondsPerLiqCumulatives, + }) + + const { arithmeticMeanTick, harmonicMeanLiquidity } = await oracle.consult(mockObservable.address, period) + + // Always round to negative infinity + // In this case, we need to subtract one because integer division rounds to 0 + expect(arithmeticMeanTick).to.equal(-1) + expect(harmonicMeanLiquidity).to.equal(calculateHarmonicAvgLiq(period, secondsPerLiqCumulatives)) + }) + + it('correct output for liquidity overflow', async () => { + const period = 1 + + const secondsPerLiqCumulatives: [BigNumberish, BigNumberish] = [10, 11] + const mockObservable = await observableWith({ + period, + tickCumulatives: [12, 12], + secondsPerLiqCumulatives, + }) + + const { arithmeticMeanTick, harmonicMeanLiquidity } = await oracle.consult(mockObservable.address, period) + + expect(arithmeticMeanTick).to.equal(0) + // Make sure liquidity doesn't overflow uint128 + expect(harmonicMeanLiquidity).to.equal(BigNumber.from(2).pow(128).sub(1)) + }) + + function calculateHarmonicAvgLiq(period: number, secondsPerLiqCumulatives: [BigNumberish, BigNumberish]) { + const [secondsPerLiq0, secondsPerLiq1] = secondsPerLiqCumulatives.map(BigNumber.from) + const delta = secondsPerLiq1.sub(secondsPerLiq0) + + const maxUint160 = BigNumber.from(2).pow(160).sub(1) + return maxUint160.mul(period).div(delta.shl(32)) + } + + function observableWith({ + period, + tickCumulatives, + secondsPerLiqCumulatives, + }: { + period: number + tickCumulatives: [BigNumberish, BigNumberish] + secondsPerLiqCumulatives: [BigNumberish, BigNumberish] + }) { + return mockObservableFactory.deploy( + [period, 0], + tickCumulatives.map(BigNumber.from), + secondsPerLiqCumulatives.map(BigNumber.from) + ) + } + }) + + describe('#getQuoteAtTick', () => { + // sanity check + it('token0: returns correct value when tick = 0', async () => { + const quoteAmount = await oracle.getQuoteAtTick(BN0, expandTo18Decimals(1), tokens[0].address, tokens[1].address) + + expect(quoteAmount).to.equal(expandTo18Decimals(1)) + }) + + // sanity check + it('token1: returns correct value when tick = 0', async () => { + const quoteAmount = await oracle.getQuoteAtTick(BN0, expandTo18Decimals(1), tokens[1].address, tokens[0].address) + + expect(quoteAmount).to.equal(expandTo18Decimals(1)) + }) + + it('token0: returns correct value when at min tick | 0 < sqrtRatioX96 <= type(uint128).max', async () => { + const quoteAmount = await oracle.getQuoteAtTick( + BigNumber.from(-887272), + BigNumber.from(2).pow(128).sub(1), + tokens[0].address, + tokens[1].address + ) + expect(quoteAmount).to.equal(BigNumber.from('1')) + }) + + it('token1: returns correct value when at min tick | 0 < sqrtRatioX96 <= type(uint128).max', async () => { + const quoteAmount = await oracle.getQuoteAtTick( + BigNumber.from(-887272), + BigNumber.from(2).pow(128).sub(1), + tokens[1].address, + tokens[0].address + ) + expect(quoteAmount).to.equal( + BigNumber.from('115783384738768196242144082653949453838306988932806144552194799290216044976282') + ) + }) + + it('token0: returns correct value when at max tick | sqrtRatioX96 > type(uint128).max', async () => { + const quoteAmount = await oracle.getQuoteAtTick( + BigNumber.from(887272), + BigNumber.from(2).pow(128).sub(1), + tokens[0].address, + tokens[1].address + ) + expect(quoteAmount).to.equal( + BigNumber.from('115783384785599357996676985412062652720342362943929506828539444553934033845703') + ) + }) + + it('token1: returns correct value when at max tick | sqrtRatioX96 > type(uint128).max', async () => { + const quoteAmount = await oracle.getQuoteAtTick( + BigNumber.from(887272), + BigNumber.from(2).pow(128).sub(1), + tokens[1].address, + tokens[0].address + ) + expect(quoteAmount).to.equal(BigNumber.from('1')) + }) + + it('gas test', async () => { + await snapshotGasCost( + oracle.getGasCostOfGetQuoteAtTick( + BigNumber.from(10), + expandTo18Decimals(1), + tokens[0].address, + tokens[1].address + ) + ) + }) + }) + + describe('#getOldestObservationSecondsAgo', () => { + let mockObservationsFactory: ContractFactory + + // some empty tick values as this function does not use them + const emptySPL = [0, 0, 0, 0] + const emptyTickCumulatives = [0, 0, 0, 0] + const emptyTick = 0 + const emptyLiquidity = 0 + + // helper function to run each test case identically + const runOldestObservationsTest = async ( + blockTimestamps: number[], + initializeds: boolean[], + observationCardinality: number, + observationIndex: number + ) => { + const mockObservations = await mockObservationsFactory.deploy( + blockTimestamps, + emptyTickCumulatives, + emptySPL, + initializeds, + emptyTick, + observationCardinality, + observationIndex, + false, + emptyLiquidity + ) + + var result = await oracle.getOldestObservationSecondsAgo(mockObservations.address) + + //calculate seconds ago + var secondsAgo + if (initializeds[(observationIndex + 1) % observationCardinality]) { + secondsAgo = result['currentTimestamp'] - blockTimestamps[(observationIndex + 1) % observationCardinality] + } else { + secondsAgo = result['currentTimestamp'] - blockTimestamps[0] + } + + if (secondsAgo < 0) { + secondsAgo += 2 ** 32 + } + + expect(result['secondsAgo']).to.equal(secondsAgo) + } + + before('create mockObservationsFactory', async () => { + mockObservationsFactory = await ethers.getContractFactory('MockObservations') + }) + + it('fetches the oldest timestamp from the slot after observationIndex', async () => { + // set up test case + const blockTimestamps = [2, 3, 1, 0] + const initializeds = [true, true, true, false] + const observationCardinality = 3 + const observationIndex = 1 + + // run test + await runOldestObservationsTest(blockTimestamps, initializeds, observationCardinality, observationIndex) + }) + + it('loops to fetches the oldest timestamp from index 0', async () => { + // set up test case + const blockTimestamps = [1, 2, 3, 0] + const initializeds = [true, true, true, false] + const observationCardinality = 3 + const observationIndex = 2 + + // run test + await runOldestObservationsTest(blockTimestamps, initializeds, observationCardinality, observationIndex) + }) + + it('fetches from index 0 if the next index is uninitialized', async () => { + // set up test case + const blockTimestamps = [1, 2, 0, 0] + const initializeds = [true, true, false, false] + const observationCardinality = 4 + const observationIndex = 1 + + // run test + await runOldestObservationsTest(blockTimestamps, initializeds, observationCardinality, observationIndex) + }) + + it('reverts if the pool is not initialized', async () => { + const blockTimestamps = [0, 0, 0, 0] + const initializeds = [false, false, false, false] + const observationCardinality = 0 + const observationIndex = 0 + const mockObservations = await mockObservationsFactory.deploy( + blockTimestamps, + emptyTickCumulatives, + emptySPL, + initializeds, + emptyTick, + observationCardinality, + observationIndex, + false, + emptyLiquidity + ) + + await expect(oracle.getOldestObservationSecondsAgo(mockObservations.address)).to.be.revertedWith('NI') + }) + + it('fetches the correct timestamp when the timestamps overflow', async () => { + // set up test case + const maxUint32 = 2 ** 32 - 1 + const blockTimestamps = [maxUint32, 3, maxUint32 - 2, 0] + const initializeds = [true, true, true, false] + const observationCardinality = 3 + const observationIndex = 1 + + // run test + await runOldestObservationsTest(blockTimestamps, initializeds, observationCardinality, observationIndex) + }) + }) + + describe('#getBlockStartingTickAndLiquidity', () => { + let mockObservationsFactory: ContractFactory + let mockObservations: Contract + let blockTimestamps: number[] + let tickCumulatives: number[] + let liquidityValues: BigNumber[] + let initializeds: boolean[] + let slot0Tick: number + let observationCardinality: number + let observationIndex: number + let lastObservationCurrentTimestamp: boolean + let liquidity: number + + before('create mockObservationsFactory', async () => { + mockObservationsFactory = await ethers.getContractFactory('MockObservations') + }) + + const deployMockObservationsContract = async () => { + mockObservations = await mockObservationsFactory.deploy( + blockTimestamps, + tickCumulatives, + liquidityValues, + initializeds, + slot0Tick, + observationCardinality, + observationIndex, + lastObservationCurrentTimestamp, + liquidity + ) + } + + it('reverts if the pool is not initialized', async () => { + blockTimestamps = [0, 0, 0, 0] + tickCumulatives = [0, 0, 0, 0] + liquidityValues = [BN0, BN0, BN0, BN0] + initializeds = [false, false, false, false] + slot0Tick = 0 + observationCardinality = 0 + observationIndex = 0 + lastObservationCurrentTimestamp = false + liquidity = 0 + + await deployMockObservationsContract() + + await expect(oracle.getBlockStartingTickAndLiquidity(mockObservations.address)).to.be.revertedWith('NEO') + }) + + it('returns the tick and liquidity in storage if the latest observation was in a previous block', async () => { + blockTimestamps = [1, 3, 4, 0] + // 0 + // 8: 0 + (4*(3-1)) + // 13: 8 + (5*(4-3)) + tickCumulatives = [0, 8, 13, 0] + // 0 + // (1): 0 + ((3-1)*2**128)/5000 + // (1) + ((4-3)*2**128)/7000 + liquidityValues = [ + BN0, + BigNumber.from('136112946768375385385349842972707284'), + BigNumber.from('184724713471366594451546215462959885'), + BN0, + ] + initializeds = [true, true, true, false] + observationCardinality = 3 + observationIndex = 2 + slot0Tick = 6 + lastObservationCurrentTimestamp = false + liquidity = 10000 + + await deployMockObservationsContract() + + var result = await oracle.getBlockStartingTickAndLiquidity(mockObservations.address) + expect(result[0]).to.equal(slot0Tick) + expect(result[1]).to.equal(liquidity) + }) + + it('reverts if it needs 2 observations and doesnt have them', async () => { + blockTimestamps = [1, 0, 0, 0] + tickCumulatives = [8, 0, 0, 0] + liquidityValues = [BigNumber.from('136112946768375385385349842972707284'), BN0, BN0, BN0] + initializeds = [true, false, false, false] + observationCardinality = 1 + observationIndex = 0 + slot0Tick = 4 + lastObservationCurrentTimestamp = true + liquidity = 10000 + + await deployMockObservationsContract() + + await expect(oracle.getBlockStartingTickAndLiquidity(mockObservations.address)).to.be.revertedWith('NEO') + }) + + it('reverts if the prior observation needed is not initialized', async () => { + blockTimestamps = [1, 0, 0, 0] + observationCardinality = 2 + observationIndex = 0 + liquidityValues = [BigNumber.from('136112946768375385385349842972707284'), BN0, BN0, BN0] + initializeds = [true, false, false, false] + tickCumulatives = [8, 0, 0, 0] + slot0Tick = 4 + lastObservationCurrentTimestamp = true + + await deployMockObservationsContract() + + await expect(oracle.getBlockStartingTickAndLiquidity(mockObservations.address)).to.be.revertedWith('ONI') + }) + + it('calculates the prior tick and liquidity from the prior observations', async () => { + blockTimestamps = [9, 5, 8, 0] + observationCardinality = 3 + observationIndex = 0 + initializeds = [true, true, true, false] + // 99: 95 + (4*1) + // 80: 72 + (4*2) + // 95: 80 + (5*3) + tickCumulatives = [99, 80, 95, 0] + // prev: 784724713471366594451546215462959885 + // (3): (2) + (1*2**128)/13212 + // (1): prev + (2*2**128)/12345 + // (2): (1) + (3*2**128)/10238 + liquidityValues = [ + BigNumber.from('965320616647837491242414421221086683'), + BigNumber.from('839853488995212437053956034406948254'), + BigNumber.from('939565063595995342933046073701273770'), + BN0, + ] + slot0Tick = 3 + lastObservationCurrentTimestamp = true + + await deployMockObservationsContract() + + var result = await oracle.getBlockStartingTickAndLiquidity(mockObservations.address) + + var actualStartingTick = (tickCumulatives[0] - tickCumulatives[2]) / (blockTimestamps[0] - blockTimestamps[2]) + expect(result[0]).to.equal(actualStartingTick) + + var actualStartingLiquidity = 13212 // see comments above + expect(result[1]).to.equal(actualStartingLiquidity) + }) + }) + + describe('#getWeightedArithmeticMeanTick', () => { + it('single observation returns average tick', async () => { + const observation = { tick: 10, weight: 10 } + + const oracleTick = await oracle.getWeightedArithmeticMeanTick([observation]) + + expect(oracleTick).to.equal(10) + }) + + it('multiple observations with same weight result in average across tiers', async () => { + const observation1 = { tick: 10, weight: 10 } + const observation2 = { tick: 20, weight: 10 } + + const oracleTick = await oracle.getWeightedArithmeticMeanTick([observation1, observation2]) + + expect(oracleTick).to.equal(15) + }) + + it('multiple observations with different weights are weighted correctly', async () => { + const observation2 = { tick: 20, weight: 15 } + const observation1 = { tick: 10, weight: 10 } + + const oracleTick = await oracle.getWeightedArithmeticMeanTick([observation1, observation2]) + + expect(oracleTick).to.equal(16) + }) + + it('correct rounding for .5 negative tick', async () => { + const observation1 = { tick: -10, weight: 10 } + const observation2 = { tick: -11, weight: 10 } + + const oracleTick = await oracle.getWeightedArithmeticMeanTick([observation1, observation2]) + + expect(oracleTick).to.equal(-11) + }) + }) + describe('#getChainedPrice', () => { + let ticks: number[] + + it('fails with discrepant length', async () => { + const tokenAddresses = [tokens[0].address, tokens[2].address] + ticks = [5, 5] + + expect(oracle.getChainedPrice(tokenAddresses, ticks)).to.be.revertedWith('DL') + }) + it('add two positive ticks, sorted order', async () => { + const tokenAddresses = [tokens[0].address, tokens[1].address, tokens[2].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + it('add one positive and one negative tick, sorted order', async () => { + const tokenAddresses = [tokens[0].address, tokens[1].address, tokens[2].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one negative and one positive tick, sorted order', async () => { + const tokenAddresses = [tokens[0].address, tokens[1].address, tokens[2].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add two negative ticks, sorted order', async () => { + const tokenAddresses = [tokens[0].address, tokens[1].address, tokens[2].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + + it('add two positive ticks, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[0].address, tokens[2].address, tokens[1].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one positive tick and one negative tick, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[0].address, tokens[2].address, tokens[1].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + it('add one negative tick and one positive tick, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[0].address, tokens[2].address, tokens[1].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + it('add two negative ticks, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[0].address, tokens[2].address, tokens[1].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + + it('add two positive ticks, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[1].address, tokens[0].address, tokens[2].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one positive tick and one negative tick, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[1].address, tokens[0].address, tokens[2].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + it('add one negative tick and one positive tick, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[1].address, tokens[0].address, tokens[2].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + it('add two negative ticks, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[1].address, tokens[0].address, tokens[2].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + + it('add two positive ticks, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[1].address, tokens[2].address, tokens[0].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one positive tick and one negative tick, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[1].address, tokens[2].address, tokens[0].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + it('add one negative tick and one positive tick, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[1].address, tokens[2].address, tokens[0].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + it('add two negative ticks, token0/token1 + token1/token0', async () => { + const tokenAddresses = [tokens[1].address, tokens[2].address, tokens[0].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + + it('add two positive ticks, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[2].address, tokens[0].address, tokens[1].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one positive tick and one negative tick, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[2].address, tokens[0].address, tokens[1].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + it('add one negative tick and one positive tick, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[2].address, tokens[0].address, tokens[1].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + it('add two negative ticks, token1/token0 + token0/token1', async () => { + const tokenAddresses = [tokens[2].address, tokens[0].address, tokens[1].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + + it('add two positive ticks, token1/token0 + token1/token0', async () => { + const tokenAddresses = [tokens[2].address, tokens[1].address, tokens[0].address] + ticks = [5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(-10) + }) + it('add one positive tick and one negative tick, token1/token0 + token1/token0', async () => { + const tokenAddresses = [tokens[2].address, tokens[1].address, tokens[0].address] + ticks = [5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add one negative tick and one positive tick, token1/token0 + token1/token0', async () => { + const tokenAddresses = [tokens[2].address, tokens[1].address, tokens[0].address] + ticks = [-5, 5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(0) + }) + it('add two negative ticks, token1/token0 + token1/token0', async () => { + const tokenAddresses = [tokens[2].address, tokens[1].address, tokens[0].address] + ticks = [-5, -5] + const oracleTick = await oracle.getChainedPrice(tokenAddresses, ticks) + + expect(oracleTick).to.equal(10) + }) + }) +}) diff --git a/lib/v3-periphery/test/PairFlash.spec.ts b/lib/v3-periphery/test/PairFlash.spec.ts new file mode 100644 index 0000000..b6084ed --- /dev/null +++ b/lib/v3-periphery/test/PairFlash.spec.ts @@ -0,0 +1,168 @@ +import { ethers, waffle } from 'hardhat' +import { BigNumber, constants, Contract, ContractTransaction } from 'ethers' +import { + IWETH9, + MockTimeNonfungiblePositionManager, + MockTimeSwapRouter, + PairFlash, + IUniswapV3Pool, + TestERC20, + TestERC20Metadata, + IUniswapV3Factory, + NFTDescriptor, + Quoter, + SwapRouter, +} from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, MaxUint128, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import snapshotGasCost from './shared/snapshotGasCost' + +import { expect } from './shared/expect' +import { getMaxTick, getMinTick } from './shared/ticks' +import { computePoolAddress } from './shared/computePoolAddress' + +describe('PairFlash test', () => { + const provider = waffle.provider + const wallets = waffle.provider.getWallets() + const wallet = wallets[0] + + let flash: PairFlash + let nft: MockTimeNonfungiblePositionManager + let token0: TestERC20 + let token1: TestERC20 + let factory: IUniswapV3Factory + let quoter: Quoter + + async function createPool(tokenAddressA: string, tokenAddressB: string, fee: FeeAmount, price: BigNumber) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary(tokenAddressA, tokenAddressB, fee, price) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: fee, + tickLower: getMinTick(TICK_SPACINGS[fee]), + tickUpper: getMaxTick(TICK_SPACINGS[fee]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams) + } + + const flashFixture = async () => { + const { router, tokens, factory, weth9, nft } = await completeFixture(wallets, provider) + const token0 = tokens[0] + const token1 = tokens[1] + + const flashContractFactory = await ethers.getContractFactory('PairFlash') + const flash = (await flashContractFactory.deploy(router.address, factory.address, weth9.address)) as PairFlash + + const quoterFactory = await ethers.getContractFactory('Quoter') + const quoter = (await quoterFactory.deploy(factory.address, weth9.address)) as Quoter + + return { + token0, + token1, + flash, + factory, + weth9, + nft, + quoter, + router, + } + } + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ factory, token0, token1, flash, nft, quoter } = await loadFixture(flashFixture)) + + await token0.approve(nft.address, MaxUint128) + await token1.approve(nft.address, MaxUint128) + await createPool(token0.address, token1.address, FeeAmount.LOW, encodePriceSqrt(5, 10)) + await createPool(token0.address, token1.address, FeeAmount.MEDIUM, encodePriceSqrt(1, 1)) + await createPool(token0.address, token1.address, FeeAmount.HIGH, encodePriceSqrt(20, 10)) + }) + + describe('flash', () => { + it('test correct transfer events', async () => { + //choose amountIn to test + const amount0In = 1000 + const amount1In = 1000 + + const fee0 = Math.ceil((amount0In * FeeAmount.MEDIUM) / 1000000) + const fee1 = Math.ceil((amount1In * FeeAmount.MEDIUM) / 1000000) + + const flashParams = { + token0: token0.address, + token1: token1.address, + fee1: FeeAmount.MEDIUM, + amount0: amount0In, + amount1: amount1In, + fee2: FeeAmount.LOW, + fee3: FeeAmount.HIGH, + } + // pool1 is the borrow pool + const pool1 = computePoolAddress(factory.address, [token0.address, token1.address], FeeAmount.MEDIUM) + const pool2 = computePoolAddress(factory.address, [token0.address, token1.address], FeeAmount.LOW) + const pool3 = computePoolAddress(factory.address, [token0.address, token1.address], FeeAmount.HIGH) + + const expectedAmountOut0 = await quoter.callStatic.quoteExactInputSingle( + token1.address, + token0.address, + FeeAmount.LOW, + amount1In, + encodePriceSqrt(20, 10) + ) + const expectedAmountOut1 = await quoter.callStatic.quoteExactInputSingle( + token0.address, + token1.address, + FeeAmount.HIGH, + amount0In, + encodePriceSqrt(5, 10) + ) + + await expect(flash.initFlash(flashParams)) + .to.emit(token0, 'Transfer') + .withArgs(pool1, flash.address, amount0In) + .to.emit(token1, 'Transfer') + .withArgs(pool1, flash.address, amount1In) + .to.emit(token0, 'Transfer') + .withArgs(pool2, flash.address, expectedAmountOut0) + .to.emit(token1, 'Transfer') + .withArgs(pool3, flash.address, expectedAmountOut1) + .to.emit(token0, 'Transfer') + .withArgs(flash.address, wallet.address, expectedAmountOut0.toNumber() - amount0In - fee0) + .to.emit(token1, 'Transfer') + .withArgs(flash.address, wallet.address, expectedAmountOut1.toNumber() - amount1In - fee1) + }) + + it('gas', async () => { + const amount0In = 1000 + const amount1In = 1000 + + const flashParams = { + token0: token0.address, + token1: token1.address, + fee1: FeeAmount.MEDIUM, + amount0: amount0In, + amount1: amount1In, + fee2: FeeAmount.LOW, + fee3: FeeAmount.HIGH, + } + await snapshotGasCost(flash.initFlash(flashParams)) + }) + }) +}) diff --git a/lib/v3-periphery/test/Path.spec.ts b/lib/v3-periphery/test/Path.spec.ts new file mode 100644 index 0000000..ba6dc95 --- /dev/null +++ b/lib/v3-periphery/test/Path.spec.ts @@ -0,0 +1,90 @@ +import { waffle, ethers } from 'hardhat' +import { FeeAmount } from './shared/constants' + +import { expect } from './shared/expect' + +import { PathTest } from '../typechain' +import { decodePath, encodePath } from './shared/path' + +import snapshotGasCost from './shared/snapshotGasCost' + +describe('Path', () => { + let path: PathTest + + let tokenAddresses = [ + '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707', + '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9', + '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9', + ] + let fees = [FeeAmount.MEDIUM, FeeAmount.MEDIUM] + + const pathTestFixture = async () => { + const pathTestFactory = await ethers.getContractFactory('PathTest') + return (await pathTestFactory.deploy()) as PathTest + } + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(await (ethers as any).getSigners()) + }) + + beforeEach('deploy PathTest', async () => { + path = await loadFixture(pathTestFixture) + }) + + it('js encoding works as expected', async () => { + let expectedPath = + '0x' + + tokenAddresses + .slice(0, 2) + .map((tokenAddress) => tokenAddress.slice(2).toLowerCase()) + .join('000bb8') + expect(encodePath(tokenAddresses.slice(0, 2), fees.slice(0, 1))).to.eq(expectedPath) + + expectedPath = '0x' + tokenAddresses.map((tokenAddress) => tokenAddress.slice(2).toLowerCase()).join('000bb8') + expect(encodePath(tokenAddresses, fees)).to.eq(expectedPath) + }) + + it('js decoding works as expected', async () => { + const encodedPath = encodePath(tokenAddresses, fees) + const [decodedTokens, decodedFees] = decodePath(encodedPath) + expect(decodedTokens).to.deep.eq(tokenAddresses) + expect(decodedFees).to.deep.eq(fees) + }) + + describe('#hasMultiplePools / #decodeFirstPool / #skipToken / #getFirstPool', () => { + const encodedPath = encodePath(tokenAddresses, fees) + + it('works on first pool', async () => { + expect(await path.hasMultiplePools(encodedPath)).to.be.true + + const firstPool = await path.decodeFirstPool(encodedPath) + expect(firstPool.tokenA).to.be.eq(tokenAddresses[0]) + expect(firstPool.tokenB).to.be.eq(tokenAddresses[1]) + expect(firstPool.fee).to.be.eq(FeeAmount.MEDIUM) + + expect(await path.decodeFirstPool(await path.getFirstPool(encodedPath))).to.deep.eq(firstPool) + }) + + const offset = 20 + 3 + + it('skips 1 item', async () => { + const skipped = await path.skipToken(encodedPath) + expect(skipped).to.be.eq('0x' + encodedPath.slice(2 + offset * 2)) + + expect(await path.hasMultiplePools(skipped)).to.be.false + + const { tokenA, tokenB, fee: decodedFee } = await path.decodeFirstPool(skipped) + expect(tokenA).to.be.eq(tokenAddresses[1]) + expect(tokenB).to.be.eq(tokenAddresses[2]) + expect(decodedFee).to.be.eq(FeeAmount.MEDIUM) + }) + }) + + it('gas cost', async () => { + await snapshotGasCost( + path.getGasCostOfDecodeFirstPool(encodePath([tokenAddresses[0], tokenAddresses[1]], [FeeAmount.MEDIUM])) + ) + }) +}) diff --git a/lib/v3-periphery/test/PeripheryImmutableState.spec.ts b/lib/v3-periphery/test/PeripheryImmutableState.spec.ts new file mode 100644 index 0000000..f077e3a --- /dev/null +++ b/lib/v3-periphery/test/PeripheryImmutableState.spec.ts @@ -0,0 +1,56 @@ +import { Contract } from 'ethers' +import { waffle, ethers } from 'hardhat' + +import { Fixture } from 'ethereum-waffle' +import { PeripheryImmutableStateTest, IWETH9 } from '../typechain' +import { expect } from './shared/expect' +import { v3RouterFixture } from './shared/externalFixtures' + +describe('PeripheryImmutableState', () => { + const nonfungiblePositionManagerFixture: Fixture<{ + weth9: IWETH9 + factory: Contract + state: PeripheryImmutableStateTest + }> = async (wallets, provider) => { + const { weth9, factory } = await v3RouterFixture(wallets, provider) + + const stateFactory = await ethers.getContractFactory('PeripheryImmutableStateTest') + const state = (await stateFactory.deploy(factory.address, weth9.address)) as PeripheryImmutableStateTest + + return { + weth9, + factory, + state, + } + } + + let factory: Contract + let weth9: IWETH9 + let state: PeripheryImmutableStateTest + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(await (ethers as any).getSigners()) + }) + + beforeEach('load fixture', async () => { + ;({ state, weth9, factory } = await loadFixture(nonfungiblePositionManagerFixture)) + }) + + it('bytecode size', async () => { + expect(((await state.provider.getCode(state.address)).length - 2) / 2).to.matchSnapshot() + }) + + describe('#WETH9', () => { + it('points to WETH9', async () => { + expect(await state.WETH9()).to.eq(weth9.address) + }) + }) + + describe('#factory', () => { + it('points to v3 core factory', async () => { + expect(await state.factory()).to.eq(factory.address) + }) + }) +}) diff --git a/lib/v3-periphery/test/PoolAddress.spec.ts b/lib/v3-periphery/test/PoolAddress.spec.ts new file mode 100644 index 0000000..9c83481 --- /dev/null +++ b/lib/v3-periphery/test/PoolAddress.spec.ts @@ -0,0 +1,72 @@ +import { constants } from 'ethers' +import { waffle, ethers } from 'hardhat' + +import { PoolAddressTest } from '../typechain' +import { POOL_BYTECODE_HASH } from './shared/computePoolAddress' +import { expect } from './shared/expect' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('PoolAddress', () => { + let poolAddress: PoolAddressTest + + const poolAddressTestFixture = async () => { + const poolAddressTestFactory = await ethers.getContractFactory('PoolAddressTest') + return (await poolAddressTestFactory.deploy()) as PoolAddressTest + } + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(await (ethers as any).getSigners()) + }) + + beforeEach('deploy PoolAddressTest', async () => { + poolAddress = await loadFixture(poolAddressTestFixture) + }) + + describe('#POOL_INIT_CODE_HASH', () => { + it('equals the hash of the pool bytecode', async () => { + expect(await poolAddress.POOL_INIT_CODE_HASH()).to.eq(POOL_BYTECODE_HASH) + }) + }) + + describe('#computeAddress', () => { + it('all arguments equal zero', async () => { + await expect(poolAddress.computeAddress(constants.AddressZero, constants.AddressZero, constants.AddressZero, 0)) + .to.be.reverted + }) + + it('matches example from core repo', async () => { + expect( + await poolAddress.computeAddress( + '0x5FbDB2315678afecb367f032d93F642f64180aa3', + '0x1000000000000000000000000000000000000000', + '0x2000000000000000000000000000000000000000', + 250 + ) + ).to.matchSnapshot() + }) + + it('token argument order cannot be in reverse', async () => { + await expect( + poolAddress.computeAddress( + '0x5FbDB2315678afecb367f032d93F642f64180aa3', + '0x2000000000000000000000000000000000000000', + '0x1000000000000000000000000000000000000000', + 3000 + ) + ).to.be.reverted + }) + + it('gas cost', async () => { + await snapshotGasCost( + poolAddress.getGasCostOfComputeAddress( + '0x5FbDB2315678afecb367f032d93F642f64180aa3', + '0x1000000000000000000000000000000000000000', + '0x2000000000000000000000000000000000000000', + 3000 + ) + ) + }) + }) +}) diff --git a/lib/v3-periphery/test/PoolTicksCounter.spec.ts b/lib/v3-periphery/test/PoolTicksCounter.spec.ts new file mode 100644 index 0000000..5be0ce0 --- /dev/null +++ b/lib/v3-periphery/test/PoolTicksCounter.spec.ts @@ -0,0 +1,280 @@ +import { waffle, ethers, artifacts } from 'hardhat' + +import { expect } from './shared/expect' + +import { PoolTicksCounterTest } from '../typechain' +import { deployMockContract, Fixture, MockContract } from 'ethereum-waffle' +import { Artifact } from 'hardhat/types' + +describe('PoolTicksCounter', () => { + const TICK_SPACINGS = [200, 60, 10] + + TICK_SPACINGS.forEach((TICK_SPACING) => { + let PoolTicksCounter: PoolTicksCounterTest + let pool: MockContract + let PoolAbi: Artifact + + // Bit index to tick + const bitIdxToTick = (idx: number, page = 0) => { + return idx * TICK_SPACING + page * 256 * TICK_SPACING + } + + before(async () => { + const wallets = await (ethers as any).getSigners() + PoolAbi = await artifacts.readArtifact('IUniswapV3Pool') + const poolTicksHelperFactory = await ethers.getContractFactory('PoolTicksCounterTest') + PoolTicksCounter = (await poolTicksHelperFactory.deploy()) as PoolTicksCounterTest + pool = await deployMockContract(wallets[0], PoolAbi.abi) + await pool.mock.tickSpacing.returns(TICK_SPACING) + }) + + describe(`[Tick Spacing: ${TICK_SPACING}]: tick after is bigger`, async () => { + it('same tick initialized', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) // 1100 + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(2) + ) + expect(result).to.be.eq(1) + }) + + it('same tick not-initialized', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) // 1100 + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(1), + bitIdxToTick(1) + ) + expect(result).to.be.eq(0) + }) + + it('same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) // 1100 + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(0), + bitIdxToTick(255) + ) + expect(result).to.be.eq(2) + }) + + it('multiple pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) // 1100 + await pool.mock.tickBitmap.withArgs(1).returns(0b1101) // 1101 + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(0), + bitIdxToTick(255, 1) + ) + expect(result).to.be.eq(5) + }) + + it('counts all ticks in a page except ending tick', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(ethers.constants.MaxUint256) + await pool.mock.tickBitmap.withArgs(1).returns(0x0) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(0), + bitIdxToTick(255, 1) + ) + expect(result).to.be.eq(255) + }) + + it('counts ticks to left of start and right of end on same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1111000100001111) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(8), + bitIdxToTick(255) + ) + expect(result).to.be.eq(4) + }) + + it('counts ticks to left of start and right of end across on multiple pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1111000100001111) + await pool.mock.tickBitmap.withArgs(1).returns(0b1111000100001111) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(8), + bitIdxToTick(8, 1) + ) + expect(result).to.be.eq(9) + }) + + it('counts ticks when before and after are initialized on same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + const startingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(255) + ) + expect(startingTickInit).to.be.eq(5) + const endingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(0), + bitIdxToTick(3) + ) + expect(endingTickInit).to.be.eq(2) + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(5) + ) + expect(bothInit).to.be.eq(3) + }) + + it('counts ticks when before and after are initialized on multiple page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + await pool.mock.tickBitmap.withArgs(1).returns(0b11111100) + const startingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(255) + ) + expect(startingTickInit).to.be.eq(5) + const endingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(0), + bitIdxToTick(3, 1) + ) + expect(endingTickInit).to.be.eq(8) + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(5, 1) + ) + expect(bothInit).to.be.eq(9) + }) + + it('counts ticks with lots of pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + await pool.mock.tickBitmap.withArgs(1).returns(0b11111111) + await pool.mock.tickBitmap.withArgs(2).returns(0x0) + await pool.mock.tickBitmap.withArgs(3).returns(0x0) + await pool.mock.tickBitmap.withArgs(4).returns(0b11111100) + + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(4), + bitIdxToTick(5, 4) + ) + expect(bothInit).to.be.eq(15) + }) + }) + + describe(`[Tick Spacing: ${TICK_SPACING}]: tick after is smaller`, async () => { + it('same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(255), + bitIdxToTick(0) + ) + expect(result).to.be.eq(2) + }) + + it('multiple pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1100) + await pool.mock.tickBitmap.withArgs(-1).returns(0b1100) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(255), + bitIdxToTick(0, -1) + ) + expect(result).to.be.eq(4) + }) + + it('counts all ticks in a page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(ethers.constants.MaxUint256) + await pool.mock.tickBitmap.withArgs(-1).returns(0x0) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(255), + bitIdxToTick(0, -1) + ) + expect(result).to.be.eq(256) + }) + + it('counts ticks to right of start and left of end on same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1111000100001111) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(15), + bitIdxToTick(2) + ) + expect(result).to.be.eq(6) + }) + + it('counts ticks to right of start and left of end on multiple pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b1111000100001111) + await pool.mock.tickBitmap.withArgs(-1).returns(0b1111000100001111) + const result = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(8), + bitIdxToTick(8, -1) + ) + expect(result).to.be.eq(9) + }) + + it('counts ticks when before and after are initialized on same page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + const startingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(3), + bitIdxToTick(0) + ) + expect(startingTickInit).to.be.eq(2) + const endingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(255), + bitIdxToTick(2) + ) + expect(endingTickInit).to.be.eq(5) + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(5), + bitIdxToTick(2) + ) + expect(bothInit).to.be.eq(3) + }) + + it('counts ticks when before and after are initialized on multiple page', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + await pool.mock.tickBitmap.withArgs(-1).returns(0b11111100) + const startingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(3, -1) + ) + expect(startingTickInit).to.be.eq(5) + const endingTickInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(5), + bitIdxToTick(255, -1) + ) + expect(endingTickInit).to.be.eq(4) + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(2), + bitIdxToTick(5, -1) + ) + expect(bothInit).to.be.eq(3) + }) + + it('counts ticks with lots of pages', async () => { + await pool.mock.tickBitmap.withArgs(0).returns(0b11111100) + await pool.mock.tickBitmap.withArgs(-1).returns(0xff) + await pool.mock.tickBitmap.withArgs(-2).returns(0x0) + await pool.mock.tickBitmap.withArgs(-3).returns(0x0) + await pool.mock.tickBitmap.withArgs(-4).returns(0b11111100) + const bothInit = await PoolTicksCounter.countInitializedTicksCrossed( + pool.address, + bitIdxToTick(3), + bitIdxToTick(6, -4) + ) + expect(bothInit).to.be.eq(11) + }) + }) + }) +}) diff --git a/lib/v3-periphery/test/PositionValue.spec.ts b/lib/v3-periphery/test/PositionValue.spec.ts new file mode 100644 index 0000000..6bb7ef4 --- /dev/null +++ b/lib/v3-periphery/test/PositionValue.spec.ts @@ -0,0 +1,490 @@ +import { waffle, ethers } from 'hardhat' +import { constants, BigNumberish, Contract } from 'ethers' +import { Fixture } from 'ethereum-waffle' +import { + PositionValueTest, + SwapRouter, + MockTimeNonfungiblePositionManager, + IUniswapV3Pool, + TestERC20, + IUniswapV3Factory, +} from '../typechain' +import { FeeAmount, MaxUint128, TICK_SPACINGS } from './shared/constants' +import { getMaxTick, getMinTick } from './shared/ticks' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { encodePath } from './shared/path' +import { computePoolAddress } from './shared/computePoolAddress' +import completeFixture from './shared/completeFixture' +import snapshotGasCost from './shared/snapshotGasCost' + +import { expect } from './shared/expect' + +import { abi as IUniswapV3PoolABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json' + +describe('PositionValue', async () => { + const [...wallets] = waffle.provider.getWallets() + const positionValueCompleteFixture: Fixture<{ + positionValue: PositionValueTest + tokens: [TestERC20, TestERC20, TestERC20] + nft: MockTimeNonfungiblePositionManager + router: SwapRouter + factory: IUniswapV3Factory + }> = async (wallets, provider) => { + const { nft, router, tokens, factory } = await completeFixture(wallets, provider) + const positionValueFactory = await ethers.getContractFactory('PositionValueTest') + const positionValue = (await positionValueFactory.deploy()) as PositionValueTest + + for (const token of tokens) { + await token.approve(nft.address, constants.MaxUint256) + await token.connect(wallets[0]).approve(nft.address, constants.MaxUint256) + await token.transfer(wallets[0].address, expandTo18Decimals(1_000_000)) + } + + return { + positionValue, + tokens, + nft, + router, + factory, + } + } + + let pool: Contract + let tokens: [TestERC20, TestERC20, TestERC20] + let positionValue: PositionValueTest + let nft: MockTimeNonfungiblePositionManager + let router: SwapRouter + let factory: IUniswapV3Factory + + let amountDesired: BigNumberish + + let loadFixture: ReturnType + before('create fixture loader', async () => { + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach(async () => { + ;({ positionValue, tokens, nft, router, factory } = await loadFixture(positionValueCompleteFixture)) + await nft.createAndInitializePoolIfNecessary( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + const poolAddress = computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM) + pool = new ethers.Contract(poolAddress, IUniswapV3PoolABI, wallets[0]) + }) + + describe('#total', () => { + let tokenId: number + let sqrtRatioX96: BigNumberish + + beforeEach(async () => { + amountDesired = expandTo18Decimals(100_000) + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const swapAmount = expandTo18Decimals(1_000) + await tokens[0].approve(router.address, swapAmount) + await tokens[1].approve(router.address, swapAmount) + + // accmuluate token0 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + + // accmuluate token1 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + + sqrtRatioX96 = (await pool.slot0()).sqrtPriceX96 + }) + + it('returns the correct amount', async () => { + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + const fees = await positionValue.fees(nft.address, 1) + const total = await positionValue.total(nft.address, 1, sqrtRatioX96) + + expect(total[0]).to.equal(principal[0].add(fees[0])) + expect(total[1]).to.equal(principal[1].add(fees[1])) + }) + + it('gas', async () => { + await snapshotGasCost(positionValue.totalGas(nft.address, 1, sqrtRatioX96)) + }) + }) + + describe('#principal', () => { + let sqrtRatioX96: BigNumberish + + beforeEach(async () => { + amountDesired = expandTo18Decimals(100_000) + sqrtRatioX96 = (await pool.slot0()).sqrtPriceX96 + }) + + it('returns the correct values when price is in the middle of the range', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + expect(principal.amount0).to.equal('99999999999999999999999') + expect(principal.amount1).to.equal('99999999999999999999999') + }) + + it('returns the correct values when range is below current price', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: -60, + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + expect(principal.amount0).to.equal('0') + expect(principal.amount1).to.equal('99999999999999999999999') + }) + + it('returns the correct values when range is below current price', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: 60, + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + expect(principal.amount0).to.equal('99999999999999999999999') + expect(principal.amount1).to.equal('0') + }) + + it('returns the correct values when range is skewed above price', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: -6_000, + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + expect(principal.amount0).to.equal('99999999999999999999999') + expect(principal.amount1).to.equal('25917066770240321655335') + }) + + it('returns the correct values when range is skewed below price', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: 6_000, + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const principal = await positionValue.principal(nft.address, 1, sqrtRatioX96) + expect(principal.amount0).to.equal('25917066770240321655335') + expect(principal.amount1).to.equal('99999999999999999999999') + }) + + it('gas', async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await snapshotGasCost(positionValue.principalGas(nft.address, 1, sqrtRatioX96)) + }) + }) + + describe('#fees', () => { + let tokenId: number + + beforeEach(async () => { + amountDesired = expandTo18Decimals(100_000) + tokenId = 2 + + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + }) + + describe('when price is within the position range', () => { + beforeEach(async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: TICK_SPACINGS[FeeAmount.MEDIUM] * -1_000, + tickUpper: TICK_SPACINGS[FeeAmount.MEDIUM] * 1_000, + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: amountDesired, + amount1Desired: amountDesired, + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + const swapAmount = expandTo18Decimals(1_000) + await tokens[0].approve(router.address, swapAmount) + await tokens[1].approve(router.address, swapAmount) + + // accmuluate token0 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + + // accmuluate token1 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + }) + + it('return the correct amount of fees', async () => { + const feesFromCollect = await nft.callStatic.collect({ + tokenId, + recipient: wallets[0].address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + const feeAmounts = await positionValue.fees(nft.address, tokenId) + + expect(feeAmounts[0]).to.equal(feesFromCollect[0]) + expect(feeAmounts[1]).to.equal(feesFromCollect[1]) + }) + + it('returns the correct amount of fees if tokensOwed fields are greater than 0', async () => { + await nft.increaseLiquidity({ + tokenId: tokenId, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + }) + + const swapAmount = expandTo18Decimals(1_000) + await tokens[0].approve(router.address, swapAmount) + + // accmuluate more token0 fees after clearing initial amount + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: swapAmount, + amountOutMinimum: 0, + }) + + const feesFromCollect = await nft.callStatic.collect({ + tokenId, + recipient: wallets[0].address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + const feeAmounts = await positionValue.fees(nft.address, tokenId) + expect(feeAmounts[0]).to.equal(feesFromCollect[0]) + expect(feeAmounts[1]).to.equal(feesFromCollect[1]) + }) + + it('gas', async () => { + await snapshotGasCost(positionValue.feesGas(nft.address, tokenId)) + }) + }) + + describe('when price is below the position range', async () => { + beforeEach(async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: TICK_SPACINGS[FeeAmount.MEDIUM] * -10, + tickUpper: TICK_SPACINGS[FeeAmount.MEDIUM] * 10, + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: expandTo18Decimals(10_000), + amount1Desired: expandTo18Decimals(10_000), + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await tokens[0].approve(router.address, constants.MaxUint256) + await tokens[1].approve(router.address, constants.MaxUint256) + + // accumulate token1 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + amountIn: expandTo18Decimals(1_000), + amountOutMinimum: 0, + }) + + // accumulate token0 fees and push price below tickLower + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: expandTo18Decimals(50_000), + amountOutMinimum: 0, + }) + }) + + it('returns the correct amount of fees', async () => { + const feesFromCollect = await nft.callStatic.collect({ + tokenId, + recipient: wallets[0].address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + + const feeAmounts = await positionValue.fees(nft.address, tokenId) + expect(feeAmounts[0]).to.equal(feesFromCollect[0]) + expect(feeAmounts[1]).to.equal(feesFromCollect[1]) + }) + + it('gas', async () => { + await snapshotGasCost(positionValue.feesGas(nft.address, tokenId)) + }) + }) + + describe('when price is above the position range', async () => { + beforeEach(async () => { + await nft.mint({ + token0: tokens[0].address, + token1: tokens[1].address, + tickLower: TICK_SPACINGS[FeeAmount.MEDIUM] * -10, + tickUpper: TICK_SPACINGS[FeeAmount.MEDIUM] * 10, + fee: FeeAmount.MEDIUM, + recipient: wallets[0].address, + amount0Desired: expandTo18Decimals(10_000), + amount1Desired: expandTo18Decimals(10_000), + amount0Min: 0, + amount1Min: 0, + deadline: 10, + }) + + await tokens[0].approve(router.address, constants.MaxUint256) + await tokens[1].approve(router.address, constants.MaxUint256) + + // accumulate token0 fees + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + amountIn: expandTo18Decimals(1_000), + amountOutMinimum: 0, + }) + + // accumulate token1 fees and push price above tickUpper + await router.exactInput({ + recipient: wallets[0].address, + deadline: 1, + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + amountIn: expandTo18Decimals(50_000), + amountOutMinimum: 0, + }) + }) + + it('returns the correct amount of fees', async () => { + const feesFromCollect = await nft.callStatic.collect({ + tokenId, + recipient: wallets[0].address, + amount0Max: MaxUint128, + amount1Max: MaxUint128, + }) + const feeAmounts = await positionValue.fees(nft.address, tokenId) + expect(feeAmounts[0]).to.equal(feesFromCollect[0]) + expect(feeAmounts[1]).to.equal(feesFromCollect[1]) + }) + + it('gas', async () => { + await snapshotGasCost(positionValue.feesGas(nft.address, tokenId)) + }) + }) + }) +}) diff --git a/lib/v3-periphery/test/Quoter.spec.ts b/lib/v3-periphery/test/Quoter.spec.ts new file mode 100644 index 0000000..6236a1f --- /dev/null +++ b/lib/v3-periphery/test/Quoter.spec.ts @@ -0,0 +1,201 @@ +import { Fixture } from 'ethereum-waffle' +import { constants, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { MockTimeNonfungiblePositionManager, Quoter, TestERC20 } from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, MaxUint128, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { expect } from './shared/expect' +import { encodePath } from './shared/path' +import { createPool } from './shared/quoter' + +describe('Quoter', () => { + let wallet: Wallet + let trader: Wallet + + const swapRouterFixture: Fixture<{ + nft: MockTimeNonfungiblePositionManager + tokens: [TestERC20, TestERC20, TestERC20] + quoter: Quoter + }> = async (wallets, provider) => { + const { weth9, factory, router, tokens, nft } = await completeFixture(wallets, provider) + + // approve & fund wallets + for (const token of tokens) { + await token.approve(router.address, constants.MaxUint256) + await token.approve(nft.address, constants.MaxUint256) + await token.connect(trader).approve(router.address, constants.MaxUint256) + await token.transfer(trader.address, expandTo18Decimals(1_000_000)) + } + + const quoterFactory = await ethers.getContractFactory('Quoter') + quoter = (await quoterFactory.deploy(factory.address, weth9.address)) as Quoter + + return { + tokens, + nft, + quoter, + } + } + + let nft: MockTimeNonfungiblePositionManager + let tokens: [TestERC20, TestERC20, TestERC20] + let quoter: Quoter + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + const wallets = await (ethers as any).getSigners() + ;[wallet, trader] = wallets + loadFixture = waffle.createFixtureLoader(wallets) + }) + + // helper for getting weth and token balances + beforeEach('load fixture', async () => { + ;({ tokens, nft, quoter } = await loadFixture(swapRouterFixture)) + }) + + describe('quotes', () => { + beforeEach(async () => { + await createPool(nft, wallet, tokens[0].address, tokens[1].address) + await createPool(nft, wallet, tokens[1].address, tokens[2].address) + }) + + describe('#quoteExactInput', () => { + it('0 -> 1', async () => { + const quote = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + 3 + ) + + expect(quote).to.eq(1) + }) + + it('1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactInput( + encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + 3 + ) + + expect(quote).to.eq(1) + }) + + it('0 -> 1 -> 2', async () => { + const quote = await quoter.callStatic.quoteExactInput( + encodePath( + tokens.map((token) => token.address), + [FeeAmount.MEDIUM, FeeAmount.MEDIUM] + ), + 5 + ) + + expect(quote).to.eq(1) + }) + + it('2 -> 1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactInput( + encodePath(tokens.map((token) => token.address).reverse(), [FeeAmount.MEDIUM, FeeAmount.MEDIUM]), + 5 + ) + + expect(quote).to.eq(1) + }) + }) + + describe('#quoteExactInputSingle', () => { + it('0 -> 1', async () => { + const quote = await quoter.callStatic.quoteExactInputSingle( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + MaxUint128, + // -2% + encodePriceSqrt(100, 102) + ) + + expect(quote).to.eq(9852) + }) + + it('1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactInputSingle( + tokens[1].address, + tokens[0].address, + FeeAmount.MEDIUM, + MaxUint128, + // +2% + encodePriceSqrt(102, 100) + ) + + expect(quote).to.eq(9852) + }) + }) + + describe('#quoteExactOutput', () => { + it('0 -> 1', async () => { + const quote = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + 1 + ) + + expect(quote).to.eq(3) + }) + + it('1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + 1 + ) + + expect(quote).to.eq(3) + }) + + it('0 -> 1 -> 2', async () => { + const quote = await quoter.callStatic.quoteExactOutput( + encodePath(tokens.map((token) => token.address).reverse(), [FeeAmount.MEDIUM, FeeAmount.MEDIUM]), + 1 + ) + + expect(quote).to.eq(5) + }) + + it('2 -> 1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactOutput( + encodePath( + tokens.map((token) => token.address), + [FeeAmount.MEDIUM, FeeAmount.MEDIUM] + ), + 1 + ) + + expect(quote).to.eq(5) + }) + }) + + describe('#quoteExactOutputSingle', () => { + it('0 -> 1', async () => { + const quote = await quoter.callStatic.quoteExactOutputSingle( + tokens[0].address, + tokens[1].address, + FeeAmount.MEDIUM, + MaxUint128, + encodePriceSqrt(100, 102) + ) + + expect(quote).to.eq(9981) + }) + + it('1 -> 0', async () => { + const quote = await quoter.callStatic.quoteExactOutputSingle( + tokens[1].address, + tokens[0].address, + FeeAmount.MEDIUM, + MaxUint128, + encodePriceSqrt(102, 100) + ) + + expect(quote).to.eq(9981) + }) + }) + }) +}) diff --git a/lib/v3-periphery/test/QuoterV2.spec.ts b/lib/v3-periphery/test/QuoterV2.spec.ts new file mode 100644 index 0000000..8d1b567 --- /dev/null +++ b/lib/v3-periphery/test/QuoterV2.spec.ts @@ -0,0 +1,578 @@ +import { Fixture } from 'ethereum-waffle' +import { constants, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { MockTimeNonfungiblePositionManager, QuoterV2, TestERC20 } from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, MaxUint128 } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { expect } from './shared/expect' +import { encodePath } from './shared/path' +import { createPool, createPoolWithMultiplePositions, createPoolWithZeroTickInitialized } from './shared/quoter' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('QuoterV2', function () { + this.timeout(40000) + let wallet: Wallet + let trader: Wallet + + const swapRouterFixture: Fixture<{ + nft: MockTimeNonfungiblePositionManager + tokens: [TestERC20, TestERC20, TestERC20] + quoter: QuoterV2 + }> = async (wallets, provider) => { + const { weth9, factory, router, tokens, nft } = await completeFixture(wallets, provider) + + // approve & fund wallets + for (const token of tokens) { + await token.approve(router.address, constants.MaxUint256) + await token.approve(nft.address, constants.MaxUint256) + await token.connect(trader).approve(router.address, constants.MaxUint256) + await token.transfer(trader.address, expandTo18Decimals(1_000_000)) + } + + const quoterFactory = await ethers.getContractFactory('QuoterV2') + quoter = (await quoterFactory.deploy(factory.address, weth9.address)) as QuoterV2 + + return { + tokens, + nft, + quoter, + } + } + + let nft: MockTimeNonfungiblePositionManager + let tokens: [TestERC20, TestERC20, TestERC20] + let quoter: QuoterV2 + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + const wallets = await (ethers as any).getSigners() + ;[wallet, trader] = wallets + loadFixture = waffle.createFixtureLoader(wallets) + }) + + // helper for getting weth and token balances + beforeEach('load fixture', async () => { + ;({ tokens, nft, quoter } = await loadFixture(swapRouterFixture)) + }) + + describe('quotes', () => { + beforeEach(async () => { + await createPool(nft, wallet, tokens[0].address, tokens[1].address) + await createPool(nft, wallet, tokens[1].address, tokens[2].address) + await createPoolWithMultiplePositions(nft, wallet, tokens[0].address, tokens[2].address) + }) + + describe('#quoteExactInput', () => { + it('0 -> 2 cross 2 tick', async () => { + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 10000 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78461846509168490764501028180') + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(amountOut).to.eq(9871) + }) + + it('0 -> 2 cross 2 tick where after is initialized', async () => { + // The swap amount is set such that the active tick after the swap is -120. + // -120 is an initialized tick for this pool. We check that we don't count it. + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 6200 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78757224507315167622282810783') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(amountOut).to.eq(6143) + }) + + it('0 -> 2 cross 1 tick', async () => { + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 4000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78926452400586371254602774705') + expect(amountOut).to.eq(3971) + }) + + it('0 -> 2 cross 0 tick, starting tick not initialized', async () => { + // Tick before 0, tick after -1. + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 10 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79227483487511329217250071027') + expect(amountOut).to.eq(8) + }) + + it('0 -> 2 cross 0 tick, starting tick initialized', async () => { + // Tick before 0, tick after -1. Tick 0 initialized. + await createPoolWithZeroTickInitialized(nft, wallet, tokens[0].address, tokens[2].address) + + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 10 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79227817515327498931091950511') + expect(amountOut).to.eq(8) + }) + + it('2 -> 0 cross 2', async () => { + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 10000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('80001962924147897865541384515') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountOut).to.eq(9871) + }) + + it('2 -> 0 cross 2 where tick after is initialized', async () => { + // The swap amount is set such that the active tick after the swap is 120. + // 120 is an initialized tick for this pool. We check we don't count it. + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 6250 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79705728824507063507279123685') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountOut).to.eq(6190) + }) + + it('2 -> 0 cross 0 tick, starting tick initialized', async () => { + // Tick 0 initialized. Tick after = 1 + await createPoolWithZeroTickInitialized(nft, wallet, tokens[0].address, tokens[2].address) + + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 200 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79235729830182478001034429156') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountOut).to.eq(198) + }) + + it('2 -> 0 cross 0 tick, starting tick not initialized', async () => { + // Tick 0 initialized. Tick after = 1 + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 103 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79235858216754624215638319723') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountOut).to.eq(101) + }) + + it('2 -> 1', async () => { + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[2].address, tokens[1].address], [FeeAmount.MEDIUM]), + 10000 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('80018067294531553039351583520') + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(amountOut).to.eq(9871) + }) + + it('0 -> 2 -> 1', async () => { + const { + amountOut, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactInput( + encodePath([tokens[0].address, tokens[2].address, tokens[1].address], [FeeAmount.MEDIUM, FeeAmount.MEDIUM]), + 10000 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(2) + expect(sqrtPriceX96AfterList[0]).to.eq('78461846509168490764501028180') + expect(sqrtPriceX96AfterList[1]).to.eq('80007846861567212939802016351') + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(initializedTicksCrossedList[1]).to.eq(0) + expect(amountOut).to.eq(9745) + }) + }) + + describe('#quoteExactInputSingle', () => { + it('0 -> 2', async () => { + const { + amountOut: quote, + sqrtPriceX96After, + initializedTicksCrossed, + gasEstimate, + } = await quoter.callStatic.quoteExactInputSingle({ + tokenIn: tokens[0].address, + tokenOut: tokens[2].address, + fee: FeeAmount.MEDIUM, + amountIn: 10000, + // -2% + sqrtPriceLimitX96: encodePriceSqrt(100, 102), + }) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossed).to.eq(2) + expect(quote).to.eq(9871) + expect(sqrtPriceX96After).to.eq('78461846509168490764501028180') + }) + + it('2 -> 0', async () => { + const { + amountOut: quote, + sqrtPriceX96After, + initializedTicksCrossed, + gasEstimate, + } = await quoter.callStatic.quoteExactInputSingle({ + tokenIn: tokens[2].address, + tokenOut: tokens[0].address, + fee: FeeAmount.MEDIUM, + amountIn: 10000, + // +2% + sqrtPriceLimitX96: encodePriceSqrt(102, 100), + }) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossed).to.eq(2) + expect(quote).to.eq(9871) + expect(sqrtPriceX96After).to.eq('80001962924147897865541384515') + }) + }) + + describe('#quoteExactOutput', () => { + it('0 -> 2 cross 2 tick', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 15000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(amountIn).to.eq(15273) + + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78055527257643669242286029831') + }) + + it('0 -> 2 cross 2 where tick after is initialized', async () => { + // The swap amount is set such that the active tick after the swap is -120. + // -120 is an initialized tick for this pool. We check that we count it. + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 6143 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78757225449310403327341205211') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(amountIn).to.eq(6200) + }) + + it('0 -> 2 cross 1 tick', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 4000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(amountIn).to.eq(4029) + + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('78924219757724709840818372098') + }) + + it('0 -> 2 cross 0 tick starting tick initialized', async () => { + // Tick before 0, tick after 1. Tick 0 initialized. + await createPoolWithZeroTickInitialized(nft, wallet, tokens[0].address, tokens[2].address) + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 100 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(amountIn).to.eq(102) + + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79224329176051641448521403903') + }) + + it('0 -> 2 cross 0 tick starting tick not initialized', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[2].address, tokens[0].address], [FeeAmount.MEDIUM]), + 10 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(amountIn).to.eq(12) + + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79227408033628034983534698435') + }) + + it('2 -> 0 cross 2 ticks', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 15000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList.length).to.eq(1) + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(amountIn).to.eq(15273) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('80418414376567919517220409857') + }) + + it('2 -> 0 cross 2 where tick after is initialized', async () => { + // The swap amount is set such that the active tick after the swap is 120. + // 120 is an initialized tick for this pool. We check that we don't count it. + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 6223 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(2) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79708304437530892332449657932') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountIn).to.eq(6283) + }) + + it('2 -> 0 cross 1 tick', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[0].address, tokens[2].address], [FeeAmount.MEDIUM]), + 6000 + ) + + await snapshotGasCost(gasEstimate) + expect(initializedTicksCrossedList[0]).to.eq(1) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('79690640184021170956740081887') + expect(initializedTicksCrossedList.length).to.eq(1) + expect(amountIn).to.eq(6055) + }) + + it('2 -> 1', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[1].address, tokens[2].address], [FeeAmount.MEDIUM]), + 9871 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(1) + expect(sqrtPriceX96AfterList[0]).to.eq('80018020393569259756601362385') + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(amountIn).to.eq(10000) + }) + + it('0 -> 2 -> 1', async () => { + const { + amountIn, + sqrtPriceX96AfterList, + initializedTicksCrossedList, + gasEstimate, + } = await quoter.callStatic.quoteExactOutput( + encodePath([tokens[0].address, tokens[2].address, tokens[1].address].reverse(), [ + FeeAmount.MEDIUM, + FeeAmount.MEDIUM, + ]), + 9745 + ) + + await snapshotGasCost(gasEstimate) + expect(sqrtPriceX96AfterList.length).to.eq(2) + expect(sqrtPriceX96AfterList[0]).to.eq('80007838904387594703933785072') + expect(sqrtPriceX96AfterList[1]).to.eq('78461888503179331029803316753') + expect(initializedTicksCrossedList[0]).to.eq(0) + expect(initializedTicksCrossedList[1]).to.eq(2) + expect(amountIn).to.eq(10000) + }) + }) + + describe('#quoteExactOutputSingle', () => { + it('0 -> 1', async () => { + const { + amountIn, + sqrtPriceX96After, + initializedTicksCrossed, + gasEstimate, + } = await quoter.callStatic.quoteExactOutputSingle({ + tokenIn: tokens[0].address, + tokenOut: tokens[1].address, + fee: FeeAmount.MEDIUM, + amount: MaxUint128, + sqrtPriceLimitX96: encodePriceSqrt(100, 102), + }) + + await snapshotGasCost(gasEstimate) + expect(amountIn).to.eq(9981) + expect(initializedTicksCrossed).to.eq(0) + expect(sqrtPriceX96After).to.eq('78447570448055484695608110440') + }) + + it('1 -> 0', async () => { + const { + amountIn, + sqrtPriceX96After, + initializedTicksCrossed, + gasEstimate, + } = await quoter.callStatic.quoteExactOutputSingle({ + tokenIn: tokens[1].address, + tokenOut: tokens[0].address, + fee: FeeAmount.MEDIUM, + amount: MaxUint128, + sqrtPriceLimitX96: encodePriceSqrt(102, 100), + }) + + await snapshotGasCost(gasEstimate) + expect(amountIn).to.eq(9981) + expect(initializedTicksCrossed).to.eq(0) + expect(sqrtPriceX96After).to.eq('80016521857016594389520272648') + }) + }) + }) +}) diff --git a/lib/v3-periphery/test/SelfPermit.spec.ts b/lib/v3-periphery/test/SelfPermit.spec.ts new file mode 100644 index 0000000..a76c505 --- /dev/null +++ b/lib/v3-periphery/test/SelfPermit.spec.ts @@ -0,0 +1,198 @@ +import { constants, Wallet } from 'ethers' +import { waffle, ethers } from 'hardhat' + +import { Fixture } from 'ethereum-waffle' +import { SelfPermitTest, TestERC20PermitAllowed } from '../typechain' +import { expect } from 'chai' +import { getPermitSignature } from './shared/permit' + +describe('SelfPermit', () => { + let wallet: Wallet + let other: Wallet + + const fixture: Fixture<{ + token: TestERC20PermitAllowed + selfPermitTest: SelfPermitTest + }> = async (wallets, provider) => { + const tokenFactory = await ethers.getContractFactory('TestERC20PermitAllowed') + const token = (await tokenFactory.deploy(0)) as TestERC20PermitAllowed + + const selfPermitTestFactory = await ethers.getContractFactory('SelfPermitTest') + const selfPermitTest = (await selfPermitTestFactory.deploy()) as SelfPermitTest + + return { + token, + selfPermitTest, + } + } + + let token: TestERC20PermitAllowed + let selfPermitTest: SelfPermitTest + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + const wallets = await (ethers as any).getSigners() + ;[wallet, other] = wallets + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ token, selfPermitTest } = await loadFixture(fixture)) + }) + + it('#permit', async () => { + const value = 123 + + const { v, r, s } = await getPermitSignature(wallet, token, other.address, value) + + expect(await token.allowance(wallet.address, other.address)).to.be.eq(0) + await token['permit(address,address,uint256,uint256,uint8,bytes32,bytes32)']( + wallet.address, + other.address, + value, + constants.MaxUint256, + v, + r, + s + ) + expect(await token.allowance(wallet.address, other.address)).to.be.eq(value) + }) + + describe('#selfPermit', () => { + const value = 456 + + it('works', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, value) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await selfPermitTest.selfPermit(token.address, value, constants.MaxUint256, v, r, s) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(value) + }) + + it('fails if permit is submitted externally', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, value) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await token['permit(address,address,uint256,uint256,uint8,bytes32,bytes32)']( + wallet.address, + selfPermitTest.address, + value, + constants.MaxUint256, + v, + r, + s + ) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(value) + + await expect(selfPermitTest.selfPermit(token.address, value, constants.MaxUint256, v, r, s)).to.be.revertedWith( + 'ERC20Permit: invalid signature' + ) + }) + }) + + describe('#selfPermitIfNecessary', () => { + const value = 789 + + it('works', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, value) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await selfPermitTest.selfPermitIfNecessary(token.address, value, constants.MaxUint256, v, r, s) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(value) + }) + + it('does not fail if permit is submitted externally', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, value) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await token['permit(address,address,uint256,uint256,uint8,bytes32,bytes32)']( + wallet.address, + selfPermitTest.address, + value, + constants.MaxUint256, + v, + r, + s + ) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(value) + + await selfPermitTest.selfPermitIfNecessary(token.address, value, constants.MaxUint256, v, r, s) + }) + }) + + describe('#selfPermitAllowed', () => { + it('works', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, constants.MaxUint256) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await expect(selfPermitTest.selfPermitAllowed(token.address, 0, constants.MaxUint256, v, r, s)) + .to.emit(token, 'Approval') + .withArgs(wallet.address, selfPermitTest.address, constants.MaxUint256) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(constants.MaxUint256) + }) + + it('fails if permit is submitted externally', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, constants.MaxUint256) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await token['permit(address,address,uint256,uint256,bool,uint8,bytes32,bytes32)']( + wallet.address, + selfPermitTest.address, + 0, + constants.MaxUint256, + true, + v, + r, + s + ) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(constants.MaxUint256) + + await expect( + selfPermitTest.selfPermitAllowed(token.address, 0, constants.MaxUint256, v, r, s) + ).to.be.revertedWith('TestERC20PermitAllowed::permit: wrong nonce') + }) + }) + + describe('#selfPermitAllowedIfNecessary', () => { + it('works', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, constants.MaxUint256) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.eq(0) + await expect(selfPermitTest.selfPermitAllowedIfNecessary(token.address, 0, constants.MaxUint256, v, r, s)) + .to.emit(token, 'Approval') + .withArgs(wallet.address, selfPermitTest.address, constants.MaxUint256) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.eq(constants.MaxUint256) + }) + + it('skips if already max approved', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, constants.MaxUint256) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await token.approve(selfPermitTest.address, constants.MaxUint256) + await expect( + selfPermitTest.selfPermitAllowedIfNecessary(token.address, 0, constants.MaxUint256, v, r, s) + ).to.not.emit(token, 'Approval') + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.eq(constants.MaxUint256) + }) + + it('does not fail if permit is submitted externally', async () => { + const { v, r, s } = await getPermitSignature(wallet, token, selfPermitTest.address, constants.MaxUint256) + + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(0) + await token['permit(address,address,uint256,uint256,bool,uint8,bytes32,bytes32)']( + wallet.address, + selfPermitTest.address, + 0, + constants.MaxUint256, + true, + v, + r, + s + ) + expect(await token.allowance(wallet.address, selfPermitTest.address)).to.be.eq(constants.MaxUint256) + + await selfPermitTest.selfPermitAllowedIfNecessary(token.address, 0, constants.MaxUint256, v, r, s) + }) + }) +}) diff --git a/lib/v3-periphery/test/SwapRouter.gas.spec.ts b/lib/v3-periphery/test/SwapRouter.gas.spec.ts new file mode 100644 index 0000000..fb4a0d0 --- /dev/null +++ b/lib/v3-periphery/test/SwapRouter.gas.spec.ts @@ -0,0 +1,453 @@ +import { abi as IUniswapV3PoolABI } from '@uniswap/v3-core/artifacts/contracts/interfaces/IUniswapV3Pool.sol/IUniswapV3Pool.json' +import { Fixture } from 'ethereum-waffle' +import { BigNumber, constants, ContractTransaction, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { IUniswapV3Pool, IWETH9, MockTimeSwapRouter, TestERC20 } from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { expect } from './shared/expect' +import { encodePath } from './shared/path' +import snapshotGasCost from './shared/snapshotGasCost' +import { getMaxTick, getMinTick } from './shared/ticks' + +describe('SwapRouter gas tests', function () { + this.timeout(40000) + let wallet: Wallet + let trader: Wallet + + const swapRouterFixture: Fixture<{ + weth9: IWETH9 + router: MockTimeSwapRouter + tokens: [TestERC20, TestERC20, TestERC20] + pools: [IUniswapV3Pool, IUniswapV3Pool, IUniswapV3Pool] + }> = async (wallets, provider) => { + const { weth9, factory, router, tokens, nft } = await completeFixture(wallets, provider) + + // approve & fund wallets + for (const token of tokens) { + await token.approve(router.address, constants.MaxUint256) + await token.approve(nft.address, constants.MaxUint256) + await token.connect(trader).approve(router.address, constants.MaxUint256) + await token.transfer(trader.address, expandTo18Decimals(1_000_000)) + } + + const liquidity = 1000000 + async function createPool(tokenAddressA: string, tokenAddressB: string) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary( + tokenAddressA, + tokenAddressB, + FeeAmount.MEDIUM, + encodePriceSqrt(100005, 100000) // we don't want to cross any ticks + ) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams) + } + + async function createPoolWETH9(tokenAddress: string) { + await weth9.deposit({ value: liquidity * 2 }) + await weth9.approve(nft.address, constants.MaxUint256) + return createPool(weth9.address, tokenAddress) + } + + // create pools + await createPool(tokens[0].address, tokens[1].address) + await createPool(tokens[1].address, tokens[2].address) + await createPoolWETH9(tokens[0].address) + + const poolAddresses = await Promise.all([ + factory.getPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM), + factory.getPool(tokens[1].address, tokens[2].address, FeeAmount.MEDIUM), + factory.getPool(weth9.address, tokens[0].address, FeeAmount.MEDIUM), + ]) + + const pools = poolAddresses.map((poolAddress) => new ethers.Contract(poolAddress, IUniswapV3PoolABI, wallet)) as [ + IUniswapV3Pool, + IUniswapV3Pool, + IUniswapV3Pool + ] + + return { + weth9, + router, + tokens, + pools, + } + } + + let weth9: IWETH9 + let router: MockTimeSwapRouter + let tokens: [TestERC20, TestERC20, TestERC20] + let pools: [IUniswapV3Pool, IUniswapV3Pool, IUniswapV3Pool] + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + const wallets = await (ethers as any).getSigners() + ;[wallet, trader] = wallets + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ router, weth9, tokens, pools } = await loadFixture(swapRouterFixture)) + }) + + async function exactInput( + tokens: string[], + amountIn: number = 2, + amountOutMinimum: number = 1 + ): Promise { + const inputIsWETH = weth9.address === tokens[0] + const outputIsWETH9 = tokens[tokens.length - 1] === weth9.address + + const value = inputIsWETH ? amountIn : 0 + + const params = { + path: encodePath(tokens, new Array(tokens.length - 1).fill(FeeAmount.MEDIUM)), + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountIn, + amountOutMinimum: outputIsWETH9 ? 0 : amountOutMinimum, // save on calldata, + } + + const data = [router.interface.encodeFunctionData('exactInput', [params])] + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOutMinimum, trader.address])) + + // optimized for the gas test + return data.length === 1 + ? router.connect(trader).exactInput(params, { value }) + : router.connect(trader).multicall(data, { value }) + } + + async function exactInputSingle( + tokenIn: string, + tokenOut: string, + amountIn: number = 3, + amountOutMinimum: number = 1, + sqrtPriceLimitX96?: BigNumber + ): Promise { + const inputIsWETH = weth9.address === tokenIn + const outputIsWETH9 = tokenOut === weth9.address + + const value = inputIsWETH ? amountIn : 0 + + const params = { + tokenIn, + tokenOut, + fee: FeeAmount.MEDIUM, + sqrtPriceLimitX96: sqrtPriceLimitX96 ?? 0, + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountIn, + amountOutMinimum: outputIsWETH9 ? 0 : amountOutMinimum, // save on calldata + } + + const data = [router.interface.encodeFunctionData('exactInputSingle', [params])] + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOutMinimum, trader.address])) + + // optimized for the gas test + return data.length === 1 + ? router.connect(trader).exactInputSingle(params, { value }) + : router.connect(trader).multicall(data, { value }) + } + + async function exactOutput(tokens: string[]): Promise { + const amountInMaximum = 10 // we don't care + const amountOut = 1 + + const inputIsWETH9 = tokens[0] === weth9.address + const outputIsWETH9 = tokens[tokens.length - 1] === weth9.address + + const value = inputIsWETH9 ? amountInMaximum : 0 + + const params = { + path: encodePath(tokens.slice().reverse(), new Array(tokens.length - 1).fill(FeeAmount.MEDIUM)), + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountOut, + amountInMaximum, + } + + const data = [router.interface.encodeFunctionData('exactOutput', [params])] + if (inputIsWETH9) data.push(router.interface.encodeFunctionData('refundETH')) + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOut, trader.address])) + + return router.connect(trader).multicall(data, { value }) + } + + async function exactOutputSingle( + tokenIn: string, + tokenOut: string, + amountOut: number = 1, + amountInMaximum: number = 3, + sqrtPriceLimitX96?: BigNumber + ): Promise { + const inputIsWETH9 = tokenIn === weth9.address + const outputIsWETH9 = tokenOut === weth9.address + + const value = inputIsWETH9 ? amountInMaximum : 0 + + const params = { + tokenIn, + tokenOut, + fee: FeeAmount.MEDIUM, + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountOut, + amountInMaximum, + sqrtPriceLimitX96: sqrtPriceLimitX96 ?? 0, + } + + const data = [router.interface.encodeFunctionData('exactOutputSingle', [params])] + if (inputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [0, trader.address])) + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOut, trader.address])) + + return router.connect(trader).multicall(data, { value }) + } + + // TODO should really throw this in the fixture + beforeEach('intialize feeGrowthGlobals', async () => { + await exactInput([tokens[0].address, tokens[1].address], 1, 0) + await exactInput([tokens[1].address, tokens[0].address], 1, 0) + await exactInput([tokens[1].address, tokens[2].address], 1, 0) + await exactInput([tokens[2].address, tokens[1].address], 1, 0) + await exactInput([tokens[0].address, weth9.address], 1, 0) + await exactInput([weth9.address, tokens[0].address], 1, 0) + }) + + beforeEach('ensure feeGrowthGlobals are >0', async () => { + const slots = await Promise.all( + pools.map((pool) => + Promise.all([ + pool.feeGrowthGlobal0X128().then((f) => f.toString()), + pool.feeGrowthGlobal1X128().then((f) => f.toString()), + ]) + ) + ) + + expect(slots).to.deep.eq([ + ['340290874192793283295456993856614', '340290874192793283295456993856614'], + ['340290874192793283295456993856614', '340290874192793283295456993856614'], + ['340290874192793283295456993856614', '340290874192793283295456993856614'], + ]) + }) + + beforeEach('ensure ticks are 0 before', async () => { + const slots = await Promise.all(pools.map((pool) => pool.slot0().then(({ tick }) => tick))) + expect(slots).to.deep.eq([0, 0, 0]) + }) + + afterEach('ensure ticks are 0 after', async () => { + const slots = await Promise.all(pools.map((pool) => pool.slot0().then(({ tick }) => tick))) + expect(slots).to.deep.eq([0, 0, 0]) + }) + + describe('#exactInput', () => { + it('0 -> 1', async () => { + await snapshotGasCost(exactInput(tokens.slice(0, 2).map((token) => token.address))) + }) + + it('0 -> 1 minimal', async () => { + const calleeFactory = await ethers.getContractFactory('TestUniswapV3Callee') + const callee = await calleeFactory.deploy() + + await tokens[0].connect(trader).approve(callee.address, constants.MaxUint256) + await snapshotGasCost(callee.connect(trader).swapExact0For1(pools[0].address, 2, trader.address, '4295128740')) + }) + + it('0 -> 1 -> 2', async () => { + await snapshotGasCost( + exactInput( + tokens.map((token) => token.address), + 3 + ) + ) + }) + + it('WETH9 -> 0', async () => { + await snapshotGasCost( + exactInput( + [weth9.address, tokens[0].address], + weth9.address.toLowerCase() < tokens[0].address.toLowerCase() ? 2 : 3 + ) + ) + }) + + it('0 -> WETH9', async () => { + await snapshotGasCost( + exactInput( + [tokens[0].address, weth9.address], + tokens[0].address.toLowerCase() < weth9.address.toLowerCase() ? 2 : 3 + ) + ) + }) + + it('2 trades (via router)', async () => { + await weth9.connect(trader).deposit({ value: 3 }) + await weth9.connect(trader).approve(router.address, constants.MaxUint256) + const swap0 = { + path: encodePath([weth9.address, tokens[0].address], [FeeAmount.MEDIUM]), + recipient: constants.AddressZero, + deadline: 1, + amountIn: 3, + amountOutMinimum: 0, // save on calldata + } + + const swap1 = { + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + recipient: constants.AddressZero, + deadline: 1, + amountIn: 3, + amountOutMinimum: 0, // save on calldata + } + + const data = [ + router.interface.encodeFunctionData('exactInput', [swap0]), + router.interface.encodeFunctionData('exactInput', [swap1]), + router.interface.encodeFunctionData('sweepToken', [tokens[0].address, 2, trader.address]), + ] + + await snapshotGasCost(router.connect(trader).multicall(data)) + }) + + it('3 trades (directly to sender)', async () => { + await weth9.connect(trader).deposit({ value: 3 }) + await weth9.connect(trader).approve(router.address, constants.MaxUint256) + const swap0 = { + path: encodePath([weth9.address, tokens[0].address], [FeeAmount.MEDIUM]), + recipient: trader.address, + deadline: 1, + amountIn: 3, + amountOutMinimum: 1, + } + + const swap1 = { + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + recipient: trader.address, + deadline: 1, + amountIn: 3, + amountOutMinimum: 1, + } + + const swap2 = { + path: encodePath([tokens[1].address, tokens[2].address], [FeeAmount.MEDIUM]), + recipient: trader.address, + deadline: 1, + amountIn: 3, + amountOutMinimum: 1, + } + + const data = [ + router.interface.encodeFunctionData('exactInput', [swap0]), + router.interface.encodeFunctionData('exactInput', [swap1]), + router.interface.encodeFunctionData('exactInput', [swap2]), + ] + + await snapshotGasCost(router.connect(trader).multicall(data)) + }) + }) + + it('3 trades (directly to sender)', async () => { + await weth9.connect(trader).deposit({ value: 3 }) + await weth9.connect(trader).approve(router.address, constants.MaxUint256) + const swap0 = { + path: encodePath([weth9.address, tokens[0].address], [FeeAmount.MEDIUM]), + recipient: trader.address, + deadline: 1, + amountIn: 3, + amountOutMinimum: 1, + } + + const swap1 = { + path: encodePath([tokens[1].address, tokens[0].address], [FeeAmount.MEDIUM]), + recipient: trader.address, + deadline: 1, + amountIn: 3, + amountOutMinimum: 1, + } + + const data = [ + router.interface.encodeFunctionData('exactInput', [swap0]), + router.interface.encodeFunctionData('exactInput', [swap1]), + ] + + await snapshotGasCost(router.connect(trader).multicall(data)) + }) + + describe('#exactInputSingle', () => { + it('0 -> 1', async () => { + await snapshotGasCost(exactInputSingle(tokens[0].address, tokens[1].address)) + }) + + it('WETH9 -> 0', async () => { + await snapshotGasCost( + exactInputSingle( + weth9.address, + tokens[0].address, + weth9.address.toLowerCase() < tokens[0].address.toLowerCase() ? 2 : 3 + ) + ) + }) + + it('0 -> WETH9', async () => { + await snapshotGasCost( + exactInputSingle( + tokens[0].address, + weth9.address, + tokens[0].address.toLowerCase() < weth9.address.toLowerCase() ? 2 : 3 + ) + ) + }) + }) + + describe('#exactOutput', () => { + it('0 -> 1', async () => { + await snapshotGasCost(exactOutput(tokens.slice(0, 2).map((token) => token.address))) + }) + + it('0 -> 1 -> 2', async () => { + await snapshotGasCost(exactOutput(tokens.map((token) => token.address))) + }) + + it('WETH9 -> 0', async () => { + await snapshotGasCost(exactOutput([weth9.address, tokens[0].address])) + }) + + it('0 -> WETH9', async () => { + await snapshotGasCost(exactOutput([tokens[0].address, weth9.address])) + }) + }) + + describe('#exactOutputSingle', () => { + it('0 -> 1', async () => { + await snapshotGasCost(exactOutputSingle(tokens[0].address, tokens[1].address)) + }) + + it('WETH9 -> 0', async () => { + await snapshotGasCost(exactOutputSingle(weth9.address, tokens[0].address)) + }) + + it('0 -> WETH9', async () => { + await snapshotGasCost(exactOutputSingle(tokens[0].address, weth9.address)) + }) + }) +}) diff --git a/lib/v3-periphery/test/SwapRouter.spec.ts b/lib/v3-periphery/test/SwapRouter.spec.ts new file mode 100644 index 0000000..a3d8f6d --- /dev/null +++ b/lib/v3-periphery/test/SwapRouter.spec.ts @@ -0,0 +1,916 @@ +import { Fixture } from 'ethereum-waffle' +import { BigNumber, constants, Contract, ContractTransaction, Wallet } from 'ethers' +import { waffle, ethers } from 'hardhat' +import { IWETH9, MockTimeNonfungiblePositionManager, MockTimeSwapRouter, TestERC20 } from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expandTo18Decimals } from './shared/expandTo18Decimals' +import { expect } from './shared/expect' +import { encodePath } from './shared/path' +import { getMaxTick, getMinTick } from './shared/ticks' +import { computePoolAddress } from './shared/computePoolAddress' + +describe('SwapRouter', function () { + this.timeout(40000) + let wallet: Wallet + let trader: Wallet + + const swapRouterFixture: Fixture<{ + weth9: IWETH9 + factory: Contract + router: MockTimeSwapRouter + nft: MockTimeNonfungiblePositionManager + tokens: [TestERC20, TestERC20, TestERC20] + }> = async (wallets, provider) => { + const { weth9, factory, router, tokens, nft } = await completeFixture(wallets, provider) + + // approve & fund wallets + for (const token of tokens) { + await token.approve(router.address, constants.MaxUint256) + await token.approve(nft.address, constants.MaxUint256) + await token.connect(trader).approve(router.address, constants.MaxUint256) + await token.transfer(trader.address, expandTo18Decimals(1_000_000)) + } + + return { + weth9, + factory, + router, + tokens, + nft, + } + } + + let factory: Contract + let weth9: IWETH9 + let router: MockTimeSwapRouter + let nft: MockTimeNonfungiblePositionManager + let tokens: [TestERC20, TestERC20, TestERC20] + let getBalances: ( + who: string + ) => Promise<{ + weth9: BigNumber + token0: BigNumber + token1: BigNumber + token2: BigNumber + }> + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + ;[wallet, trader] = await (ethers as any).getSigners() + loadFixture = waffle.createFixtureLoader([wallet, trader]) + }) + + // helper for getting weth and token balances + beforeEach('load fixture', async () => { + ;({ router, weth9, factory, tokens, nft } = await loadFixture(swapRouterFixture)) + + getBalances = async (who: string) => { + const balances = await Promise.all([ + weth9.balanceOf(who), + tokens[0].balanceOf(who), + tokens[1].balanceOf(who), + tokens[2].balanceOf(who), + ]) + return { + weth9: balances[0], + token0: balances[1], + token1: balances[2], + token2: balances[3], + } + } + }) + + // ensure the swap router never ends up with a balance + afterEach('load fixture', async () => { + const balances = await getBalances(router.address) + expect(Object.values(balances).every((b) => b.eq(0))).to.be.eq(true) + const balance = await waffle.provider.getBalance(router.address) + expect(balance.eq(0)).to.be.eq(true) + }) + + it('bytecode size', async () => { + expect(((await router.provider.getCode(router.address)).length - 2) / 2).to.matchSnapshot() + }) + + describe('swaps', () => { + const liquidity = 1000000 + async function createPool(tokenAddressA: string, tokenAddressB: string) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary( + tokenAddressA, + tokenAddressB, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams) + } + + async function createPoolWETH9(tokenAddress: string) { + await weth9.deposit({ value: liquidity }) + await weth9.approve(nft.address, constants.MaxUint256) + return createPool(weth9.address, tokenAddress) + } + + beforeEach('create 0-1 and 1-2 pools', async () => { + await createPool(tokens[0].address, tokens[1].address) + await createPool(tokens[1].address, tokens[2].address) + }) + + describe('#exactInput', () => { + async function exactInput( + tokens: string[], + amountIn: number = 3, + amountOutMinimum: number = 1 + ): Promise { + const inputIsWETH = weth9.address === tokens[0] + const outputIsWETH9 = tokens[tokens.length - 1] === weth9.address + + const value = inputIsWETH ? amountIn : 0 + + const params = { + path: encodePath(tokens, new Array(tokens.length - 1).fill(FeeAmount.MEDIUM)), + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountIn, + amountOutMinimum, + } + + const data = [router.interface.encodeFunctionData('exactInput', [params])] + if (outputIsWETH9) + data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOutMinimum, trader.address])) + + // ensure that the swap fails if the limit is any tighter + params.amountOutMinimum += 1 + await expect(router.connect(trader).exactInput(params, { value })).to.be.revertedWith('Too little received') + params.amountOutMinimum -= 1 + + // optimized for the gas test + return data.length === 1 + ? router.connect(trader).exactInput(params, { value }) + : router.connect(trader).multicall(data, { value }) + } + + describe('single-pool', () => { + it('0 -> 1', async () => { + const pool = await factory.getPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactInput(tokens.slice(0, 2).map((token) => token.address)) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.sub(1)) + }) + + it('1 -> 0', async () => { + const pool = await factory.getPool(tokens[1].address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactInput( + tokens + .slice(0, 2) + .reverse() + .map((token) => token.address) + ) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.sub(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.add(3)) + }) + }) + + describe('multi-pool', () => { + it('0 -> 1 -> 2', async () => { + const traderBefore = await getBalances(trader.address) + + await exactInput( + tokens.map((token) => token.address), + 5, + 1 + ) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(5)) + expect(traderAfter.token2).to.be.eq(traderBefore.token2.add(1)) + }) + + it('2 -> 1 -> 0', async () => { + const traderBefore = await getBalances(trader.address) + + await exactInput(tokens.map((token) => token.address).reverse(), 5, 1) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token2).to.be.eq(traderBefore.token2.sub(5)) + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + }) + + it('events', async () => { + await expect( + exactInput( + tokens.map((token) => token.address), + 5, + 1 + ) + ) + .to.emit(tokens[0], 'Transfer') + .withArgs( + trader.address, + computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM), + 5 + ) + .to.emit(tokens[1], 'Transfer') + .withArgs( + computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM), + router.address, + 3 + ) + .to.emit(tokens[1], 'Transfer') + .withArgs( + router.address, + computePoolAddress(factory.address, [tokens[1].address, tokens[2].address], FeeAmount.MEDIUM), + 3 + ) + .to.emit(tokens[2], 'Transfer') + .withArgs( + computePoolAddress(factory.address, [tokens[1].address, tokens[2].address], FeeAmount.MEDIUM), + trader.address, + 1 + ) + }) + }) + + describe('ETH input', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + }) + + it('WETH9 -> 0', async () => { + const pool = await factory.getPool(weth9.address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactInput([weth9.address, tokens[0].address])) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 3) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.add(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + }) + + it('WETH9 -> 0 -> 1', async () => { + const traderBefore = await getBalances(trader.address) + + await expect(exactInput([weth9.address, tokens[0].address, tokens[1].address], 5)) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 5) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + }) + }) + }) + + describe('ETH output', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + await createPoolWETH9(tokens[1].address) + }) + + it('0 -> WETH9', async () => { + const pool = await factory.getPool(tokens[0].address, weth9.address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactInput([tokens[0].address, weth9.address])) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.sub(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + }) + + it('0 -> 1 -> WETH9', async () => { + // get balances before + const traderBefore = await getBalances(trader.address) + + await expect(exactInput([tokens[0].address, tokens[1].address, weth9.address], 5)) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(5)) + }) + }) + }) + }) + + describe('#exactInputSingle', () => { + async function exactInputSingle( + tokenIn: string, + tokenOut: string, + amountIn: number = 3, + amountOutMinimum: number = 1, + sqrtPriceLimitX96?: BigNumber + ): Promise { + const inputIsWETH = weth9.address === tokenIn + const outputIsWETH9 = tokenOut === weth9.address + + const value = inputIsWETH ? amountIn : 0 + + const params = { + tokenIn, + tokenOut, + fee: FeeAmount.MEDIUM, + sqrtPriceLimitX96: + sqrtPriceLimitX96 ?? tokenIn.toLowerCase() < tokenOut.toLowerCase() + ? BigNumber.from('4295128740') + : BigNumber.from('1461446703485210103287273052203988822378723970341'), + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountIn, + amountOutMinimum, + } + + const data = [router.interface.encodeFunctionData('exactInputSingle', [params])] + if (outputIsWETH9) + data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOutMinimum, trader.address])) + + // ensure that the swap fails if the limit is any tighter + params.amountOutMinimum += 1 + await expect(router.connect(trader).exactInputSingle(params, { value })).to.be.revertedWith( + 'Too little received' + ) + params.amountOutMinimum -= 1 + + // optimized for the gas test + return data.length === 1 + ? router.connect(trader).exactInputSingle(params, { value }) + : router.connect(trader).multicall(data, { value }) + } + + it('0 -> 1', async () => { + const pool = await factory.getPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactInputSingle(tokens[0].address, tokens[1].address) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.sub(1)) + }) + + it('1 -> 0', async () => { + const pool = await factory.getPool(tokens[1].address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactInputSingle(tokens[1].address, tokens[0].address) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.sub(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.add(3)) + }) + + describe('ETH input', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + }) + + it('WETH9 -> 0', async () => { + const pool = await factory.getPool(weth9.address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactInputSingle(weth9.address, tokens[0].address)) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 3) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.add(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + }) + }) + }) + + describe('ETH output', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + await createPoolWETH9(tokens[1].address) + }) + + it('0 -> WETH9', async () => { + const pool = await factory.getPool(tokens[0].address, weth9.address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactInputSingle(tokens[0].address, weth9.address)) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.sub(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + }) + }) + }) + }) + + describe('#exactOutput', () => { + async function exactOutput( + tokens: string[], + amountOut: number = 1, + amountInMaximum: number = 3 + ): Promise { + const inputIsWETH9 = tokens[0] === weth9.address + const outputIsWETH9 = tokens[tokens.length - 1] === weth9.address + + const value = inputIsWETH9 ? amountInMaximum : 0 + + const params = { + path: encodePath(tokens.slice().reverse(), new Array(tokens.length - 1).fill(FeeAmount.MEDIUM)), + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountOut, + amountInMaximum, + } + + const data = [router.interface.encodeFunctionData('exactOutput', [params])] + if (inputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [0, trader.address])) + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOut, trader.address])) + + // ensure that the swap fails if the limit is any tighter + params.amountInMaximum -= 1 + await expect(router.connect(trader).exactOutput(params, { value })).to.be.revertedWith('Too much requested') + params.amountInMaximum += 1 + + return router.connect(trader).multicall(data, { value }) + } + + describe('single-pool', () => { + it('0 -> 1', async () => { + const pool = await factory.getPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactOutput(tokens.slice(0, 2).map((token) => token.address)) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.sub(1)) + }) + + it('1 -> 0', async () => { + const pool = await factory.getPool(tokens[1].address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactOutput( + tokens + .slice(0, 2) + .reverse() + .map((token) => token.address) + ) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.sub(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.add(3)) + }) + }) + + describe('multi-pool', () => { + it('0 -> 1 -> 2', async () => { + const traderBefore = await getBalances(trader.address) + + await exactOutput( + tokens.map((token) => token.address), + 1, + 5 + ) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(5)) + expect(traderAfter.token2).to.be.eq(traderBefore.token2.add(1)) + }) + + it('2 -> 1 -> 0', async () => { + const traderBefore = await getBalances(trader.address) + + await exactOutput(tokens.map((token) => token.address).reverse(), 1, 5) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token2).to.be.eq(traderBefore.token2.sub(5)) + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + }) + + it('events', async () => { + await expect( + exactOutput( + tokens.map((token) => token.address), + 1, + 5 + ) + ) + .to.emit(tokens[2], 'Transfer') + .withArgs( + computePoolAddress(factory.address, [tokens[2].address, tokens[1].address], FeeAmount.MEDIUM), + trader.address, + 1 + ) + .to.emit(tokens[1], 'Transfer') + .withArgs( + computePoolAddress(factory.address, [tokens[1].address, tokens[0].address], FeeAmount.MEDIUM), + computePoolAddress(factory.address, [tokens[2].address, tokens[1].address], FeeAmount.MEDIUM), + 3 + ) + .to.emit(tokens[0], 'Transfer') + .withArgs( + trader.address, + computePoolAddress(factory.address, [tokens[1].address, tokens[0].address], FeeAmount.MEDIUM), + 5 + ) + }) + }) + + describe('ETH input', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + }) + + it('WETH9 -> 0', async () => { + const pool = await factory.getPool(weth9.address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactOutput([weth9.address, tokens[0].address])) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 3) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.add(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + }) + + it('WETH9 -> 0 -> 1', async () => { + const traderBefore = await getBalances(trader.address) + + await expect(exactOutput([weth9.address, tokens[0].address, tokens[1].address], 1, 5)) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 5) + + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + }) + }) + }) + + describe('ETH output', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + await createPoolWETH9(tokens[1].address) + }) + + it('0 -> WETH9', async () => { + const pool = await factory.getPool(tokens[0].address, weth9.address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactOutput([tokens[0].address, weth9.address])) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.sub(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + }) + + it('0 -> 1 -> WETH9', async () => { + // get balances before + const traderBefore = await getBalances(trader.address) + + await expect(exactOutput([tokens[0].address, tokens[1].address, weth9.address], 1, 5)) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(5)) + }) + }) + }) + }) + + describe('#exactOutputSingle', () => { + async function exactOutputSingle( + tokenIn: string, + tokenOut: string, + amountOut: number = 1, + amountInMaximum: number = 3, + sqrtPriceLimitX96?: BigNumber + ): Promise { + const inputIsWETH9 = tokenIn === weth9.address + const outputIsWETH9 = tokenOut === weth9.address + + const value = inputIsWETH9 ? amountInMaximum : 0 + + const params = { + tokenIn, + tokenOut, + fee: FeeAmount.MEDIUM, + recipient: outputIsWETH9 ? constants.AddressZero : trader.address, + deadline: 1, + amountOut, + amountInMaximum, + sqrtPriceLimitX96: + sqrtPriceLimitX96 ?? tokenIn.toLowerCase() < tokenOut.toLowerCase() + ? BigNumber.from('4295128740') + : BigNumber.from('1461446703485210103287273052203988822378723970341'), + } + + const data = [router.interface.encodeFunctionData('exactOutputSingle', [params])] + if (inputIsWETH9) data.push(router.interface.encodeFunctionData('refundETH')) + if (outputIsWETH9) data.push(router.interface.encodeFunctionData('unwrapWETH9', [amountOut, trader.address])) + + // ensure that the swap fails if the limit is any tighter + params.amountInMaximum -= 1 + await expect(router.connect(trader).exactOutputSingle(params, { value })).to.be.revertedWith( + 'Too much requested' + ) + params.amountInMaximum += 1 + + return router.connect(trader).multicall(data, { value }) + } + + it('0 -> 1', async () => { + const pool = await factory.getPool(tokens[0].address, tokens[1].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactOutputSingle(tokens[0].address, tokens[1].address) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.add(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.sub(1)) + }) + + it('1 -> 0', async () => { + const pool = await factory.getPool(tokens[1].address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await exactOutputSingle(tokens[1].address, tokens[0].address) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(traderAfter.token1).to.be.eq(traderBefore.token1.sub(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + expect(poolAfter.token1).to.be.eq(poolBefore.token1.add(3)) + }) + + describe('ETH input', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + }) + + it('WETH9 -> 0', async () => { + const pool = await factory.getPool(weth9.address, tokens[0].address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactOutputSingle(weth9.address, tokens[0].address)) + .to.emit(weth9, 'Deposit') + .withArgs(router.address, 3) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.add(1)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.add(3)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.sub(1)) + }) + }) + }) + + describe('ETH output', () => { + describe('WETH9', () => { + beforeEach(async () => { + await createPoolWETH9(tokens[0].address) + await createPoolWETH9(tokens[1].address) + }) + + it('0 -> WETH9', async () => { + const pool = await factory.getPool(tokens[0].address, weth9.address, FeeAmount.MEDIUM) + + // get balances before + const poolBefore = await getBalances(pool) + const traderBefore = await getBalances(trader.address) + + await expect(exactOutputSingle(tokens[0].address, weth9.address)) + .to.emit(weth9, 'Withdrawal') + .withArgs(router.address, 1) + + // get balances after + const poolAfter = await getBalances(pool) + const traderAfter = await getBalances(trader.address) + + expect(traderAfter.token0).to.be.eq(traderBefore.token0.sub(3)) + expect(poolAfter.weth9).to.be.eq(poolBefore.weth9.sub(1)) + expect(poolAfter.token0).to.be.eq(poolBefore.token0.add(3)) + }) + }) + }) + }) + + describe('*WithFee', () => { + const feeRecipient = '0xfEE0000000000000000000000000000000000000' + + it('#sweepTokenWithFee', async () => { + const amountOutMinimum = 100 + const params = { + path: encodePath([tokens[0].address, tokens[1].address], [FeeAmount.MEDIUM]), + recipient: router.address, + deadline: 1, + amountIn: 102, + amountOutMinimum, + } + + const data = [ + router.interface.encodeFunctionData('exactInput', [params]), + router.interface.encodeFunctionData('sweepTokenWithFee', [ + tokens[1].address, + amountOutMinimum, + trader.address, + 100, + feeRecipient, + ]), + ] + + await router.connect(trader).multicall(data) + + const balance = await tokens[1].balanceOf(feeRecipient) + expect(balance.eq(1)).to.be.eq(true) + }) + + it('#unwrapWETH9WithFee', async () => { + const startBalance = await waffle.provider.getBalance(feeRecipient) + await createPoolWETH9(tokens[0].address) + + const amountOutMinimum = 100 + const params = { + path: encodePath([tokens[0].address, weth9.address], [FeeAmount.MEDIUM]), + recipient: router.address, + deadline: 1, + amountIn: 102, + amountOutMinimum, + } + + const data = [ + router.interface.encodeFunctionData('exactInput', [params]), + router.interface.encodeFunctionData('unwrapWETH9WithFee', [ + amountOutMinimum, + trader.address, + 100, + feeRecipient, + ]), + ] + + await router.connect(trader).multicall(data) + const endBalance = await waffle.provider.getBalance(feeRecipient) + expect(endBalance.sub(startBalance).eq(1)).to.be.eq(true) + }) + }) + }) +}) diff --git a/lib/v3-periphery/test/TickLens.spec.ts b/lib/v3-periphery/test/TickLens.spec.ts new file mode 100644 index 0000000..4a927d7 --- /dev/null +++ b/lib/v3-periphery/test/TickLens.spec.ts @@ -0,0 +1,223 @@ +import { Fixture } from 'ethereum-waffle' +import { BigNumber, BigNumberish, constants, Contract, ContractTransaction, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { MockTimeNonfungiblePositionManager, TestERC20, TickLensTest } from '../typechain' +import completeFixture from './shared/completeFixture' +import { FeeAmount, TICK_SPACINGS } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import { expect } from './shared/expect' +import { getMaxTick, getMinTick } from './shared/ticks' +import { computePoolAddress } from './shared/computePoolAddress' +import snapshotGasCost from './shared/snapshotGasCost' + +describe('TickLens', () => { + let wallets: Wallet[] + + const nftFixture: Fixture<{ + factory: Contract + nft: MockTimeNonfungiblePositionManager + tokens: [TestERC20, TestERC20, TestERC20] + }> = async (wallets, provider) => { + const { factory, tokens, nft } = await completeFixture(wallets, provider) + + for (const token of tokens) { + await token.approve(nft.address, constants.MaxUint256) + } + + return { + factory, + nft, + tokens, + } + } + + let factory: Contract + let nft: MockTimeNonfungiblePositionManager + let tokens: [TestERC20, TestERC20, TestERC20] + let poolAddress: string + let tickLens: TickLensTest + + let loadFixture: ReturnType + + before('create fixture loader', async () => { + wallets = await (ethers as any).getSigners() + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ factory, tokens, nft } = await loadFixture(nftFixture)) + }) + + describe('#getPopulatedTicksInWord', () => { + const fullRangeLiquidity = 1000000 + async function createPool(tokenAddressA: string, tokenAddressB: string) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary( + tokenAddressA, + tokenAddressB, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallets[0].address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams) + } + + async function mint(tickLower: number, tickUpper: number, amountBothDesired: BigNumberish): Promise { + const mintParams = { + token0: tokens[0].address, + token1: tokens[1].address, + fee: FeeAmount.MEDIUM, + tickLower, + tickUpper, + amount0Desired: amountBothDesired, + amount1Desired: amountBothDesired, + amount0Min: 0, + amount1Min: 0, + recipient: wallets[0].address, + deadline: 1, + } + + const { liquidity } = await nft.callStatic.mint(mintParams) + + await nft.mint(mintParams) + return liquidity.toNumber() + } + + beforeEach(async () => { + await createPool(tokens[0].address, tokens[1].address) + poolAddress = computePoolAddress(factory.address, [tokens[0].address, tokens[1].address], FeeAmount.MEDIUM) + }) + + beforeEach(async () => { + const lensFactory = await ethers.getContractFactory('TickLensTest') + tickLens = (await lensFactory.deploy()) as TickLensTest + }) + + function getTickBitmapIndex(tick: BigNumberish, tickSpacing: number): BigNumber { + const intermediate = BigNumber.from(tick).div(tickSpacing) + // see https://docs.soliditylang.org/en/v0.7.6/types.html#shifts + return intermediate.lt(0) ? intermediate.add(1).div(BigNumber.from(2).pow(8)).sub(1) : intermediate.shr(8) + } + + it('works for min/max', async () => { + const [min] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + const [max] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + expect(min.tick).to.be.eq(getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(min.liquidityNet).to.be.eq(fullRangeLiquidity) + expect(min.liquidityGross).to.be.eq(fullRangeLiquidity) + + expect(max.tick).to.be.eq(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(max.liquidityNet).to.be.eq(fullRangeLiquidity * -1) + expect(min.liquidityGross).to.be.eq(fullRangeLiquidity) + }) + + it('works for min/max and -2/-1/0/1', async () => { + const minus = -TICK_SPACINGS[FeeAmount.MEDIUM] + const plus = -minus + + const liquidity0 = await mint(minus * 2, minus, 2) + const liquidity1 = await mint(minus * 2, 0, 3) + const liquidity2 = await mint(minus * 2, plus, 5) + const liquidity3 = await mint(minus, 0, 7) + const liquidity4 = await mint(minus, plus, 11) + const liquidity5 = await mint(0, plus, 13) + + const [min] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + const [negativeOne, negativeTwo] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(minus, TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + const [one, zero] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(plus, TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + const [max] = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + + expect(min.tick).to.be.eq(getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(min.liquidityNet).to.be.eq(fullRangeLiquidity) + expect(min.liquidityGross).to.be.eq(fullRangeLiquidity) + + expect(negativeTwo.tick).to.be.eq(minus * 2) + expect(negativeTwo.liquidityNet).to.be.eq(liquidity0 + liquidity1 + liquidity2) + expect(negativeTwo.liquidityGross).to.be.eq(liquidity0 + liquidity1 + liquidity2) + + expect(negativeOne.tick).to.be.eq(minus) + expect(negativeOne.liquidityNet).to.be.eq(liquidity3 + liquidity4 - liquidity0) + expect(negativeOne.liquidityGross).to.be.eq(liquidity3 + liquidity4 + liquidity0) + + expect(zero.tick).to.be.eq(0) + expect(zero.liquidityNet).to.be.eq(liquidity5 - liquidity1 - liquidity3) + expect(zero.liquidityGross).to.be.eq(liquidity5 + liquidity1 + liquidity3) + + expect(one.tick).to.be.eq(plus) + expect(one.liquidityNet).to.be.eq(-liquidity2 - liquidity4 - liquidity5) + expect(one.liquidityGross).to.be.eq(liquidity2 + liquidity4 + liquidity5) + + expect(max.tick).to.be.eq(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM])) + expect(max.liquidityNet).to.be.eq(fullRangeLiquidity * -1) + expect(max.liquidityGross).to.be.eq(fullRangeLiquidity) + }) + + it('gas for single populated tick', async () => { + await snapshotGasCost( + tickLens.getGasCostOfGetPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + ) + }) + + it('fully populated ticks', async () => { + // fully populate a word + for (let i = 0; i < 128; i++) { + await mint(i * TICK_SPACINGS[FeeAmount.MEDIUM], (255 - i) * TICK_SPACINGS[FeeAmount.MEDIUM], 100) + } + + const ticks = await tickLens.getPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(0, TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + expect(ticks.length).to.be.eq(256) + + await snapshotGasCost( + tickLens.getGasCostOfGetPopulatedTicksInWord( + poolAddress, + getTickBitmapIndex(0, TICK_SPACINGS[FeeAmount.MEDIUM]) + ) + ) + }).timeout(300_000) + }) +}) diff --git a/lib/v3-periphery/test/V3Migrator.spec.ts b/lib/v3-periphery/test/V3Migrator.spec.ts new file mode 100644 index 0000000..f113b27 --- /dev/null +++ b/lib/v3-periphery/test/V3Migrator.spec.ts @@ -0,0 +1,446 @@ +import { Fixture } from 'ethereum-waffle' +import { constants, Contract, Wallet } from 'ethers' +import { ethers, waffle } from 'hardhat' +import { + IUniswapV2Pair, + IUniswapV3Factory, + IWETH9, + MockTimeNonfungiblePositionManager, + TestERC20, + V3Migrator, +} from '../typechain' +import completeFixture from './shared/completeFixture' +import { v2FactoryFixture } from './shared/externalFixtures' + +import { abi as PAIR_V2_ABI } from '@uniswap/v2-core/build/UniswapV2Pair.json' +import { expect } from 'chai' +import { FeeAmount } from './shared/constants' +import { encodePriceSqrt } from './shared/encodePriceSqrt' +import snapshotGasCost from './shared/snapshotGasCost' +import { sortedTokens } from './shared/tokenSort' +import { getMaxTick, getMinTick } from './shared/ticks' + +describe('V3Migrator', () => { + let wallet: Wallet + + const migratorFixture: Fixture<{ + factoryV2: Contract + factoryV3: IUniswapV3Factory + token: TestERC20 + weth9: IWETH9 + nft: MockTimeNonfungiblePositionManager + migrator: V3Migrator + }> = async (wallets, provider) => { + const { factory, tokens, nft, weth9 } = await completeFixture(wallets, provider) + + const { factory: factoryV2 } = await v2FactoryFixture(wallets, provider) + + const token = tokens[0] + await token.approve(factoryV2.address, constants.MaxUint256) + await weth9.deposit({ value: 10000 }) + await weth9.approve(nft.address, constants.MaxUint256) + + // deploy the migrator + const migrator = (await (await ethers.getContractFactory('V3Migrator')).deploy( + factory.address, + weth9.address, + nft.address + )) as V3Migrator + + return { + factoryV2, + factoryV3: factory, + token, + weth9, + nft, + migrator, + } + } + + let factoryV2: Contract + let factoryV3: IUniswapV3Factory + let token: TestERC20 + let weth9: IWETH9 + let nft: MockTimeNonfungiblePositionManager + let migrator: V3Migrator + let pair: IUniswapV2Pair + + let loadFixture: ReturnType + + const expectedLiquidity = 10000 - 1000 + + before('create fixture loader', async () => { + const wallets = await (ethers as any).getSigners() + wallet = wallets[0] + + loadFixture = waffle.createFixtureLoader(wallets) + }) + + beforeEach('load fixture', async () => { + ;({ factoryV2, factoryV3, token, weth9, nft, migrator } = await loadFixture(migratorFixture)) + }) + + beforeEach('add V2 liquidity', async () => { + await factoryV2.createPair(token.address, weth9.address) + + const pairAddress = await factoryV2.getPair(token.address, weth9.address) + + pair = new ethers.Contract(pairAddress, PAIR_V2_ABI, wallet) as IUniswapV2Pair + + await token.transfer(pair.address, 10000) + await weth9.transfer(pair.address, 10000) + + await pair.mint(wallet.address) + + expect(await pair.balanceOf(wallet.address)).to.be.eq(expectedLiquidity) + }) + + afterEach('ensure allowances are cleared', async () => { + const allowanceToken = await token.allowance(migrator.address, nft.address) + const allowanceWETH9 = await weth9.allowance(migrator.address, nft.address) + expect(allowanceToken).to.be.eq(0) + expect(allowanceWETH9).to.be.eq(0) + }) + + afterEach('ensure balances are cleared', async () => { + const balanceToken = await token.balanceOf(migrator.address) + const balanceWETH9 = await weth9.balanceOf(migrator.address) + expect(balanceToken).to.be.eq(0) + expect(balanceWETH9).to.be.eq(0) + }) + + afterEach('ensure eth balance is cleared', async () => { + const balanceETH = await ethers.provider.getBalance(migrator.address) + expect(balanceETH).to.be.eq(0) + }) + + describe('#migrate', () => { + let tokenLower: boolean + beforeEach(() => { + tokenLower = token.address.toLowerCase() < weth9.address.toLowerCase() + }) + + it('fails if v3 pool is not initialized', async () => { + await pair.approve(migrator.address, expectedLiquidity) + await expect( + migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: -1, + tickUpper: 1, + amount0Min: 9000, + amount1Min: 9000, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + ).to.be.reverted + }) + + it('works once v3 pool is initialized', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await pair.approve(migrator.address, expectedLiquidity) + await migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 9000, + amount1Min: 9000, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(9000) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + expect(await token.balanceOf(poolAddress)).to.be.eq(9000) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(9000) + }) + + it('works for partial', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + const tokenBalanceBefore = await token.balanceOf(wallet.address) + const weth9BalanceBefore = await weth9.balanceOf(wallet.address) + + await pair.approve(migrator.address, expectedLiquidity) + await migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 50, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 4500, + amount1Min: 4500, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + + const tokenBalanceAfter = await token.balanceOf(wallet.address) + const weth9BalanceAfter = await weth9.balanceOf(wallet.address) + + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(4500) + expect(weth9BalanceAfter.sub(weth9BalanceBefore)).to.be.eq(4500) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(4500) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + expect(await token.balanceOf(poolAddress)).to.be.eq(4500) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(4500) + }) + + it('double the price', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(2, 1) + ) + + const tokenBalanceBefore = await token.balanceOf(wallet.address) + const weth9BalanceBefore = await weth9.balanceOf(wallet.address) + + await pair.approve(migrator.address, expectedLiquidity) + await migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 4500, + amount1Min: 8999, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + + const tokenBalanceAfter = await token.balanceOf(wallet.address) + const weth9BalanceAfter = await weth9.balanceOf(wallet.address) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(6363) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + if (token.address.toLowerCase() < weth9.address.toLowerCase()) { + expect(await token.balanceOf(poolAddress)).to.be.eq(4500) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(4500) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(8999) + expect(weth9BalanceAfter.sub(weth9BalanceBefore)).to.be.eq(1) + } else { + expect(await token.balanceOf(poolAddress)).to.be.eq(8999) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(1) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(4500) + expect(weth9BalanceAfter.sub(weth9BalanceBefore)).to.be.eq(4500) + } + }) + + it('half the price', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 2) + ) + + const tokenBalanceBefore = await token.balanceOf(wallet.address) + const weth9BalanceBefore = await weth9.balanceOf(wallet.address) + + await pair.approve(migrator.address, expectedLiquidity) + await migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 8999, + amount1Min: 4500, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + + const tokenBalanceAfter = await token.balanceOf(wallet.address) + const weth9BalanceAfter = await weth9.balanceOf(wallet.address) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(6363) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + if (token.address.toLowerCase() < weth9.address.toLowerCase()) { + expect(await token.balanceOf(poolAddress)).to.be.eq(8999) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(1) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(4500) + expect(weth9BalanceAfter.sub(weth9BalanceBefore)).to.be.eq(4500) + } else { + expect(await token.balanceOf(poolAddress)).to.be.eq(4500) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(4500) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(8999) + expect(weth9BalanceAfter.sub(weth9BalanceBefore)).to.be.eq(1) + } + }) + + it('double the price - as ETH', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(2, 1) + ) + + const tokenBalanceBefore = await token.balanceOf(wallet.address) + + await pair.approve(migrator.address, expectedLiquidity) + await expect( + migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 4500, + amount1Min: 8999, + recipient: wallet.address, + deadline: 1, + refundAsETH: true, + }) + ) + .to.emit(weth9, 'Withdrawal') + .withArgs(migrator.address, tokenLower ? 1 : 4500) + + const tokenBalanceAfter = await token.balanceOf(wallet.address) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(6363) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + if (tokenLower) { + expect(await token.balanceOf(poolAddress)).to.be.eq(4500) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(4500) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(8999) + } else { + expect(await token.balanceOf(poolAddress)).to.be.eq(8999) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(1) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(4500) + } + }) + + it('half the price - as ETH', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 2) + ) + + const tokenBalanceBefore = await token.balanceOf(wallet.address) + + await pair.approve(migrator.address, expectedLiquidity) + await expect( + migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 8999, + amount1Min: 4500, + recipient: wallet.address, + deadline: 1, + refundAsETH: true, + }) + ) + .to.emit(weth9, 'Withdrawal') + .withArgs(migrator.address, tokenLower ? 4500 : 1) + + const tokenBalanceAfter = await token.balanceOf(wallet.address) + + const position = await nft.positions(1) + expect(position.liquidity).to.be.eq(6363) + + const poolAddress = await factoryV3.getPool(token.address, weth9.address, FeeAmount.MEDIUM) + if (tokenLower) { + expect(await token.balanceOf(poolAddress)).to.be.eq(8999) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(1) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(4500) + } else { + expect(await token.balanceOf(poolAddress)).to.be.eq(4500) + expect(tokenBalanceAfter.sub(tokenBalanceBefore)).to.be.eq(4500) + expect(await weth9.balanceOf(poolAddress)).to.be.eq(8999) + } + }) + + it('gas', async () => { + const [token0, token1] = sortedTokens(weth9, token) + await migrator.createAndInitializePoolIfNecessary( + token0.address, + token1.address, + FeeAmount.MEDIUM, + encodePriceSqrt(1, 1) + ) + + await pair.approve(migrator.address, expectedLiquidity) + await snapshotGasCost( + migrator.migrate({ + pair: pair.address, + liquidityToMigrate: expectedLiquidity, + percentageToMigrate: 100, + token0: tokenLower ? token.address : weth9.address, + token1: tokenLower ? weth9.address : token.address, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(FeeAmount.MEDIUM), + tickUpper: getMaxTick(FeeAmount.MEDIUM), + amount0Min: 9000, + amount1Min: 9000, + recipient: wallet.address, + deadline: 1, + refundAsETH: false, + }) + ) + }) + }) +}) diff --git a/lib/v3-periphery/test/__snapshots__/Base64.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/Base64.spec.ts.snap new file mode 100644 index 0000000..fd54e5c --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/Base64.spec.ts.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Base64 #encode gas cost of encode() 1`] = `1497`; + +exports[`Base64 #encode gas cost of encode(aLpHaBeT) 1`] = `1256`; + +exports[`Base64 #encode gas cost of encode(alphabet soup) 1`] = `1727`; + +exports[`Base64 #encode gas cost of encode(f) 1`] = `763`; + +exports[`Base64 #encode gas cost of encode(fo) 1`] = `774`; + +exports[`Base64 #encode gas cost of encode(foo) 1`] = `769`; + +exports[`Base64 #encode gas cost of encode(foob) 1`] = `1004`; + +exports[`Base64 #encode gas cost of encode(fooba) 1`] = `1015`; + +exports[`Base64 #encode gas cost of encode(foobar) 1`] = `1010`; + +exports[`Base64 #encode gas cost of encode(includes +newlines) 1`] = `1979`; + +exports[`Base64 #encode gas cost of encode(test string) 1`] = `1497`; + +exports[`Base64 #encode gas cost of encode(this is a test) 1`] = `1738`; + +exports[`Base64 #encode gas cost of encode(this is a very long string that should cost a lot of gas to encode :)) 1`] = `6083`; + +exports[`Base64 #encode gas cost of encode(😀) 1`] = `1004`; + +exports[`Base64 #encode max size string (24kB) gas cost 1`] = `3731900`; diff --git a/lib/v3-periphery/test/__snapshots__/LiquidityAmounts.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/LiquidityAmounts.spec.ts.snap new file mode 100644 index 0000000..8f420b7 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/LiquidityAmounts.spec.ts.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`LiquidityAmounts #getAmount0ForLiquidity gas 1`] = `352`; + +exports[`LiquidityAmounts #getAmountsForLiquidity gas for price above 1`] = `481`; + +exports[`LiquidityAmounts #getAmountsForLiquidity gas for price below 1`] = `502`; + +exports[`LiquidityAmounts #getAmountsForLiquidity gas for price inside 1`] = `840`; + +exports[`LiquidityAmounts #getLiquidityForAmount0 gas 1`] = `565`; + +exports[`LiquidityAmounts #getLiquidityForAmount1 gas 1`] = `362`; + +exports[`LiquidityAmounts #getLiquidityForAmount1 gas 2`] = `368`; + +exports[`LiquidityAmounts #getLiquidityForAmounts gas for price above 1`] = `537`; + +exports[`LiquidityAmounts #getLiquidityForAmounts gas for price below 1`] = `712`; + +exports[`LiquidityAmounts #getLiquidityForAmounts gas for price inside 1`] = `1162`; diff --git a/lib/v3-periphery/test/__snapshots__/Multicall.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/Multicall.spec.ts.snap new file mode 100644 index 0000000..636167d --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/Multicall.spec.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Multicall gas cost of pay w/ multicall 1`] = `45845`; + +exports[`Multicall gas cost of pay w/o multicall 1`] = `43342`; diff --git a/lib/v3-periphery/test/__snapshots__/NFTDescriptor.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/NFTDescriptor.spec.ts.snap new file mode 100644 index 0000000..72b006f --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/NFTDescriptor.spec.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NFTDescriptor #constructTokenURI gas 1`] = `1632898`; + +exports[`NFTDescriptor #constructTokenURI snapshot matches 1`] = `"data:application/json;base64,eyJuYW1lIjoiVW5pc3dhcCAtIDAuMDUlIC0gVU5JL1dFVEggLSAxLjAwMDA8PjEuMTA1MiIsICJkZXNjcmlwdGlvbiI6IlRoaXMgTkZUIHJlcHJlc2VudHMgYSBsaXF1aWRpdHkgcG9zaXRpb24gaW4gYSBVbmlzd2FwIFYzIFVOSS1XRVRIIHBvb2wuIFRoZSBvd25lciBvZiB0aGlzIE5GVCBjYW4gbW9kaWZ5IG9yIHJlZGVlbSB0aGUgcG9zaXRpb24uXG5cblBvb2wgQWRkcmVzczogMHhiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiXG5VTkkgQWRkcmVzczogMHhhYmNkZWFiY2RlZmFiY2RlZmFiY2RlZmFiY2RlZmFiY2RlZmFiY2RmXG5XRVRIIEFkZHJlc3M6IDB4MTIzNDU2Nzg5MDEyMzQ1Njc4OTEyMzQ1Njc4OTAxMjM0NTY3ODkwMVxuRmVlIFRpZXI6IDAuMDUlXG5Ub2tlbiBJRDogMVxuXG7imqDvuI8gRElTQ0xBSU1FUjogRHVlIGRpbGlnZW5jZSBpcyBpbXBlcmF0aXZlIHdoZW4gYXNzZXNzaW5nIHRoaXMgTkZULiBNYWtlIHN1cmUgdG9rZW4gYWRkcmVzc2VzIG1hdGNoIHRoZSBleHBlY3RlZCB0b2tlbnMsIGFzIHRva2VuIHN5bWJvbHMgbWF5IGJlIGltaXRhdGVkLiIsICJpbWFnZSI6ICJkYXRhOmltYWdlL3N2Zyt4bWw7YmFzZTY0LFBITjJaeUIzYVdSMGFEMGlNamt3SWlCb1pXbG5hSFE5SWpVd01DSWdkbWxsZDBKdmVEMGlNQ0F3SURJNU1DQTFNREFpSUhodGJHNXpQU0pvZEhSd09pOHZkM2QzTG5jekxtOXlaeTh5TURBd0wzTjJaeUlnZUcxc2JuTTZlR3hwYm1zOUoyaDBkSEE2THk5M2QzY3Vkek11YjNKbkx6RTVPVGt2ZUd4cGJtc25QanhrWldaelBqeG1hV3gwWlhJZ2FXUTlJbVl4SWo0OFptVkpiV0ZuWlNCeVpYTjFiSFE5SW5Bd0lpQjRiR2x1YXpwb2NtVm1QU0prWVhSaE9tbHRZV2RsTDNOMlp5dDRiV3c3WW1GelpUWTBMRkJJVGpKYWVVSXpZVmRTTUdGRU1HNU5hbXQzU25sQ2IxcFhiRzVoU0ZFNVNucFZkMDFEWTJka2JXeHNaREJLZG1WRU1HNU5RMEYzU1VSSk5VMURRVEZOUkVGdVNVaG9kR0pITlhwUVUyUnZaRWhTZDA5cE9IWmtNMlF6VEc1amVreHRPWGxhZVRoNVRVUkJkMHd6VGpKYWVXTXJVRWhLYkZrelVXZGtNbXhyWkVkbk9VcDZTVFZOU0VJMFNubENiMXBYYkc1aFNGRTVTbnBWZDAxSVFqUktlVUp0WVZkNGMxQlRZMnBaVjBwcVdrZFdhRXA1T0N0UVF6bDZaRzFqS3lJdlBqeG1aVWx0WVdkbElISmxjM1ZzZEQwaWNERWlJSGhzYVc1ck9taHlaV1k5SW1SaGRHRTZhVzFoWjJVdmMzWm5LM2h0YkR0aVlYTmxOalFzVUVoT01scDVRak5oVjFJd1lVUXdiazFxYTNkS2VVSnZXbGRzYm1GSVVUbEtlbFYzVFVOaloyUnRiR3hrTUVwMlpVUXdiazFEUVhkSlJFazFUVU5CTVUxRVFXNUpTR2gwWWtjMWVsQlRaRzlrU0ZKM1QyazRkbVF6WkROTWJtTjZURzA1ZVZwNU9IbE5SRUYzVEROT01scDVZeXRRUjA1d1kyMU9jMXBUUW1wbFJEQnVUV3BaTkVwNVFtcGxWREJ1VFdwVk1VcDVRbmxRVTJONFRXcENkMlZEWTJkYWJXeHpZa1F3YmtsNlJYbE5lbEV4VG1samRsQnFkM1pqTTFwdVVHYzlQU0l2UGp4bVpVbHRZV2RsSUhKbGMzVnNkRDBpY0RJaUlIaHNhVzVyT21oeVpXWTlJbVJoZEdFNmFXMWhaMlV2YzNabkszaHRiRHRpWVhObE5qUXNVRWhPTWxwNVFqTmhWMUl3WVVRd2JrMXFhM2RLZVVKdldsZHNibUZJVVRsS2VsVjNUVU5qWjJSdGJHeGtNRXAyWlVRd2JrMURRWGRKUkVrMVRVTkJNVTFFUVc1SlNHaDBZa2MxZWxCVFpHOWtTRkozVDJrNGRtUXpaRE5NYm1ONlRHMDVlVnA1T0hsTlJFRjNURE5PTWxwNVl5dFFSMDV3WTIxT2MxcFRRbXBsUkRCdVRXcEJNa3A1UW1wbFZEQnVUVlJWZVVwNVFubFFVMk40VFdwQ2QyVkRZMmRhYld4ellrUXdia2t5V21oWmJVNXJXbWxqZGxCcWQzWmpNMXB1VUdjOVBTSWdMejQ4Wm1WSmJXRm5aU0J5WlhOMWJIUTlJbkF6SWlCNGJHbHVhenBvY21WbVBTSmtZWFJoT21sdFlXZGxMM04yWnl0NGJXdzdZbUZ6WlRZMExGQklUakphZVVJellWZFNNR0ZFTUc1TmFtdDNTbmxDYjFwWGJHNWhTRkU1U25wVmQwMURZMmRrYld4c1pEQktkbVZFTUc1TlEwRjNTVVJKTlUxRFFURk5SRUZ1U1Vob2RHSkhOWHBRVTJSdlpFaFNkMDlwT0haa00yUXpURzVqZWt4dE9YbGFlVGg1VFVSQmQwd3pUakphZVdNclVFZE9jR050VG5OYVUwSnFaVVF3YmsxcVVYZEtlVUpxWlZRd2JrMTZRVEpLZVVKNVVGTmplRTFFUW5kbFEyTm5XbTFzYzJKRU1HNUplbGt6VDBScmQwMVRZM1pRYW5kMll6TmFibEJuUFQwaUlDOCtQR1psUW14bGJtUWdiVzlrWlQwaWIzWmxjbXhoZVNJZ2FXNDlJbkF3SWlCcGJqSTlJbkF4SWlBdlBqeG1aVUpzWlc1a0lHMXZaR1U5SW1WNFkyeDFjMmx2YmlJZ2FXNHlQU0p3TWlJZ0x6NDhabVZDYkdWdVpDQnRiMlJsUFNKdmRtVnliR0Y1SWlCcGJqSTlJbkF6SWlCeVpYTjFiSFE5SW1Kc1pXNWtUM1YwSWlBdlBqeG1aVWRoZFhOemFXRnVRbXgxY2lCcGJqMGlZbXhsYm1SUGRYUWlJSE4wWkVSbGRtbGhkR2x2YmowaU5ESWlJQzgrUEM5bWFXeDBaWEkrSUR4amJHbHdVR0YwYUNCcFpEMGlZMjl5Ym1WeWN5SStQSEpsWTNRZ2QybGtkR2c5SWpJNU1DSWdhR1ZwWjJoMFBTSTFNREFpSUhKNFBTSTBNaUlnY25rOUlqUXlJaUF2UGp3dlkyeHBjRkJoZEdnK1BIQmhkR2dnYVdROUluUmxlSFF0Y0dGMGFDMWhJaUJrUFNKTk5EQWdNVElnU0RJMU1DQkJNamdnTWpnZ01DQXdJREVnTWpjNElEUXdJRlkwTmpBZ1FUSTRJREk0SURBZ01DQXhJREkxTUNBME9EZ2dTRFF3SUVFeU9DQXlPQ0F3SURBZ01TQXhNaUEwTmpBZ1ZqUXdJRUV5T0NBeU9DQXdJREFnTVNBME1DQXhNaUI2SWlBdlBqeHdZWFJvSUdsa1BTSnRhVzVwYldGd0lpQmtQU0pOTWpNMElEUTBORU15TXpRZ05EVTNMamswT1NBeU5ESXVNakVnTkRZeklESTFNeUEwTmpNaUlDOCtQR1pwYkhSbGNpQnBaRDBpZEc5d0xYSmxaMmx2YmkxaWJIVnlJajQ4Wm1WSFlYVnpjMmxoYmtKc2RYSWdhVzQ5SWxOdmRYSmpaVWR5WVhCb2FXTWlJSE4wWkVSbGRtbGhkR2x2YmowaU1qUWlJQzgrUEM5bWFXeDBaWEkrUEd4cGJtVmhja2R5WVdScFpXNTBJR2xrUFNKbmNtRmtMWFZ3SWlCNE1UMGlNU0lnZURJOUlqQWlJSGt4UFNJeElpQjVNajBpTUNJK1BITjBiM0FnYjJabWMyVjBQU0l3TGpBaUlITjBiM0F0WTI5c2IzSTlJbmRvYVhSbElpQnpkRzl3TFc5d1lXTnBkSGs5SWpFaUlDOCtQSE4wYjNBZ2IyWm1jMlYwUFNJdU9TSWdjM1J2Y0MxamIyeHZjajBpZDJocGRHVWlJSE4wYjNBdGIzQmhZMmwwZVQwaU1DSWdMejQ4TDJ4cGJtVmhja2R5WVdScFpXNTBQanhzYVc1bFlYSkhjbUZrYVdWdWRDQnBaRDBpWjNKaFpDMWtiM2R1SWlCNE1UMGlNQ0lnZURJOUlqRWlJSGt4UFNJd0lpQjVNajBpTVNJK1BITjBiM0FnYjJabWMyVjBQU0l3TGpBaUlITjBiM0F0WTI5c2IzSTlJbmRvYVhSbElpQnpkRzl3TFc5d1lXTnBkSGs5SWpFaUlDOCtQSE4wYjNBZ2IyWm1jMlYwUFNJd0xqa2lJSE4wYjNBdFkyOXNiM0k5SW5kb2FYUmxJaUJ6ZEc5d0xXOXdZV05wZEhrOUlqQWlJQzgrUEM5c2FXNWxZWEpIY21Ga2FXVnVkRDQ4YldGemF5QnBaRDBpWm1Ga1pTMTFjQ0lnYldGemEwTnZiblJsYm5SVmJtbDBjejBpYjJKcVpXTjBRbTkxYm1ScGJtZENiM2dpUGp4eVpXTjBJSGRwWkhSb1BTSXhJaUJvWldsbmFIUTlJakVpSUdacGJHdzlJblZ5YkNnalozSmhaQzExY0NraUlDOCtQQzl0WVhOclBqeHRZWE5ySUdsa1BTSm1ZV1JsTFdSdmQyNGlJRzFoYzJ0RGIyNTBaVzUwVlc1cGRITTlJbTlpYW1WamRFSnZkVzVrYVc1blFtOTRJajQ4Y21WamRDQjNhV1IwYUQwaU1TSWdhR1ZwWjJoMFBTSXhJaUJtYVd4c1BTSjFjbXdvSTJkeVlXUXRaRzkzYmlraUlDOCtQQzl0WVhOclBqeHRZWE5ySUdsa1BTSnViMjVsSWlCdFlYTnJRMjl1ZEdWdWRGVnVhWFJ6UFNKdlltcGxZM1JDYjNWdVpHbHVaMEp2ZUNJK1BISmxZM1FnZDJsa2RHZzlJakVpSUdobGFXZG9kRDBpTVNJZ1ptbHNiRDBpZDJocGRHVWlJQzgrUEM5dFlYTnJQanhzYVc1bFlYSkhjbUZrYVdWdWRDQnBaRDBpWjNKaFpDMXplVzFpYjJ3aVBqeHpkRzl3SUc5bVpuTmxkRDBpTUM0M0lpQnpkRzl3TFdOdmJHOXlQU0ozYUdsMFpTSWdjM1J2Y0MxdmNHRmphWFI1UFNJeElpQXZQanh6ZEc5d0lHOW1abk5sZEQwaUxqazFJaUJ6ZEc5d0xXTnZiRzl5UFNKM2FHbDBaU0lnYzNSdmNDMXZjR0ZqYVhSNVBTSXdJaUF2UGp3dmJHbHVaV0Z5UjNKaFpHbGxiblErUEcxaGMyc2dhV1E5SW1aaFpHVXRjM2x0WW05c0lpQnRZWE5yUTI5dWRHVnVkRlZ1YVhSelBTSjFjMlZ5VTNCaFkyVlBibFZ6WlNJK1BISmxZM1FnZDJsa2RHZzlJakk1TUhCNElpQm9aV2xuYUhROUlqSXdNSEI0SWlCbWFXeHNQU0oxY213b0kyZHlZV1F0YzNsdFltOXNLU0lnTHo0OEwyMWhjMnMrUEM5a1pXWnpQanhuSUdOc2FYQXRjR0YwYUQwaWRYSnNLQ05qYjNKdVpYSnpLU0krUEhKbFkzUWdabWxzYkQwaVlXSmpaR1ZoSWlCNFBTSXdjSGdpSUhrOUlqQndlQ0lnZDJsa2RHZzlJakk1TUhCNElpQm9aV2xuYUhROUlqVXdNSEI0SWlBdlBqeHlaV04wSUhOMGVXeGxQU0ptYVd4MFpYSTZJSFZ5YkNnalpqRXBJaUI0UFNJd2NIZ2lJSGs5SWpCd2VDSWdkMmxrZEdnOUlqSTVNSEI0SWlCb1pXbG5hSFE5SWpVd01IQjRJaUF2UGlBOFp5QnpkSGxzWlQwaVptbHNkR1Z5T25WeWJDZ2pkRzl3TFhKbFoybHZiaTFpYkhWeUtUc2dkSEpoYm5ObWIzSnRPbk5qWVd4bEtERXVOU2s3SUhSeVlXNXpabTl5YlMxdmNtbG5hVzQ2WTJWdWRHVnlJSFJ2Y0RzaVBqeHlaV04wSUdacGJHdzlJbTV2Ym1VaUlIZzlJakJ3ZUNJZ2VUMGlNSEI0SWlCM2FXUjBhRDBpTWprd2NIZ2lJR2hsYVdkb2REMGlOVEF3Y0hnaUlDOCtQR1ZzYkdsd2MyVWdZM2c5SWpVd0pTSWdZM2s5SWpCd2VDSWdjbmc5SWpFNE1IQjRJaUJ5ZVQwaU1USXdjSGdpSUdacGJHdzlJaU13TURBaUlHOXdZV05wZEhrOUlqQXVPRFVpSUM4K1BDOW5Qanh5WldOMElIZzlJakFpSUhrOUlqQWlJSGRwWkhSb1BTSXlPVEFpSUdobGFXZG9kRDBpTlRBd0lpQnllRDBpTkRJaUlISjVQU0kwTWlJZ1ptbHNiRDBpY21kaVlTZ3dMREFzTUN3d0tTSWdjM1J5YjJ0bFBTSnlaMkpoS0RJMU5Td3lOVFVzTWpVMUxEQXVNaWtpSUM4K1BDOW5QangwWlhoMElIUmxlSFF0Y21WdVpHVnlhVzVuUFNKdmNIUnBiV2w2WlZOd1pXVmtJajQ4ZEdWNGRGQmhkR2dnYzNSaGNuUlBabVp6WlhROUlpMHhNREFsSWlCbWFXeHNQU0ozYUdsMFpTSWdabTl1ZEMxbVlXMXBiSGs5SWlkRGIzVnlhV1Z5SUU1bGR5Y3NJRzF2Ym05emNHRmpaU0lnWm05dWRDMXphWHBsUFNJeE1IQjRJaUI0YkdsdWF6cG9jbVZtUFNJamRHVjRkQzF3WVhSb0xXRWlQakI0TVRJek5EVTJOemc1TURFeU16UTFOamM0T1RFeU16UTFOamM0T1RBeE1qTTBOVFkzT0Rrd01TRGlnS0lnVjBWVVNDQThZVzVwYldGMFpTQmhaR1JwZEdsMlpUMGljM1Z0SWlCaGRIUnlhV0oxZEdWT1lXMWxQU0p6ZEdGeWRFOW1abk5sZENJZ1puSnZiVDBpTUNVaUlIUnZQU0l4TURBbElpQmlaV2RwYmowaU1ITWlJR1IxY2owaU16QnpJaUJ5WlhCbFlYUkRiM1Z1ZEQwaWFXNWtaV1pwYm1sMFpTSWdMejQ4TDNSbGVIUlFZWFJvUGlBOGRHVjRkRkJoZEdnZ2MzUmhjblJQWm1aelpYUTlJakFsSWlCbWFXeHNQU0ozYUdsMFpTSWdabTl1ZEMxbVlXMXBiSGs5SWlkRGIzVnlhV1Z5SUU1bGR5Y3NJRzF2Ym05emNHRmpaU0lnWm05dWRDMXphWHBsUFNJeE1IQjRJaUI0YkdsdWF6cG9jbVZtUFNJamRHVjRkQzF3WVhSb0xXRWlQakI0TVRJek5EVTJOemc1TURFeU16UTFOamM0T1RFeU16UTFOamM0T1RBeE1qTTBOVFkzT0Rrd01TRGlnS0lnVjBWVVNDQThZVzVwYldGMFpTQmhaR1JwZEdsMlpUMGljM1Z0SWlCaGRIUnlhV0oxZEdWT1lXMWxQU0p6ZEdGeWRFOW1abk5sZENJZ1puSnZiVDBpTUNVaUlIUnZQU0l4TURBbElpQmlaV2RwYmowaU1ITWlJR1IxY2owaU16QnpJaUJ5WlhCbFlYUkRiM1Z1ZEQwaWFXNWtaV1pwYm1sMFpTSWdMejRnUEM5MFpYaDBVR0YwYUQ0OGRHVjRkRkJoZEdnZ2MzUmhjblJQWm1aelpYUTlJalV3SlNJZ1ptbHNiRDBpZDJocGRHVWlJR1p2Ym5RdFptRnRhV3g1UFNJblEyOTFjbWxsY2lCT1pYY25MQ0J0YjI1dmMzQmhZMlVpSUdadmJuUXRjMmw2WlQwaU1UQndlQ0lnZUd4cGJtczZhSEpsWmowaUkzUmxlSFF0Y0dGMGFDMWhJajR3ZUdGaVkyUmxZV0pqWkdWbVlXSmpaR1ZtWVdKalpHVm1ZV0pqWkdWbVlXSmpaR1ZtWVdKalpHWWc0b0NpSUZWT1NTQThZVzVwYldGMFpTQmhaR1JwZEdsMlpUMGljM1Z0SWlCaGRIUnlhV0oxZEdWT1lXMWxQU0p6ZEdGeWRFOW1abk5sZENJZ1puSnZiVDBpTUNVaUlIUnZQU0l4TURBbElpQmlaV2RwYmowaU1ITWlJR1IxY2owaU16QnpJaUJ5WlhCbFlYUkRiM1Z1ZEQwaWFXNWtaV1pwYm1sMFpTSWdMejQ4TDNSbGVIUlFZWFJvUGp4MFpYaDBVR0YwYUNCemRHRnlkRTltWm5ObGREMGlMVFV3SlNJZ1ptbHNiRDBpZDJocGRHVWlJR1p2Ym5RdFptRnRhV3g1UFNJblEyOTFjbWxsY2lCT1pYY25MQ0J0YjI1dmMzQmhZMlVpSUdadmJuUXRjMmw2WlQwaU1UQndlQ0lnZUd4cGJtczZhSEpsWmowaUkzUmxlSFF0Y0dGMGFDMWhJajR3ZUdGaVkyUmxZV0pqWkdWbVlXSmpaR1ZtWVdKalpHVm1ZV0pqWkdWbVlXSmpaR1ZtWVdKalpHWWc0b0NpSUZWT1NTQThZVzVwYldGMFpTQmhaR1JwZEdsMlpUMGljM1Z0SWlCaGRIUnlhV0oxZEdWT1lXMWxQU0p6ZEdGeWRFOW1abk5sZENJZ1puSnZiVDBpTUNVaUlIUnZQU0l4TURBbElpQmlaV2RwYmowaU1ITWlJR1IxY2owaU16QnpJaUJ5WlhCbFlYUkRiM1Z1ZEQwaWFXNWtaV1pwYm1sMFpTSWdMejQ4TDNSbGVIUlFZWFJvUGp3dmRHVjRkRDQ4WnlCdFlYTnJQU0oxY213b0kyWmhaR1V0YzNsdFltOXNLU0krUEhKbFkzUWdabWxzYkQwaWJtOXVaU0lnZUQwaU1IQjRJaUI1UFNJd2NIZ2lJSGRwWkhSb1BTSXlPVEJ3ZUNJZ2FHVnBaMmgwUFNJeU1EQndlQ0lnTHo0Z1BIUmxlSFFnZVQwaU56QndlQ0lnZUQwaU16SndlQ0lnWm1sc2JEMGlkMmhwZEdVaUlHWnZiblF0Wm1GdGFXeDVQU0luUTI5MWNtbGxjaUJPWlhjbkxDQnRiMjV2YzNCaFkyVWlJR1p2Ym5RdGQyVnBaMmgwUFNJeU1EQWlJR1p2Ym5RdGMybDZaVDBpTXpad2VDSStWVTVKTDFkRlZFZzhMM1JsZUhRK1BIUmxlSFFnZVQwaU1URTFjSGdpSUhnOUlqTXljSGdpSUdacGJHdzlJbmRvYVhSbElpQm1iMjUwTFdaaGJXbHNlVDBpSjBOdmRYSnBaWElnVG1WM0p5d2diVzl1YjNOd1lXTmxJaUJtYjI1MExYZGxhV2RvZEQwaU1qQXdJaUJtYjI1MExYTnBlbVU5SWpNMmNIZ2lQakF1TURVbFBDOTBaWGgwUGp3dlp6NDhjbVZqZENCNFBTSXhOaUlnZVQwaU1UWWlJSGRwWkhSb1BTSXlOVGdpSUdobGFXZG9kRDBpTkRZNElpQnllRDBpTWpZaUlISjVQU0l5TmlJZ1ptbHNiRDBpY21kaVlTZ3dMREFzTUN3d0tTSWdjM1J5YjJ0bFBTSnlaMkpoS0RJMU5Td3lOVFVzTWpVMUxEQXVNaWtpSUM4K1BHY2diV0Z6YXowaWRYSnNLQ05tWVdSbExXUnZkMjRwSWlCemRIbHNaVDBpZEhKaGJuTm1iM0p0T25SeVlXNXpiR0YwWlNnM01uQjRMREU0T1hCNEtTSStQSEpsWTNRZ2VEMGlMVEUyY0hnaUlIazlJaTB4Tm5CNElpQjNhV1IwYUQwaU1UZ3djSGdpSUdobGFXZG9kRDBpTVRnd2NIZ2lJR1pwYkd3OUltNXZibVVpSUM4K1BIQmhkR2dnWkQwaVRURWdNVU01SURneElEWTFJREV6TnlBeE5EVWdNVFExSWlCemRISnZhMlU5SW5KblltRW9NQ3d3TERBc01DNHpLU0lnYzNSeWIydGxMWGRwWkhSb1BTSXpNbkI0SWlCbWFXeHNQU0p1YjI1bElpQnpkSEp2YTJVdGJHbHVaV05oY0QwaWNtOTFibVFpSUM4K1BDOW5QanhuSUcxaGMyczlJblZ5YkNnalptRmtaUzFrYjNkdUtTSWdjM1I1YkdVOUluUnlZVzV6Wm05eWJUcDBjbUZ1YzJ4aGRHVW9Oekp3ZUN3eE9EbHdlQ2tpUGp4eVpXTjBJSGc5SWkweE5uQjRJaUI1UFNJdE1UWndlQ0lnZDJsa2RHZzlJakU0TUhCNElpQm9aV2xuYUhROUlqRTRNSEI0SWlCbWFXeHNQU0p1YjI1bElpQXZQanh3WVhSb0lHUTlJazB4SURGRE9TQTRNU0EyTlNBeE16Y2dNVFExSURFME5TSWdjM1J5YjJ0bFBTSnlaMkpoS0RJMU5Td3lOVFVzTWpVMUxERXBJaUJtYVd4c1BTSnViMjVsSWlCemRISnZhMlV0YkdsdVpXTmhjRDBpY205MWJtUWlJQzgrUEM5blBqeGphWEpqYkdVZ1kzZzlJamN6Y0hnaUlHTjVQU0l4T1RCd2VDSWdjajBpTkhCNElpQm1hV3hzUFNKM2FHbDBaU0lnTHo0OFkybHlZMnhsSUdONFBTSTNNM0I0SWlCamVUMGlNVGt3Y0hnaUlISTlJakkwY0hnaUlHWnBiR3c5SW01dmJtVWlJSE4wY205clpUMGlkMmhwZEdVaUlDOCtJRHhuSUhOMGVXeGxQU0owY21GdWMyWnZjbTA2ZEhKaGJuTnNZWFJsS0RJNWNIZ3NJRE00TkhCNEtTSStQSEpsWTNRZ2QybGtkR2c5SWpZemNIZ2lJR2hsYVdkb2REMGlNalp3ZUNJZ2NuZzlJamh3ZUNJZ2NuazlJamh3ZUNJZ1ptbHNiRDBpY21kaVlTZ3dMREFzTUN3d0xqWXBJaUF2UGp4MFpYaDBJSGc5SWpFeWNIZ2lJSGs5SWpFM2NIZ2lJR1p2Ym5RdFptRnRhV3g1UFNJblEyOTFjbWxsY2lCT1pYY25MQ0J0YjI1dmMzQmhZMlVpSUdadmJuUXRjMmw2WlQwaU1USndlQ0lnWm1sc2JEMGlkMmhwZEdVaVBqeDBjM0JoYmlCbWFXeHNQU0p5WjJKaEtESTFOU3d5TlRVc01qVTFMREF1TmlraVBrbEVPaUE4TDNSemNHRnVQakU4TDNSbGVIUStQQzluUGlBOFp5QnpkSGxzWlQwaWRISmhibk5tYjNKdE9uUnlZVzV6YkdGMFpTZ3lPWEI0TENBME1UUndlQ2tpUGp4eVpXTjBJSGRwWkhSb1BTSXhNRFZ3ZUNJZ2FHVnBaMmgwUFNJeU5uQjRJaUJ5ZUQwaU9IQjRJaUJ5ZVQwaU9IQjRJaUJtYVd4c1BTSnlaMkpoS0RBc01Dd3dMREF1TmlraUlDOCtQSFJsZUhRZ2VEMGlNVEp3ZUNJZ2VUMGlNVGR3ZUNJZ1ptOXVkQzFtWVcxcGJIazlJaWREYjNWeWFXVnlJRTVsZHljc0lHMXZibTl6Y0dGalpTSWdabTl1ZEMxemFYcGxQU0l4TW5CNElpQm1hV3hzUFNKM2FHbDBaU0krUEhSemNHRnVJR1pwYkd3OUluSm5ZbUVvTWpVMUxESTFOU3d5TlRVc01DNDJLU0krVFdsdUlGUnBZMnM2SUR3dmRITndZVzQrTUR3dmRHVjRkRDQ4TDJjK0lEeG5JSE4wZVd4bFBTSjBjbUZ1YzJadmNtMDZkSEpoYm5Oc1lYUmxLREk1Y0hnc0lEUTBOSEI0S1NJK1BISmxZM1FnZDJsa2RHZzlJakV5Tm5CNElpQm9aV2xuYUhROUlqSTJjSGdpSUhKNFBTSTRjSGdpSUhKNVBTSTRjSGdpSUdacGJHdzlJbkpuWW1Fb01Dd3dMREFzTUM0MktTSWdMejQ4ZEdWNGRDQjRQU0l4TW5CNElpQjVQU0l4TjNCNElpQm1iMjUwTFdaaGJXbHNlVDBpSjBOdmRYSnBaWElnVG1WM0p5d2diVzl1YjNOd1lXTmxJaUJtYjI1MExYTnBlbVU5SWpFeWNIZ2lJR1pwYkd3OUluZG9hWFJsSWo0OGRITndZVzRnWm1sc2JEMGljbWRpWVNneU5UVXNNalUxTERJMU5Td3dMallwSWo1TllYZ2dWR2xqYXpvZ1BDOTBjM0JoYmo0eE1EQXdQQzkwWlhoMFBqd3ZaejQ4WnlCemRIbHNaVDBpZEhKaGJuTm1iM0p0T25SeVlXNXpiR0YwWlNneU1qWndlQ3dnTkRNemNIZ3BJajQ4Y21WamRDQjNhV1IwYUQwaU16WndlQ0lnYUdWcFoyaDBQU0l6Tm5CNElpQnllRDBpT0hCNElpQnllVDBpT0hCNElpQm1hV3hzUFNKdWIyNWxJaUJ6ZEhKdmEyVTlJbkpuWW1Fb01qVTFMREkxTlN3eU5UVXNNQzR5S1NJZ0x6NDhjR0YwYUNCemRISnZhMlV0YkdsdVpXTmhjRDBpY205MWJtUWlJR1E5SWswNElEbERPQzR3TURBd05DQXlNaTQ1TkRrMElERTJMakl3T1RrZ01qZ2dNamNnTWpnaUlHWnBiR3c5SW01dmJtVWlJSE4wY205clpUMGlkMmhwZEdVaUlDOCtQR05wY21Oc1pTQnpkSGxzWlQwaWRISmhibk5tYjNKdE9uUnlZVzV6YkdGMFpUTmtLREV6Y0hnc0lESXpjSGdzSURCd2VDa2lJR040UFNJd2NIZ2lJR041UFNJd2NIZ2lJSEk5SWpSd2VDSWdabWxzYkQwaWQyaHBkR1VpTHo0OEwyYytQR2NnYzNSNWJHVTlJblJ5WVc1elptOXliVHAwY21GdWMyeGhkR1VvTWpJMmNIZ3NJRE01TW5CNEtTSStQSEpsWTNRZ2QybGtkR2c5SWpNMmNIZ2lJR2hsYVdkb2REMGlNelp3ZUNJZ2NuZzlJamh3ZUNJZ2NuazlJamh3ZUNJZ1ptbHNiRDBpYm05dVpTSWdjM1J5YjJ0bFBTSnlaMkpoS0RJMU5Td3lOVFVzTWpVMUxEQXVNaWtpSUM4K1BHYytQSEJoZEdnZ2MzUjViR1U5SW5SeVlXNXpabTl5YlRwMGNtRnVjMnhoZEdVb05uQjRMRFp3ZUNraUlHUTlJazB4TWlBd1RERXlMalkxTWpJZ09TNDFOalU0TjB3eE9DQXhMall3TnpkTU1UTXVOemd4T1NBeE1DNHlNVGd4VERJeUxqTTVNak1nTmt3eE5DNDBNelF4SURFeExqTTBOemhNTWpRZ01USk1NVFF1TkRNME1TQXhNaTQyTlRJeVRESXlMak01TWpNZ01UaE1NVE11TnpneE9TQXhNeTQzT0RFNVRERTRJREl5TGpNNU1qTk1NVEl1TmpVeU1pQXhOQzQwTXpReFRERXlJREkwVERFeExqTTBOemdnTVRRdU5ETTBNVXcySURJeUxqTTVNak5NTVRBdU1qRTRNU0F4TXk0M09ERTVUREV1TmpBM055QXhPRXc1TGpVMk5UZzNJREV5TGpZMU1qSk1NQ0F4TWt3NUxqVTJOVGczSURFeExqTTBOemhNTVM0Mk1EYzNJRFpNTVRBdU1qRTRNU0F4TUM0eU1UZ3hURFlnTVM0Mk1EYzNUREV4TGpNME56Z2dPUzQxTmpVNE4wd3hNaUF3V2lJZ1ptbHNiRDBpZDJocGRHVWlJQzgrUEdGdWFXMWhkR1ZVY21GdWMyWnZjbTBnWVhSMGNtbGlkWFJsVG1GdFpUMGlkSEpoYm5ObWIzSnRJaUIwZVhCbFBTSnliM1JoZEdVaUlHWnliMjA5SWpBZ01UZ2dNVGdpSUhSdlBTSXpOakFnTVRnZ01UZ2lJR1IxY2owaU1UQnpJaUJ5WlhCbFlYUkRiM1Z1ZEQwaWFXNWtaV1pwYm1sMFpTSXZQand2Wno0OEwyYytQQzl6ZG1jKyJ9"`; + +exports[`NFTDescriptor #svgImage matches the current snapshot 1`] = `" 0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf • WETH 0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf • WETH 0x1234567890123456789123456789012345678901 • UNI 0x1234567890123456789123456789012345678901 • UNI UNI/WETH0.05% ID: 123 Min Tick: -1000 Max Tick: 2000"`; diff --git a/lib/v3-periphery/test/__snapshots__/NFTDescriptor.svg b/lib/v3-periphery/test/__snapshots__/NFTDescriptor.svg new file mode 100644 index 0000000..d09c263 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/NFTDescriptor.svg @@ -0,0 +1 @@ + 0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf • WETH 0xabcdeabcdefabcdefabcdefabcdefabcdefabcdf • WETH 0x1234567890123456789123456789012345678901 • UNI 0x1234567890123456789123456789012345678901 • UNI UNI/WETH0.05% ID: 123 Min Tick: -1000 Max Tick: 2000 \ No newline at end of file diff --git a/lib/v3-periphery/test/__snapshots__/NonfungiblePositionManager.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/NonfungiblePositionManager.spec.ts.snap new file mode 100644 index 0000000..488d514 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/NonfungiblePositionManager.spec.ts.snap @@ -0,0 +1,41 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NonfungiblePositionManager #burn gas 1`] = `66076`; + +exports[`NonfungiblePositionManager #collect gas transfers both 1`] = `118970`; + +exports[`NonfungiblePositionManager #collect gas transfers token0 only 1`] = `111897`; + +exports[`NonfungiblePositionManager #collect gas transfers token1 only 1`] = `112104`; + +exports[`NonfungiblePositionManager #createAndInitializePoolIfNecessary gas 1`] = `4612043`; + +exports[`NonfungiblePositionManager #decreaseLiquidity gas complete decrease 1`] = `148666`; + +exports[`NonfungiblePositionManager #decreaseLiquidity gas partial decrease 1`] = `161366`; + +exports[`NonfungiblePositionManager #increaseLiquidity gas 1`] = `176626`; + +exports[`NonfungiblePositionManager #mint gas first mint for pool 1`] = `619406`; + +exports[`NonfungiblePositionManager #mint gas first mint for pool using eth with non-zero refund 1`] = `629749`; + +exports[`NonfungiblePositionManager #mint gas first mint for pool using eth with zero refund 1`] = `622524`; + +exports[`NonfungiblePositionManager #mint gas mint for same pool, different ticks 1`] = `451862`; + +exports[`NonfungiblePositionManager #mint gas mint on same ticks 1`] = `344732`; + +exports[`NonfungiblePositionManager #permit owned by eoa gas 1`] = `64492`; + +exports[`NonfungiblePositionManager #permit owned by verifying contract gas 1`] = `68289`; + +exports[`NonfungiblePositionManager #positions gas 1`] = `19890`; + +exports[`NonfungiblePositionManager #transferFrom gas 1`] = `109691`; + +exports[`NonfungiblePositionManager #transferFrom gas comes from approved 1`] = `108291`; + +exports[`NonfungiblePositionManager bytecode size 1`] = `24450`; + +exports[`NonfungiblePositionManager multicall exit gas 1`] = `228718`; diff --git a/lib/v3-periphery/test/__snapshots__/OracleLibrary.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/OracleLibrary.spec.ts.snap new file mode 100644 index 0000000..e8fd682 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/OracleLibrary.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`OracleLibrary #getQuoteAtTick gas test 1`] = `1205`; diff --git a/lib/v3-periphery/test/__snapshots__/PairFlash.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/PairFlash.spec.ts.snap new file mode 100644 index 0000000..558e03e --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/PairFlash.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PairFlash test flash gas 1`] = `349643`; diff --git a/lib/v3-periphery/test/__snapshots__/Path.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/Path.spec.ts.snap new file mode 100644 index 0000000..e450df9 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/Path.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Path gas cost 1`] = `451`; diff --git a/lib/v3-periphery/test/__snapshots__/PeripheryImmutableState.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/PeripheryImmutableState.spec.ts.snap new file mode 100644 index 0000000..b79d75f --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/PeripheryImmutableState.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PeripheryImmutableState bytecode size 1`] = `193`; diff --git a/lib/v3-periphery/test/__snapshots__/PoolAddress.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/PoolAddress.spec.ts.snap new file mode 100644 index 0000000..7471415 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/PoolAddress.spec.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PoolAddress #computeAddress gas cost 1`] = `642`; + +exports[`PoolAddress #computeAddress matches example from core repo 1`] = `"0x03D8bab195A5BC23d249693F53dfA0e358F2650D"`; diff --git a/lib/v3-periphery/test/__snapshots__/PositionValue.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/PositionValue.spec.ts.snap new file mode 100644 index 0000000..3d8f9d4 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/PositionValue.spec.ts.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PositionValue #fees when price is above the position range gas 1`] = `47658`; + +exports[`PositionValue #fees when price is below the position range gas 1`] = `47626`; + +exports[`PositionValue #fees when price is within the position range gas 1`] = `53216`; + +exports[`PositionValue #principal gas 1`] = `23001`; + +exports[`PositionValue #total gas 1`] = `59777`; diff --git a/lib/v3-periphery/test/__snapshots__/QuoterV2.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/QuoterV2.spec.ts.snap new file mode 100644 index 0000000..ccb9341 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/QuoterV2.spec.ts.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 -> 1 1`] = `277146`; + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 cross 0 tick, starting tick initialized 1`] = `123797`; + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 cross 0 tick, starting tick not initialized 1`] = `100962`; + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 cross 1 tick 1`] = `144724`; + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 cross 2 tick 1`] = `182321`; + +exports[`QuoterV2 quotes #quoteExactInput 0 -> 2 cross 2 tick where after is initialized 1`] = `144762`; + +exports[`QuoterV2 quotes #quoteExactInput 2 -> 0 cross 0 tick, starting tick initialized 1`] = `97654`; + +exports[`QuoterV2 quotes #quoteExactInput 2 -> 0 cross 0 tick, starting tick not initialized 1`] = `93779`; + +exports[`QuoterV2 quotes #quoteExactInput 2 -> 0 cross 2 1`] = `175133`; + +exports[`QuoterV2 quotes #quoteExactInput 2 -> 0 cross 2 where tick after is initialized 1`] = `175141`; + +exports[`QuoterV2 quotes #quoteExactInput 2 -> 1 1`] = `97329`; + +exports[`QuoterV2 quotes #quoteExactInputSingle 0 -> 2 1`] = `182303`; + +exports[`QuoterV2 quotes #quoteExactInputSingle 2 -> 0 1`] = `175105`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 -> 1 1`] = `276746`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 cross 0 tick starting tick initialized 1`] = `123352`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 cross 0 tick starting tick not initialized 1`] = `100537`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 cross 1 tick 1`] = `144010`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 cross 2 tick 1`] = `181363`; + +exports[`QuoterV2 quotes #quoteExactOutput 0 -> 2 cross 2 where tick after is initialized 1`] = `144048`; + +exports[`QuoterV2 quotes #quoteExactOutput 2 -> 0 cross 1 tick 1`] = `137858`; + +exports[`QuoterV2 quotes #quoteExactOutput 2 -> 0 cross 2 ticks 1`] = `175203`; + +exports[`QuoterV2 quotes #quoteExactOutput 2 -> 0 cross 2 where tick after is initialized 1`] = `175197`; + +exports[`QuoterV2 quotes #quoteExactOutput 2 -> 1 1`] = `97870`; + +exports[`QuoterV2 quotes #quoteExactOutputSingle 0 -> 1 1`] = `105200`; + +exports[`QuoterV2 quotes #quoteExactOutputSingle 1 -> 0 1`] = `98511`; diff --git a/lib/v3-periphery/test/__snapshots__/SwapRouter.gas.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/SwapRouter.gas.spec.ts.snap new file mode 100644 index 0000000..ba9a0a9 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/SwapRouter.gas.spec.ts.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SwapRouter gas tests #exactInput 0 -> 1 -> 2 1`] = `172498`; + +exports[`SwapRouter gas tests #exactInput 0 -> 1 1`] = `107759`; + +exports[`SwapRouter gas tests #exactInput 0 -> 1 minimal 1`] = `98059`; + +exports[`SwapRouter gas tests #exactInput 0 -> WETH9 1`] = `127578`; + +exports[`SwapRouter gas tests #exactInput 2 trades (via router) 1`] = `188814`; + +exports[`SwapRouter gas tests #exactInput 3 trades (directly to sender) 1`] = `258601`; + +exports[`SwapRouter gas tests #exactInput WETH9 -> 0 1`] = `106083`; + +exports[`SwapRouter gas tests #exactInputSingle 0 -> 1 1`] = `107180`; + +exports[`SwapRouter gas tests #exactInputSingle 0 -> WETH9 1`] = `126993`; + +exports[`SwapRouter gas tests #exactInputSingle WETH9 -> 0 1`] = `105504`; + +exports[`SwapRouter gas tests #exactOutput 0 -> 1 -> 2 1`] = `169275`; + +exports[`SwapRouter gas tests #exactOutput 0 -> 1 1`] = `111757`; + +exports[`SwapRouter gas tests #exactOutput 0 -> WETH9 1`] = `128821`; + +exports[`SwapRouter gas tests #exactOutput WETH9 -> 0 1`] = `119691`; + +exports[`SwapRouter gas tests #exactOutputSingle 0 -> 1 1`] = `111967`; + +exports[`SwapRouter gas tests #exactOutputSingle 0 -> WETH9 1`] = `129031`; + +exports[`SwapRouter gas tests #exactOutputSingle WETH9 -> 0 1`] = `114366`; + +exports[`SwapRouter gas tests 3 trades (directly to sender) 1`] = `179440`; diff --git a/lib/v3-periphery/test/__snapshots__/SwapRouter.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/SwapRouter.spec.ts.snap new file mode 100644 index 0000000..d123c7d --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/SwapRouter.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SwapRouter bytecode size 1`] = `12160`; diff --git a/lib/v3-periphery/test/__snapshots__/TickLens.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/TickLens.spec.ts.snap new file mode 100644 index 0000000..3bdf4fc --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/TickLens.spec.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TickLens #getPopulatedTicksInWord fully populated ticks 1`] = `2803889`; + +exports[`TickLens #getPopulatedTicksInWord gas for single populated tick 1`] = `55664`; diff --git a/lib/v3-periphery/test/__snapshots__/V3Migrator.spec.ts.snap b/lib/v3-periphery/test/__snapshots__/V3Migrator.spec.ts.snap new file mode 100644 index 0000000..0248aa8 --- /dev/null +++ b/lib/v3-periphery/test/__snapshots__/V3Migrator.spec.ts.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`V3Migrator #migrate gas 1`] = `730625`; diff --git a/lib/v3-periphery/test/contracts/WETH9.json b/lib/v3-periphery/test/contracts/WETH9.json new file mode 100644 index 0000000..68ec24f --- /dev/null +++ b/lib/v3-periphery/test/contracts/WETH9.json @@ -0,0 +1,156 @@ +{ + "bytecode": "60606040526040805190810160405280600d81526020017f57726170706564204574686572000000000000000000000000000000000000008152506000908051906020019061004f9291906100c8565b506040805190810160405280600481526020017f57455448000000000000000000000000000000000000000000000000000000008152506001908051906020019061009b9291906100c8565b506012600260006101000a81548160ff021916908360ff16021790555034156100c357600080fd5b61016d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010957805160ff1916838001178555610137565b82800160010185558215610137579182015b8281111561013657825182559160200191906001019061011b565b5b5090506101449190610148565b5090565b61016a91905b8082111561016657600081600090555060010161014e565b5090565b90565b610c348061017c6000396000f3006060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b9578063095ea7b31461014757806318160ddd146101a157806323b872dd146101ca5780632e1a7d4d14610243578063313ce5671461026657806370a082311461029557806395d89b41146102e2578063a9059cbb14610370578063d0e30db0146103ca578063dd62ed3e146103d4575b6100b7610440565b005b34156100c457600080fd5b6100cc6104dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561010c5780820151818401526020810190506100f1565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610187600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061057b565b604051808215151515815260200191505060405180910390f35b34156101ac57600080fd5b6101b461066d565b6040518082815260200191505060405180910390f35b34156101d557600080fd5b610229600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061068c565b604051808215151515815260200191505060405180910390f35b341561024e57600080fd5b61026460048080359060200190919050506109d9565b005b341561027157600080fd5b610279610b05565b604051808260ff1660ff16815260200191505060405180910390f35b34156102a057600080fd5b6102cc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b18565b6040518082815260200191505060405180910390f35b34156102ed57600080fd5b6102f5610b30565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033557808201518184015260208101905061031a565b50505050905090810190601f1680156103625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561037b57600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bce565b604051808215151515815260200191505060405180910390f35b6103d2610440565b005b34156103df57600080fd5b61042a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610be3565b6040518082815260200191505060405180910390f35b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a2565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105735780601f1061054857610100808354040283529160200191610573565b820191906000526020600020905b81548152906001019060200180831161055657829003601f168201915b505050505081565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156106dc57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156107b457507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156108cf5781600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561084457600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a2757600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ab457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65826040518082815260200191505060405180910390a250565b600260009054906101000a900460ff1681565b60036020528060005260406000206000915090505481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc65780601f10610b9b57610100808354040283529160200191610bc6565b820191906000526020600020905b815481529060010190602001808311610ba957829003601f168201915b505050505081565b6000610bdb33848461068c565b905092915050565b60046020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820deb4c2ccab3c2fdca32ab3f46728389c2fe2c165d5fafa07661e4e004f6c344a0029", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [{ "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "guy", "type": "address" }, + { "name": "wad", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "src", "type": "address" }, + { "name": "dst", "type": "address" }, + { "name": "wad", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "name": "wad", "type": "uint256" }], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [{ "name": "", "type": "uint8" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "name": "", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [{ "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "dst", "type": "address" }, + { "name": "wad", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "name": "", "type": "address" }, + { "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { "payable": true, "stateMutability": "payable", "type": "fallback" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "src", "type": "address" }, + { "indexed": true, "name": "guy", "type": "address" }, + { "indexed": false, "name": "wad", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "src", "type": "address" }, + { "indexed": true, "name": "dst", "type": "address" }, + { "indexed": false, "name": "wad", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "dst", "type": "address" }, + { "indexed": false, "name": "wad", "type": "uint256" } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "src", "type": "address" }, + { "indexed": false, "name": "wad", "type": "uint256" } + ], + "name": "Withdrawal", + "type": "event" + } + ] +} diff --git a/lib/v3-periphery/test/shared/base64.ts b/lib/v3-periphery/test/shared/base64.ts new file mode 100644 index 0000000..3a17c2f --- /dev/null +++ b/lib/v3-periphery/test/shared/base64.ts @@ -0,0 +1,7 @@ +export function base64Encode(str: string): string { + return Buffer.from(str, 'utf8').toString('base64') +} + +export function base64Decode(str: string): string { + return Buffer.from(str, 'base64').toString('utf8') +} diff --git a/lib/v3-periphery/test/shared/completeFixture.ts b/lib/v3-periphery/test/shared/completeFixture.ts new file mode 100644 index 0000000..6f3a8e9 --- /dev/null +++ b/lib/v3-periphery/test/shared/completeFixture.ts @@ -0,0 +1,63 @@ +import { Fixture } from 'ethereum-waffle' +import { ethers } from 'hardhat' +import { v3RouterFixture } from './externalFixtures' +import { constants } from 'ethers' +import { + IWETH9, + MockTimeNonfungiblePositionManager, + MockTimeSwapRouter, + NonfungibleTokenPositionDescriptor, + TestERC20, + IUniswapV3Factory, +} from '../../typechain' + +const completeFixture: Fixture<{ + weth9: IWETH9 + factory: IUniswapV3Factory + router: MockTimeSwapRouter + nft: MockTimeNonfungiblePositionManager + nftDescriptor: NonfungibleTokenPositionDescriptor + tokens: [TestERC20, TestERC20, TestERC20] +}> = async ([wallet], provider) => { + const { weth9, factory, router } = await v3RouterFixture([wallet], provider) + + const tokenFactory = await ethers.getContractFactory('TestERC20') + const tokens: [TestERC20, TestERC20, TestERC20] = [ + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, // do not use maxu256 to avoid overflowing + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + (await tokenFactory.deploy(constants.MaxUint256.div(2))) as TestERC20, + ] + + const nftDescriptorLibraryFactory = await ethers.getContractFactory('NFTDescriptor') + const nftDescriptorLibrary = await nftDescriptorLibraryFactory.deploy() + const positionDescriptorFactory = await ethers.getContractFactory('NonfungibleTokenPositionDescriptor', { + libraries: { + NFTDescriptor: nftDescriptorLibrary.address, + }, + }) + const nftDescriptor = (await positionDescriptorFactory.deploy( + tokens[0].address, + // 'ETH' as a bytes32 string + '0x4554480000000000000000000000000000000000000000000000000000000000' + )) as NonfungibleTokenPositionDescriptor + + const positionManagerFactory = await ethers.getContractFactory('MockTimeNonfungiblePositionManager') + const nft = (await positionManagerFactory.deploy( + factory.address, + weth9.address, + nftDescriptor.address + )) as MockTimeNonfungiblePositionManager + + tokens.sort((a, b) => (a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1)) + + return { + weth9, + factory, + router, + tokens, + nft, + nftDescriptor, + } +} + +export default completeFixture diff --git a/lib/v3-periphery/test/shared/computePoolAddress.ts b/lib/v3-periphery/test/shared/computePoolAddress.ts new file mode 100644 index 0000000..fde8c8a --- /dev/null +++ b/lib/v3-periphery/test/shared/computePoolAddress.ts @@ -0,0 +1,22 @@ +import { bytecode } from '@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json' +import { utils } from 'ethers' + +export const POOL_BYTECODE_HASH = utils.keccak256(bytecode) + +export function computePoolAddress(factoryAddress: string, [tokenA, tokenB]: [string, string], fee: number): string { + const [token0, token1] = tokenA.toLowerCase() < tokenB.toLowerCase() ? [tokenA, tokenB] : [tokenB, tokenA] + const constructorArgumentsEncoded = utils.defaultAbiCoder.encode( + ['address', 'address', 'uint24'], + [token0, token1, fee] + ) + const create2Inputs = [ + '0xff', + factoryAddress, + // salt + utils.keccak256(constructorArgumentsEncoded), + // init code hash + POOL_BYTECODE_HASH, + ] + const sanitizedInputs = `0x${create2Inputs.map((i) => i.slice(2)).join('')}` + return utils.getAddress(`0x${utils.keccak256(sanitizedInputs).slice(-40)}`) +} diff --git a/lib/v3-periphery/test/shared/constants.ts b/lib/v3-periphery/test/shared/constants.ts new file mode 100644 index 0000000..df044c9 --- /dev/null +++ b/lib/v3-periphery/test/shared/constants.ts @@ -0,0 +1,15 @@ +import { BigNumber } from 'ethers' + +export const MaxUint128 = BigNumber.from(2).pow(128).sub(1) + +export enum FeeAmount { + LOW = 500, + MEDIUM = 3000, + HIGH = 10000, +} + +export const TICK_SPACINGS: { [amount in FeeAmount]: number } = { + [FeeAmount.LOW]: 10, + [FeeAmount.MEDIUM]: 60, + [FeeAmount.HIGH]: 200, +} diff --git a/lib/v3-periphery/test/shared/encodePriceSqrt.ts b/lib/v3-periphery/test/shared/encodePriceSqrt.ts new file mode 100644 index 0000000..f95cd23 --- /dev/null +++ b/lib/v3-periphery/test/shared/encodePriceSqrt.ts @@ -0,0 +1,16 @@ +import bn from 'bignumber.js' +import { BigNumber, BigNumberish } from 'ethers' + +bn.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 }) + +// returns the sqrt price as a 64x96 +export function encodePriceSqrt(reserve1: BigNumberish, reserve0: BigNumberish): BigNumber { + return BigNumber.from( + new bn(reserve1.toString()) + .div(reserve0.toString()) + .sqrt() + .multipliedBy(new bn(2).pow(96)) + .integerValue(3) + .toString() + ) +} diff --git a/lib/v3-periphery/test/shared/expandTo18Decimals.ts b/lib/v3-periphery/test/shared/expandTo18Decimals.ts new file mode 100644 index 0000000..30d2864 --- /dev/null +++ b/lib/v3-periphery/test/shared/expandTo18Decimals.ts @@ -0,0 +1,5 @@ +import { BigNumber } from 'ethers' + +export function expandTo18Decimals(n: number): BigNumber { + return BigNumber.from(n).mul(BigNumber.from(10).pow(18)) +} diff --git a/lib/v3-periphery/test/shared/expect.ts b/lib/v3-periphery/test/shared/expect.ts new file mode 100644 index 0000000..ac8f19b --- /dev/null +++ b/lib/v3-periphery/test/shared/expect.ts @@ -0,0 +1,8 @@ +import { expect, use } from 'chai' +import { solidity } from 'ethereum-waffle' +import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' + +use(solidity) +use(jestSnapshotPlugin()) + +export { expect } diff --git a/lib/v3-periphery/test/shared/externalFixtures.ts b/lib/v3-periphery/test/shared/externalFixtures.ts new file mode 100644 index 0000000..4ac7603 --- /dev/null +++ b/lib/v3-periphery/test/shared/externalFixtures.ts @@ -0,0 +1,57 @@ +import { + abi as FACTORY_ABI, + bytecode as FACTORY_BYTECODE, +} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json' +import { abi as FACTORY_V2_ABI, bytecode as FACTORY_V2_BYTECODE } from '@uniswap/v2-core/build/UniswapV2Factory.json' +import { Fixture } from 'ethereum-waffle' +import { ethers, waffle } from 'hardhat' +import { IUniswapV3Factory, IWETH9, MockTimeSwapRouter } from '../../typechain' + +import WETH9 from '../contracts/WETH9.json' +import { Contract } from '@ethersproject/contracts' +import { constants } from 'ethers' + +const wethFixture: Fixture<{ weth9: IWETH9 }> = async ([wallet]) => { + const weth9 = (await waffle.deployContract(wallet, { + bytecode: WETH9.bytecode, + abi: WETH9.abi, + })) as IWETH9 + + return { weth9 } +} + +export const v2FactoryFixture: Fixture<{ factory: Contract }> = async ([wallet]) => { + const factory = await waffle.deployContract( + wallet, + { + bytecode: FACTORY_V2_BYTECODE, + abi: FACTORY_V2_ABI, + }, + [constants.AddressZero] + ) + + return { factory } +} + +const v3CoreFactoryFixture: Fixture = async ([wallet]) => { + return (await waffle.deployContract(wallet, { + bytecode: FACTORY_BYTECODE, + abi: FACTORY_ABI, + })) as IUniswapV3Factory +} + +export const v3RouterFixture: Fixture<{ + weth9: IWETH9 + factory: IUniswapV3Factory + router: MockTimeSwapRouter +}> = async ([wallet], provider) => { + const { weth9 } = await wethFixture([wallet], provider) + const factory = await v3CoreFactoryFixture([wallet], provider) + + const router = (await (await ethers.getContractFactory('MockTimeSwapRouter')).deploy( + factory.address, + weth9.address + )) as MockTimeSwapRouter + + return { factory, weth9, router } +} diff --git a/lib/v3-periphery/test/shared/extractJSONFromURI.ts b/lib/v3-periphery/test/shared/extractJSONFromURI.ts new file mode 100644 index 0000000..47105be --- /dev/null +++ b/lib/v3-periphery/test/shared/extractJSONFromURI.ts @@ -0,0 +1,5 @@ +export function extractJSONFromURI(uri: string): { name: string; description: string; image: string } { + const encodedJSON = uri.substr('data:application/json;base64,'.length) + const decodedJSON = Buffer.from(encodedJSON, 'base64').toString('utf8') + return JSON.parse(decodedJSON) +} diff --git a/lib/v3-periphery/test/shared/formatSqrtRatioX96.spec.ts b/lib/v3-periphery/test/shared/formatSqrtRatioX96.spec.ts new file mode 100644 index 0000000..61e9661 --- /dev/null +++ b/lib/v3-periphery/test/shared/formatSqrtRatioX96.spec.ts @@ -0,0 +1,30 @@ +import { encodePriceSqrt } from './encodePriceSqrt' +import { expect } from './expect' +import { formatSqrtRatioX96 } from './formatSqrtRatioX96' + +describe('#formatSqrtRatioX96', () => { + it('is correct for 9_999_999/10_000_000', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(9_999_999, 10_000_000))).to.eq('1.0000') + }) + it('is correct for 9_999_999/1', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(9_999_999, 1))).to.eq('10000000') + }) + it('is correct for 1/3', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(1, 3))).to.eq('0.33333') + }) + it('is correct for 100/3', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(100, 3))).to.eq('33.333') + }) + it('is correct for 1_000_000/3', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(1_000_000, 3))).to.eq('333330') + }) + it('1e-18 still prints 5 sig figs', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(1, 1e18), 18, 18)).to.eq('0.0000000000000000010000') + }) + it('accounts for decimal differences', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(1e6, 1e18), 18, 6)).to.eq('1.0000') + }) + it('accounts for decimal differences in reverse', () => { + expect(formatSqrtRatioX96(encodePriceSqrt(1e18, 1e6), 6, 18)).to.eq('1.0000') + }) +}) diff --git a/lib/v3-periphery/test/shared/formatSqrtRatioX96.ts b/lib/v3-periphery/test/shared/formatSqrtRatioX96.ts new file mode 100644 index 0000000..7f93d55 --- /dev/null +++ b/lib/v3-periphery/test/shared/formatSqrtRatioX96.ts @@ -0,0 +1,30 @@ +import { BigNumber } from 'ethers' +import Decimal from 'decimal.js' + +const TWO = BigNumber.from(2) +const TEN = BigNumber.from(10) +const FIVE_SIG_FIGS_POW = new Decimal(10).pow(5) + +export function formatSqrtRatioX96( + sqrtRatioX96: BigNumber | number, + decimalsToken0: number = 18, + decimalsToken1: number = 18 +): string { + Decimal.set({ toExpPos: 9_999_999, toExpNeg: -9_999_999 }) + + let ratioNum = ((parseInt(sqrtRatioX96.toString()) / 2 ** 96) ** 2).toPrecision(5) + let ratio = new Decimal(ratioNum.toString()) + + // adjust for decimals + if (decimalsToken1 < decimalsToken0) { + ratio = ratio.mul(TEN.pow(decimalsToken0 - decimalsToken1).toString()) + } else if (decimalsToken0 < decimalsToken1) { + ratio = ratio.div(TEN.pow(decimalsToken1 - decimalsToken0).toString()) + } + + if (ratio.lessThan(FIVE_SIG_FIGS_POW)) { + return ratio.toPrecision(5) + } + + return ratio.toString() +} diff --git a/lib/v3-periphery/test/shared/getPermitNFTSignature.ts b/lib/v3-periphery/test/shared/getPermitNFTSignature.ts new file mode 100644 index 0000000..697af96 --- /dev/null +++ b/lib/v3-periphery/test/shared/getPermitNFTSignature.ts @@ -0,0 +1,57 @@ +import { BigNumber, BigNumberish, constants, Signature, Wallet } from 'ethers' +import { splitSignature } from 'ethers/lib/utils' +import { NonfungiblePositionManager } from '../../typechain' + +export default async function getPermitNFTSignature( + wallet: Wallet, + positionManager: NonfungiblePositionManager, + spender: string, + tokenId: BigNumberish, + deadline: BigNumberish = constants.MaxUint256, + permitConfig?: { nonce?: BigNumberish; name?: string; chainId?: number; version?: string } +): Promise { + const [nonce, name, version, chainId] = await Promise.all([ + permitConfig?.nonce ?? positionManager.positions(tokenId).then((p) => p.nonce), + permitConfig?.name ?? positionManager.name(), + permitConfig?.version ?? '1', + permitConfig?.chainId ?? wallet.getChainId(), + ]) + + return splitSignature( + await wallet._signTypedData( + { + name, + version, + chainId, + verifyingContract: positionManager.address, + }, + { + Permit: [ + { + name: 'spender', + type: 'address', + }, + { + name: 'tokenId', + type: 'uint256', + }, + { + name: 'nonce', + type: 'uint256', + }, + { + name: 'deadline', + type: 'uint256', + }, + ], + }, + { + owner: wallet.address, + spender, + tokenId, + nonce, + deadline, + } + ) + ) +} diff --git a/lib/v3-periphery/test/shared/path.ts b/lib/v3-periphery/test/shared/path.ts new file mode 100644 index 0000000..99418b1 --- /dev/null +++ b/lib/v3-periphery/test/shared/path.ts @@ -0,0 +1,61 @@ +import { utils } from 'ethers' +import { FeeAmount } from './constants' + +const ADDR_SIZE = 20 +const FEE_SIZE = 3 +const OFFSET = ADDR_SIZE + FEE_SIZE +const DATA_SIZE = OFFSET + ADDR_SIZE + +export function encodePath(path: string[], fees: FeeAmount[]): string { + if (path.length != fees.length + 1) { + throw new Error('path/fee lengths do not match') + } + + let encoded = '0x' + for (let i = 0; i < fees.length; i++) { + // 20 byte encoding of the address + encoded += path[i].slice(2) + // 3 byte encoding of the fee + encoded += fees[i].toString(16).padStart(2 * FEE_SIZE, '0') + } + // encode the final token + encoded += path[path.length - 1].slice(2) + + return encoded.toLowerCase() +} + +function decodeOne(tokenFeeToken: Buffer): [[string, string], number] { + // reads the first 20 bytes for the token address + const tokenABuf = tokenFeeToken.slice(0, ADDR_SIZE) + const tokenA = utils.getAddress('0x' + tokenABuf.toString('hex')) + + // reads the next 2 bytes for the fee + const feeBuf = tokenFeeToken.slice(ADDR_SIZE, OFFSET) + const fee = feeBuf.readUIntBE(0, FEE_SIZE) + + // reads the next 20 bytes for the token address + const tokenBBuf = tokenFeeToken.slice(OFFSET, DATA_SIZE) + const tokenB = utils.getAddress('0x' + tokenBBuf.toString('hex')) + + return [[tokenA, tokenB], fee] +} + +export function decodePath(path: string): [string[], number[]] { + let data = Buffer.from(path.slice(2), 'hex') + + let tokens: string[] = [] + let fees: number[] = [] + let i = 0 + let finalToken: string = '' + while (data.length >= DATA_SIZE) { + const [[tokenA, tokenB], fee] = decodeOne(data) + finalToken = tokenB + tokens = [...tokens, tokenA] + fees = [...fees, fee] + data = data.slice((i + 1) * OFFSET) + i += 1 + } + tokens = [...tokens, finalToken] + + return [tokens, fees] +} diff --git a/lib/v3-periphery/test/shared/permit.ts b/lib/v3-periphery/test/shared/permit.ts new file mode 100644 index 0000000..f3ec85d --- /dev/null +++ b/lib/v3-periphery/test/shared/permit.ts @@ -0,0 +1,61 @@ +import { BigNumberish, constants, Signature, Wallet } from 'ethers' +import { splitSignature } from 'ethers/lib/utils' +import { TestERC20, TestERC20PermitAllowed } from '../../typechain' + +export async function getPermitSignature( + wallet: Wallet, + token: TestERC20 | TestERC20PermitAllowed, + spender: string, + value: BigNumberish = constants.MaxUint256, + deadline = constants.MaxUint256, + permitConfig?: { nonce?: BigNumberish; name?: string; chainId?: number; version?: string } +): Promise { + const [nonce, name, version, chainId] = await Promise.all([ + permitConfig?.nonce ?? token.nonces(wallet.address), + permitConfig?.name ?? token.name(), + permitConfig?.version ?? '1', + permitConfig?.chainId ?? wallet.getChainId(), + ]) + + return splitSignature( + await wallet._signTypedData( + { + name, + version, + chainId, + verifyingContract: token.address, + }, + { + Permit: [ + { + name: 'owner', + type: 'address', + }, + { + name: 'spender', + type: 'address', + }, + { + name: 'value', + type: 'uint256', + }, + { + name: 'nonce', + type: 'uint256', + }, + { + name: 'deadline', + type: 'uint256', + }, + ], + }, + { + owner: wallet.address, + spender, + value, + nonce, + deadline, + } + ) + ) +} diff --git a/lib/v3-periphery/test/shared/poolAtAddress.ts b/lib/v3-periphery/test/shared/poolAtAddress.ts new file mode 100644 index 0000000..b877813 --- /dev/null +++ b/lib/v3-periphery/test/shared/poolAtAddress.ts @@ -0,0 +1,7 @@ +import { abi as POOL_ABI } from '@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json' +import { Contract, Wallet } from 'ethers' +import { IUniswapV3Pool } from '../../typechain' + +export default function poolAtAddress(address: string, wallet: Wallet): IUniswapV3Pool { + return new Contract(address, POOL_ABI, wallet) as IUniswapV3Pool +} diff --git a/lib/v3-periphery/test/shared/quoter.ts b/lib/v3-periphery/test/shared/quoter.ts new file mode 100644 index 0000000..48d1b52 --- /dev/null +++ b/lib/v3-periphery/test/shared/quoter.ts @@ -0,0 +1,153 @@ +import { Wallet } from 'ethers' +import { MockTimeNonfungiblePositionManager } from '../../typechain' +import { FeeAmount, TICK_SPACINGS } from './constants' +import { encodePriceSqrt } from './encodePriceSqrt' +import { getMaxTick, getMinTick } from './ticks' + +export async function createPool( + nft: MockTimeNonfungiblePositionManager, + wallet: Wallet, + tokenAddressA: string, + tokenAddressB: string +) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary(tokenAddressA, tokenAddressB, FeeAmount.MEDIUM, encodePriceSqrt(1, 1)) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams) +} + +export async function createPoolWithMultiplePositions( + nft: MockTimeNonfungiblePositionManager, + wallet: Wallet, + tokenAddressA: string, + tokenAddressB: string +) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary(tokenAddressA, tokenAddressB, FeeAmount.MEDIUM, encodePriceSqrt(1, 1)) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + await nft.mint(liquidityParams) + + const liquidityParams2 = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: -60, + tickUpper: 60, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + await nft.mint(liquidityParams2) + + const liquidityParams3 = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: -120, + tickUpper: 120, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams3) +} + +export async function createPoolWithZeroTickInitialized( + nft: MockTimeNonfungiblePositionManager, + wallet: Wallet, + tokenAddressA: string, + tokenAddressB: string +) { + if (tokenAddressA.toLowerCase() > tokenAddressB.toLowerCase()) + [tokenAddressA, tokenAddressB] = [tokenAddressB, tokenAddressA] + + await nft.createAndInitializePoolIfNecessary(tokenAddressA, tokenAddressB, FeeAmount.MEDIUM, encodePriceSqrt(1, 1)) + + const liquidityParams = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: getMinTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + tickUpper: getMaxTick(TICK_SPACINGS[FeeAmount.MEDIUM]), + recipient: wallet.address, + amount0Desired: 1000000, + amount1Desired: 1000000, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + await nft.mint(liquidityParams) + + const liquidityParams2 = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: 0, + tickUpper: 60, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + await nft.mint(liquidityParams2) + + const liquidityParams3 = { + token0: tokenAddressA, + token1: tokenAddressB, + fee: FeeAmount.MEDIUM, + tickLower: -120, + tickUpper: 0, + recipient: wallet.address, + amount0Desired: 100, + amount1Desired: 100, + amount0Min: 0, + amount1Min: 0, + deadline: 1, + } + + return nft.mint(liquidityParams3) +} diff --git a/lib/v3-periphery/test/shared/snapshotGasCost.ts b/lib/v3-periphery/test/shared/snapshotGasCost.ts new file mode 100644 index 0000000..5a606d2 --- /dev/null +++ b/lib/v3-periphery/test/shared/snapshotGasCost.ts @@ -0,0 +1,27 @@ +import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider' +import { expect } from './expect' +import { Contract, BigNumber, ContractTransaction } from 'ethers' + +export default async function snapshotGasCost( + x: + | TransactionResponse + | Promise + | ContractTransaction + | Promise + | TransactionReceipt + | Promise + | BigNumber + | Contract + | Promise +): Promise { + const resolved = await x + if ('deployTransaction' in resolved) { + const receipt = await resolved.deployTransaction.wait() + expect(receipt.gasUsed.toNumber()).toMatchSnapshot() + } else if ('wait' in resolved) { + const waited = await resolved.wait() + expect(waited.gasUsed.toNumber()).toMatchSnapshot() + } else if (BigNumber.isBigNumber(resolved)) { + expect(resolved.toNumber()).toMatchSnapshot() + } +} diff --git a/lib/v3-periphery/test/shared/ticks.ts b/lib/v3-periphery/test/shared/ticks.ts new file mode 100644 index 0000000..40aa294 --- /dev/null +++ b/lib/v3-periphery/test/shared/ticks.ts @@ -0,0 +1,9 @@ +import { BigNumber } from 'ethers' + +export const getMinTick = (tickSpacing: number) => Math.ceil(-887272 / tickSpacing) * tickSpacing +export const getMaxTick = (tickSpacing: number) => Math.floor(887272 / tickSpacing) * tickSpacing +export const getMaxLiquidityPerTick = (tickSpacing: number) => + BigNumber.from(2) + .pow(128) + .sub(1) + .div((getMaxTick(tickSpacing) - getMinTick(tickSpacing)) / tickSpacing + 1) diff --git a/lib/v3-periphery/test/shared/tokenSort.ts b/lib/v3-periphery/test/shared/tokenSort.ts new file mode 100644 index 0000000..bdab508 --- /dev/null +++ b/lib/v3-periphery/test/shared/tokenSort.ts @@ -0,0 +1,10 @@ +export function compareToken(a: { address: string }, b: { address: string }): -1 | 1 { + return a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1 +} + +export function sortedTokens( + a: { address: string }, + b: { address: string } +): [typeof a, typeof b] | [typeof b, typeof a] { + return compareToken(a, b) < 0 ? [a, b] : [b, a] +} diff --git a/lib/v3-periphery/testnet-deploys.md b/lib/v3-periphery/testnet-deploys.md new file mode 100644 index 0000000..dfaa185 --- /dev/null +++ b/lib/v3-periphery/testnet-deploys.md @@ -0,0 +1,3 @@ +## Uniswap V3 is live on Mainnet + +See the addresses [here](./deploys.md). diff --git a/lib/v3-periphery/tsconfig.json b/lib/v3-periphery/tsconfig.json new file mode 100644 index 0000000..69ab585 --- /dev/null +++ b/lib/v3-periphery/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "outDir": "dist", + "typeRoots": ["./typechain", "./node_modules/@types"], + "types": ["@nomiclabs/hardhat-ethers", "@nomiclabs/hardhat-waffle"] + }, + "include": ["./test"], + "files": ["./hardhat.config.ts"] +} diff --git a/lib/v3-periphery/yarn.lock b/lib/v3-periphery/yarn.lock new file mode 100644 index 0000000..568fc21 --- /dev/null +++ b/lib/v3-periphery/yarn.lock @@ -0,0 +1,8111 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@ensdomains/ens@^0.4.4": + version "0.4.5" + resolved "https://registry.yarnpkg.com/@ensdomains/ens/-/ens-0.4.5.tgz#e0aebc005afdc066447c6e22feb4eda89a5edbfc" + dependencies: + bluebird "^3.5.2" + eth-ens-namehash "^2.0.8" + solc "^0.4.20" + testrpc "0.0.1" + web3-utils "^1.0.0-beta.31" + +"@ensdomains/resolver@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" + +"@ethereum-waffle/chai@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.2.1.tgz#5cb542b2a323adf0bc2dda00f48b0eb85944d8ab" + dependencies: + "@ethereum-waffle/provider" "^3.2.1" + ethers "^5.0.0" + +"@ethereum-waffle/compiler@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.2.1.tgz#612a9056285a94ce28eb57b895770ad10e438bf9" + dependencies: + "@resolver-engine/imports" "^0.3.3" + "@resolver-engine/imports-fs" "^0.3.3" + "@types/mkdirp" "^0.5.2" + "@types/node-fetch" "^2.5.5" + ethers "^5.0.1" + mkdirp "^0.5.1" + node-fetch "^2.6.0" + solc "^0.6.3" + +"@ethereum-waffle/ens@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.2.1.tgz#9f369112d62f7aa88d010be4d133b6d0f5e8c492" + dependencies: + "@ensdomains/ens" "^0.4.4" + "@ensdomains/resolver" "^0.2.4" + ethers "^5.0.1" + +"@ethereum-waffle/mock-contract@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.2.1.tgz#bf5f63f61c9749eb3270108893a88ff161e68f58" + dependencies: + "@ethersproject/abi" "^5.0.1" + ethers "^5.0.1" + +"@ethereum-waffle/provider@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.2.1.tgz#d84c0603936f09afa69ecb671d56f527e9818e71" + dependencies: + "@ethereum-waffle/ens" "^3.2.1" + ethers "^5.0.1" + ganache-core "^2.10.2" + patch-package "^6.2.2" + postinstall-postinstall "^2.1.0" + +"@ethereumjs/block@^3.4.0", "@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.6.0.tgz#5cf89ea748607597a3f8b038abc986e4ac0b05db" + integrity sha512-dqLo1LtsLG+Oelu5S5tWUDG0pah3QUwV5TJZy2cm19BXDr4ka/S9XBSgao0i09gTcuPlovlHgcs6d7EZ37urjQ== + dependencies: + "@ethereumjs/common" "^2.6.0" + "@ethereumjs/tx" "^3.4.0" + ethereumjs-util "^7.1.3" + merkle-patricia-tree "^4.2.2" + +"@ethereumjs/blockchain@^5.4.0", "@ethereumjs/blockchain@^5.5.0": + version "5.5.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.5.1.tgz#60f1f50592c06cc47e1704800b88b7d32f609742" + integrity sha512-JS2jeKxl3tlaa5oXrZ8mGoVBCz6YqsGG350XVNtHAtNZXKk7pU3rH4xzF2ru42fksMMqzFLzKh9l4EQzmNWDqA== + dependencies: + "@ethereumjs/block" "^3.6.0" + "@ethereumjs/common" "^2.6.0" + "@ethereumjs/ethash" "^1.1.0" + debug "^2.2.0" + ethereumjs-util "^7.1.3" + level-mem "^5.0.1" + lru-cache "^5.1.1" + semaphore-async-await "^1.5.1" + +"@ethereumjs/common@^2.4.0", "@ethereumjs/common@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.0.tgz#feb96fb154da41ee2cc2c5df667621a440f36348" + integrity sha512-Cq2qS0FTu6O2VU1sgg+WyU9Ps0M6j/BEMHN+hRaECXCV/r0aI78u4N6p52QW/BDVhwWZpCdrvG8X7NJdzlpNUA== + dependencies: + crc-32 "^1.2.0" + ethereumjs-util "^7.1.3" + +"@ethereumjs/ethash@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" + integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== + dependencies: + "@ethereumjs/block" "^3.5.0" + "@types/levelup" "^4.3.0" + buffer-xor "^2.0.1" + ethereumjs-util "^7.1.1" + miller-rabin "^4.0.0" + +"@ethereumjs/tx@^3.3.0", "@ethereumjs/tx@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.4.0.tgz#7eb1947eefa55eb9cf05b3ca116fb7a3dbd0bce7" + integrity sha512-WWUwg1PdjHKZZxPPo274ZuPsJCWV3SqATrEKQP1n2DrVYVP1aZIYpo/mFaA0BDoE0tIQmBeimRCEA0Lgil+yYw== + dependencies: + "@ethereumjs/common" "^2.6.0" + ethereumjs-util "^7.1.3" + +"@ethereumjs/vm@^5.5.2": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.6.0.tgz#e0ca62af07de820143674c30b776b86c1983a464" + integrity sha512-J2m/OgjjiGdWF2P9bj/4LnZQ1zRoZhY8mRNVw/N3tXliGI8ai1sI1mlDPkLpeUUM4vq54gH6n0ZlSpz8U/qlYQ== + dependencies: + "@ethereumjs/block" "^3.6.0" + "@ethereumjs/blockchain" "^5.5.0" + "@ethereumjs/common" "^2.6.0" + "@ethereumjs/tx" "^3.4.0" + async-eventemitter "^0.2.4" + core-js-pure "^3.0.1" + debug "^2.2.0" + ethereumjs-util "^7.1.3" + functional-red-black-tree "^1.0.1" + mcl-wasm "^0.7.1" + merkle-patricia-tree "^4.2.2" + rustbn.js "~0.2.0" + +"@ethersproject/abi@5.0.0-beta.153": + version "5.0.0-beta.153" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" + dependencies: + "@ethersproject/address" ">=5.0.0-beta.128" + "@ethersproject/bignumber" ">=5.0.0-beta.130" + "@ethersproject/bytes" ">=5.0.0-beta.129" + "@ethersproject/constants" ">=5.0.0-beta.128" + "@ethersproject/hash" ">=5.0.0-beta.128" + "@ethersproject/keccak256" ">=5.0.0-beta.127" + "@ethersproject/logger" ">=5.0.0-beta.129" + "@ethersproject/properties" ">=5.0.0-beta.131" + "@ethersproject/strings" ">=5.0.0-beta.130" + +"@ethersproject/abi@5.0.9", "@ethersproject/abi@^5.0.1", "@ethersproject/abi@^5.0.5": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.9.tgz#738c1c557e56d8f395a5a27caef9b0449bc85a10" + dependencies: + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/abi@^5.1.2": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.5.0.tgz#fb52820e22e50b854ff15ce1647cc508d6660613" + integrity sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w== + dependencies: + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/hash" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/abstract-provider@5.0.7", "@ethersproject/abstract-provider@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.0.7.tgz#04ee3bfe43323384e7fecf6c774975b8dec4bdc9" + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/networks" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/web" "^5.0.6" + +"@ethersproject/abstract-provider@^5.5.0": + version "5.5.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" + integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/networks" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/transactions" "^5.5.0" + "@ethersproject/web" "^5.5.0" + +"@ethersproject/abstract-signer@5.0.9", "@ethersproject/abstract-signer@^5.0.4", "@ethersproject/abstract-signer@^5.0.6": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.0.9.tgz#238ddc06031aeb9dfceee2add965292d7dd1acbf" + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/abstract-signer@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" + integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== + dependencies: + "@ethersproject/abstract-provider" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + +"@ethersproject/address@5.0.8", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.8.tgz#0c551659144a5a7643c6bea337149d410825298f" + dependencies: + "@ethersproject/bignumber" "^5.0.10" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/rlp" "^5.0.3" + +"@ethersproject/address@^5.0.2": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.1.0.tgz#3854fd7ebcb6af7597de66f847c3345dae735b58" + integrity sha512-rfWQR12eHn2cpstCFS4RF7oGjfbkZb0oqep+BfrT+gWEGWG2IowJvIsacPOvzyS1jhNF4MQ4BS59B04Mbovteg== + dependencies: + "@ethersproject/bignumber" "^5.1.0" + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/keccak256" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + "@ethersproject/rlp" "^5.1.0" + +"@ethersproject/address@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" + integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/rlp" "^5.5.0" + +"@ethersproject/base64@5.0.6", "@ethersproject/base64@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.0.6.tgz#26311ebf29ea3d0b9c300ccf3e1fdc44b7481516" + dependencies: + "@ethersproject/bytes" "^5.0.4" + +"@ethersproject/base64@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" + integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + +"@ethersproject/basex@5.0.6", "@ethersproject/basex@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.0.6.tgz#ab95c32e48288a3d868726463506641cb1e9fb6b" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/bignumber@5.0.12", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.0.8": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.12.tgz#fe4a78667d7cb01790f75131147e82d6ea7e7cba" + dependencies: + "@ethersproject/bytes" "^5.0.8" + "@ethersproject/logger" "^5.0.5" + bn.js "^4.4.0" + +"@ethersproject/bignumber@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.1.1.tgz#84812695253ccbc639117f7ac49ee1529b68e637" + integrity sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig== + dependencies: + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + bn.js "^4.4.0" + +"@ethersproject/bignumber@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" + integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + bn.js "^4.11.9" + +"@ethersproject/bytes@5.0.8", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.8.tgz#cf1246a6a386086e590063a4602b1ffb6cc43db1" + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/bytes@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.1.0.tgz#55dfa9c4c21df1b1b538be3accb50fb76d5facfd" + integrity sha512-sGTxb+LVjFxJcJeUswAIK6ncgOrh3D8c192iEJd7mLr95V6du119rRfYT/b87WPkZ5I3gRBUYIYXtdgCWACe8g== + dependencies: + "@ethersproject/logger" "^5.1.0" + +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/constants@5.0.7", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.7.tgz#44ff979e5781b17c8c6901266896c3ee745f4e7e" + dependencies: + "@ethersproject/bignumber" "^5.0.7" + +"@ethersproject/constants@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" + integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== + dependencies: + "@ethersproject/bignumber" "^5.5.0" + +"@ethersproject/contracts@5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.0.8.tgz#71d3ba16853a1555be2e161a6741df186f81c73b" + dependencies: + "@ethersproject/abi" "^5.0.5" + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + +"@ethersproject/hash@5.0.9", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.0.9.tgz#81252a848185b584aa600db4a1a68cad9229a4d4" + dependencies: + "@ethersproject/abstract-signer" "^5.0.6" + "@ethersproject/address" "^5.0.5" + "@ethersproject/bignumber" "^5.0.8" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.4" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/hash@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" + integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== + dependencies: + "@ethersproject/abstract-signer" "^5.5.0" + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/hdnode@5.0.7", "@ethersproject/hdnode@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.0.7.tgz#c7bce94a337ea65e37c46bab09a83e1c1a555d99" + dependencies: + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/basex" "^5.0.3" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/pbkdf2" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/wordlists" "^5.0.4" + +"@ethersproject/json-wallets@5.0.9", "@ethersproject/json-wallets@^5.0.6": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.0.9.tgz#2e1708c2854c4ab764e35920bd1f44c948b95434" + dependencies: + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hdnode" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/pbkdf2" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.0.6", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.6.tgz#5b5ba715ef1be86efde5c271f896fa0daf0e1efe" + dependencies: + "@ethersproject/bytes" "^5.0.4" + js-sha3 "0.5.7" + +"@ethersproject/keccak256@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.1.0.tgz#fdcd88fb13bfef4271b225cdd8dec4d315c8e60e" + integrity sha512-vrTB1W6AEYoadww5c9UyVJ2YcSiyIUTNDRccZIgwTmFFoSHwBtcvG1hqy9RzJ1T0bMdATbM9Hfx2mJ6H0i7Hig== + dependencies: + "@ethersproject/bytes" "^5.1.0" + js-sha3 "0.5.7" + +"@ethersproject/keccak256@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" + integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== + dependencies: + "@ethersproject/bytes" "^5.5.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.0.8", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.0.8.tgz#135c1903d35c878265f3cbf2b287042c4c20d5d4" + +"@ethersproject/logger@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.1.0.tgz#4cdeeefac029373349d5818f39c31b82cc6d9bbf" + integrity sha512-wtUaD1lBX10HBXjjKV9VHCBnTdUaKQnQ2XSET1ezglqLdPdllNOIlLfhyCRqXm5xwcjExVI5ETokOYfjPtaAlw== + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/networks@5.0.6", "@ethersproject/networks@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.0.6.tgz#4d6586bbebfde1c027504ebf6dfb783b29c3803a" + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/networks@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.0.tgz#babec47cab892c51f8dd652ce7f2e3e14283981a" + integrity sha512-KWfP3xOnJeF89Uf/FCJdV1a2aDJe5XTN2N52p4fcQ34QhDqQFkgQKZ39VGtiqUgHcLI8DfT0l9azC3KFTunqtA== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/pbkdf2@5.0.6", "@ethersproject/pbkdf2@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.0.6.tgz#105dbfb08cd5fcf33869b42bfdc35a3ebd978cbd" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/sha2" "^5.0.3" + +"@ethersproject/properties@5.0.6", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.0.4": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.6.tgz#44d82aaa294816fd63333e7def42426cf0e87b3b" + dependencies: + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/properties@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" + integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/providers@5.0.17": + version "5.0.17" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.0.17.tgz#f380e7831149e24e7a1c6c9b5fb1d6dfc729d024" + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/basex" "^5.0.3" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/networks" "^5.0.3" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/rlp" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/web" "^5.0.6" + bech32 "1.1.4" + ws "7.2.3" + +"@ethersproject/random@5.0.6", "@ethersproject/random@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.0.6.tgz#9be80a1065f2b8e6f321dccb3ebeb4886cac9ea4" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/rlp@5.0.6", "@ethersproject/rlp@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.6.tgz#29f9097348a3c330811997433b7df89ab51cd644" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/rlp@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.1.0.tgz#700f4f071c27fa298d3c1d637485fefe919dd084" + integrity sha512-vDTyHIwNPrecy55gKGZ47eJZhBm8LLBxihzi5ou+zrSvYTpkSTWRcKUlXFDFQVwfWB+P5PGyERAdiDEI76clxw== + dependencies: + "@ethersproject/bytes" "^5.1.0" + "@ethersproject/logger" "^5.1.0" + +"@ethersproject/rlp@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" + integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/sha2@5.0.6", "@ethersproject/sha2@^5.0.3": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.0.6.tgz#175116dc10b866a0a381f6316d094bcc510bee3c" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + hash.js "1.1.3" + +"@ethersproject/signing-key@5.0.7", "@ethersproject/signing-key@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.7.tgz#d03bfc5f565efb962bafebf8e6965e70d1c46d31" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + elliptic "6.5.3" + +"@ethersproject/signing-key@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" + integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.0.7.tgz#72a3455f47a454db2dcf363992d42e9045dc7fce" + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/sha2" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/strings@5.0.7", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.0.7.tgz#8dc68f794c9e2901f3b75e53b2afbcb6b6c15037" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/strings@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" + integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/transactions@5.0.8", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.0.5": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.8.tgz#3b4d7041e13b957a9c4f131e0aea9dae7b6f5a23" + dependencies: + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/rlp" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + +"@ethersproject/transactions@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" + integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== + dependencies: + "@ethersproject/address" "^5.5.0" + "@ethersproject/bignumber" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/constants" "^5.5.0" + "@ethersproject/keccak256" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/rlp" "^5.5.0" + "@ethersproject/signing-key" "^5.5.0" + +"@ethersproject/units@5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.0.8.tgz#563325b20fe1eceff7b61857711d5e2b3f38fd09" + dependencies: + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + +"@ethersproject/wallet@5.0.9": + version "5.0.9" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.0.9.tgz#976c7d950489c40308d676869d24e59ab7b82ad1" + dependencies: + "@ethersproject/abstract-provider" "^5.0.4" + "@ethersproject/abstract-signer" "^5.0.4" + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/hdnode" "^5.0.4" + "@ethersproject/json-wallets" "^5.0.6" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/random" "^5.0.3" + "@ethersproject/signing-key" "^5.0.4" + "@ethersproject/transactions" "^5.0.5" + "@ethersproject/wordlists" "^5.0.4" + +"@ethersproject/web@5.0.11", "@ethersproject/web@^5.0.6": + version "5.0.11" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.0.11.tgz#d47da612b958b4439e415782a53c8f8461522d68" + dependencies: + "@ethersproject/base64" "^5.0.3" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/web@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.0.tgz#0e5bb21a2b58fb4960a705bfc6522a6acf461e28" + integrity sha512-BEgY0eL5oH4mAo37TNYVrFeHsIXLRxggCRG/ksRIxI2X5uj5IsjGmcNiRN/VirQOlBxcUhCgHhaDLG4m6XAVoA== + dependencies: + "@ethersproject/base64" "^5.5.0" + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + "@ethersproject/properties" "^5.5.0" + "@ethersproject/strings" "^5.5.0" + +"@ethersproject/wordlists@5.0.7", "@ethersproject/wordlists@^5.0.4": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.0.7.tgz#4e5ad38cfbef746b196a3290c0d41696eb7ab468" + dependencies: + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@jest/console@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.6.2.tgz#4e04bc464014358b03ab4937805ee36a0aeb98f2" + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^26.6.2" + jest-util "^26.6.2" + slash "^3.0.0" + +"@jest/test-result@^26.5.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.6.2.tgz#55da58b62df134576cc95476efa5f7949e3f5f18" + dependencies: + "@jest/console" "^26.6.2" + "@jest/types" "^26.6.2" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/types@^26.6.2": + version "26.6.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + +"@nomiclabs/hardhat-ethers@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" + integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== + +"@nomiclabs/hardhat-etherscan@^2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.8.tgz#e206275e96962cd15e5ba9148b44388bc922d8c2" + integrity sha512-0+rj0SsZotVOcTLyDOxnOc3Gulo8upo0rsw/h+gBPcmtj91YqYJNhdARHoBxOhhE8z+5IUQPx+Dii04lXT14PA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^5.0.2" + debug "^4.1.1" + fs-extra "^7.0.1" + node-fetch "^2.6.0" + semver "^6.3.0" + +"@nomiclabs/hardhat-waffle@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.1.tgz#5d43654fba780720c5033dea240fe14f70ef4bd2" + integrity sha512-2YR2V5zTiztSH9n8BYWgtv3Q+EL0N5Ltm1PAr5z20uAY4SkkfylJ98CIqt18XFvxTD5x4K2wKBzddjV9ViDAZQ== + dependencies: + "@types/sinon-chai" "^3.2.3" + "@types/web3" "1.0.19" + +"@openzeppelin/contracts@3.4.2-solc-0.7": + version "3.4.2-solc-0.7" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz#38f4dbab672631034076ccdf2f3201fab1726635" + integrity sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA== + +"@resolver-engine/core@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" + dependencies: + debug "^3.1.0" + is-url "^1.2.4" + request "^2.85.0" + +"@resolver-engine/fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" + dependencies: + "@resolver-engine/core" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports-fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" + dependencies: + "@resolver-engine/fs" "^0.3.3" + "@resolver-engine/imports" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" + dependencies: + "@resolver-engine/core" "^0.3.3" + debug "^3.1.0" + hosted-git-info "^2.6.0" + path-browserify "^1.0.0" + url "^0.11.0" + +"@sentry/core@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.29.2.tgz#9e05fe197234161d57aabaf52fab336a7c520d81" + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/minimal" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/hub@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.29.2.tgz#208f10fe6674695575ad74182a1151f71d6df00a" + dependencies: + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/minimal@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.29.2.tgz#420bebac8d03d30980fdb05c72d7b253d8aa541b" + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/types" "5.29.2" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.29.2.tgz#f0f0b4b2be63c9ddd702729fab998cead271dff1" + dependencies: + "@sentry/core" "5.29.2" + "@sentry/hub" "5.29.2" + "@sentry/tracing" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.29.2.tgz#6012788547d2ab7893799d82c4941bda145dcd47" + dependencies: + "@sentry/hub" "5.29.2" + "@sentry/minimal" "5.29.2" + "@sentry/types" "5.29.2" + "@sentry/utils" "5.29.2" + tslib "^1.9.3" + +"@sentry/types@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.29.2.tgz#ac87383df1222c2d9b9f8f9ed7a6b86ea41a098a" + +"@sentry/utils@5.29.2": + version "5.29.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.29.2.tgz#99a5cdda2ea19d34a41932f138d470adcb3ee673" + dependencies: + "@sentry/types" "5.29.2" + tslib "^1.9.3" + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + +"@solidity-parser/parser@^0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.12.1.tgz#10ce249890d32ba500e9ce449e60a2b26b11be7a" + integrity sha512-ikxVpwskNxEp2fvYS1BdRImnevHmM97zdPFBa1cVtjtNpoqCm/EmljATTZk0s9G/zsN5ZbPf9OAIAW4gbBJiRA== + +"@solidity-parser/parser@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.0.tgz#d51f074efb0acce0e953ec48133561ed710cebc0" + integrity sha512-cX0JJRcmPtNUJpzD2K7FdA7qQsTOk1UZnFx2k7qAg9ZRvuaH5NBe5IEdBMXGlmf2+FmjhqbygJ26H8l2SV7aKQ== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@solidity-parser/parser@^0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.8.2.tgz#a6a5e93ac8dca6884a99a532f133beba59b87b69" + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + dependencies: + defer-to-connect "^1.0.1" + +"@typechain/ethers-v5@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-4.0.0.tgz#2a8be5e108d23f3b8e6354d1618fdc2abcb00b07" + +"@types/abstract-leveldown@*": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz#3c7750d0186b954c7f2d2f6acc8c3c7ba0c3412e" + integrity sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ== + +"@types/babel__traverse@^7.0.4": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" + dependencies: + "@babel/types" "^7.3.0" + +"@types/bn.js@*", "@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + dependencies: + "@types/node" "*" + +"@types/chai@*", "@types/chai@^4.2.6": + version "4.2.14" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193" + +"@types/graceful-fs@^4.1.2": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.4.tgz#4ff9f641a7c6d1a3508ff88bc3141b152772e753" + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/levelup@^4.3.0": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.1.tgz#7a53b9fd510716e11b2065332790fdf5f9b950b9" + integrity sha512-n//PeTpbHLjMLTIgW5B/g06W/6iuTBHuvUka2nFL9APMSVMNe2r4enADfu3CIE9IyV9E+uquf9OEQQqrDeg24A== + dependencies: + "@types/abstract-leveldown" "*" + "@types/node" "*" + +"@types/lru-cache@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.0.tgz#57f228f2b80c046b4a1bd5cac031f81f207f4f03" + +"@types/mkdirp@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" + dependencies: + "@types/node" "*" + +"@types/mocha@^5.2.7": + version "5.2.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" + +"@types/node-fetch@^2.5.5": + version "2.5.7" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" + dependencies: + "@types/node" "*" + form-data "^3.0.0" + +"@types/node@*": + version "14.14.14" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae" + +"@types/node@^12.12.6": + version "12.19.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.9.tgz#990ad687ad8b26ef6dcc34a4f69c33d40c95b679" + +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + dependencies: + "@types/node" "*" + +"@types/prettier@^2.0.0", "@types/prettier@^2.1.1": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.1.5.tgz#b6ab3bba29e16b821d84e09ecfaded462b816b00" + +"@types/resolve@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" + dependencies: + "@types/node" "*" + +"@types/sinon-chai@^3.2.3": + version "3.2.5" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.5.tgz#df21ae57b10757da0b26f512145c065f2ad45c48" + dependencies: + "@types/chai" "*" + "@types/sinon" "*" + +"@types/sinon@*": + version "9.0.10" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-9.0.10.tgz#7fb9bcb6794262482859cab66d59132fca18fcf7" + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinonjs__fake-timers@*": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" + +"@types/stack-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + +"@types/underscore@*": + version "1.10.24" + resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.10.24.tgz#dede004deed3b3f99c4db0bdb9ee21cae25befdd" + +"@types/web3@1.0.19": + version "1.0.19" + resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" + dependencies: + "@types/bn.js" "*" + "@types/underscore" "*" + +"@types/yargs-parser@*": + version "20.2.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" + +"@types/yargs@^15.0.0": + version "15.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.12.tgz#6234ce3e3e3fa32c5db301a170f96a599c960d74" + dependencies: + "@types/yargs-parser" "*" + +"@uniswap/lib@^4.0.1-alpha": + version "4.0.1-alpha" + resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-4.0.1-alpha.tgz#2881008e55f075344675b3bca93f020b028fbd02" + +"@uniswap/v2-core@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.1.tgz#af8f508bf183204779938969e2e54043e147d425" + integrity sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q== + +"@uniswap/v3-core@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@uniswap/v3-core/-/v3-core-1.0.1.tgz#b6d2bdc6ba3c3fbd610bdc502395d86cd35264a0" + integrity sha512-7pVk4hEm00j9tc71Y9+ssYpO6ytkeI0y7WE9P6UcmNzhxPePwyAxImuhVsTqWK9YFvzgtvzJHi64pBl4jUzKMQ== + +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + dependencies: + event-target-shim "^5.0.0" + +abstract-leveldown@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^2.4.1, abstract-leveldown@~2.7.1: + version "2.7.2" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^6.2.1: + version "6.3.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" + integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +abstract-leveldown@~2.6.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" + dependencies: + xtend "~4.0.0" + +abstract-leveldown@~6.2.1: + version "6.2.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" + integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== + dependencies: + buffer "^5.5.0" + immediate "^3.2.3" + level-concat-iterator "~2.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +acorn-jsx@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + +acorn@^6.0.7: + version "6.4.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + +aes-js@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + dependencies: + debug "4" + +ajv@^6.10.2, ajv@^6.12.3, ajv@^6.6.1, ajv@^6.9.1: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + +ansi-escapes@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" + dependencies: + type-fest "^0.11.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + dependencies: + color-convert "^2.0.1" + +antlr4@4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +anymatch@^3.0.3, anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-back@^1.0.3, array-back@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" + dependencies: + typical "^2.6.0" + +array-back@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" + dependencies: + typical "^2.6.1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +asn1.js@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + safer-buffer "^2.1.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +ast-parents@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + +async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" + dependencies: + async "^2.4.0" + +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + +async@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + dependencies: + lodash "^4.17.11" + +async@^1.4.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + dependencies: + lodash "^4.17.14" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.0.14, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-preset-env@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^3.2.6" + invariant "^2.2.2" + semver "^5.3.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babelify@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" + dependencies: + babel-core "^6.0.14" + object-assign "^4.0.0" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +backoff@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" + dependencies: + precond "0.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base-x@^3.0.2, base-x@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + +base64-sol@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/base64-sol/-/base64-sol-1.0.1.tgz#91317aa341f0bc763811783c5729f1c2574600f6" + integrity sha512-ld3cCNMeXt4uJXmLZBHFGMvVpK9KsLVEhPpFRXnvSVAqABKbuNZg/+dsq3NuM+wxFLb/UrVkz7m1ciWmkMfTbg== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + +bignumber.js@^9.0.0, bignumber.js@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.1.tgz#8d7ba124c882bfd8e43260c67475518d0689e4e5" + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + +bip39@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235" + dependencies: + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + safe-buffer "^5.0.1" + unorm "^1.3.3" + +blakejs@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" + +bluebird@^3.5.0, bluebird@^3.5.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: + version "4.11.9" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" + +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2: + version "5.1.3" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" + +body-parser@1.19.0, body-parser@^1.16.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + dependencies: + fill-range "^7.0.1" + +brorand@^1.0.1, brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" + dependencies: + bn.js "^5.0.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" + dependencies: + bn.js "^5.1.1" + browserify-rsa "^4.0.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.5.3" + inherits "^2.0.4" + parse-asn1 "^5.1.5" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +browserslist@^3.2.6: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +buffer-to-arraybuffer@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer-xor@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" + dependencies: + safe-buffer "^5.1.1" + +buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +bufferutil@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.2.tgz#79f68631910f6b993d870fc77dc0a2894eb96cd5" + dependencies: + node-gyp-build "^4.2.0" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + +bytewise-core@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bytewise-core/-/bytewise-core-1.2.3.tgz#3fb410c7e91558eb1ab22a82834577aa6bd61d42" + dependencies: + typewise-core "^1.2" + +bytewise@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/bytewise/-/bytewise-1.1.0.tgz#1d13cbff717ae7158094aa881b35d081b387253e" + dependencies: + bytewise-core "^1.2.2" + typewise "^1.0.3" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +cachedown@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cachedown/-/cachedown-1.0.0.tgz#d43f036e4510696b31246d7db31ebf0f7ac32d15" + dependencies: + abstract-leveldown "^2.4.1" + lru-cache "^3.2.0" + +call-bind@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.0.tgz#24127054bb3f9bdcb4b1fb82418186072f77b8ce" + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.0" + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + +caniuse-lite@^1.0.30000844: + version "1.0.30001170" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001170.tgz#0088bfecc6a14694969e391cc29d7eb6362ca6a7" + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +cbor@^5.0.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c" + integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A== + dependencies: + bignumber.js "^9.0.1" + nofilter "^1.0.4" + +chai@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.0" + type-detect "^4.0.5" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +checkpoint-store@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" + dependencies: + functional-red-black-tree "^1.0.1" + +chokidar@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.2.0" + optionalDependencies: + fsevents "~2.1.1" + +chokidar@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +chokidar@^3.4.3: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.3.1" + +chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + +cids@^0.7.1: + version "0.7.5" + resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" + dependencies: + buffer "^5.5.0" + class-is "^1.1.0" + multibase "~0.6.0" + multicodec "^1.0.0" + multihashes "~0.4.15" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-is@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + +clone@2.1.2, clone@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collect-v8-coverage@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + dependencies: + delayed-stream "~1.0.0" + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + +command-line-args@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" + dependencies: + array-back "^2.0.0" + find-replace "^1.0.3" + typical "^2.6.1" + +commander@2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + +commander@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.1: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + dependencies: + safe-buffer "5.1.2" + +content-hash@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" + dependencies: + cids "^0.7.1" + multicodec "^0.5.5" + multihashes "^0.4.15" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + +convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + dependencies: + safe-buffer "~5.1.1" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + +cookie@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + +cookiejar@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-js-pure@^3.0.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.8.1.tgz#23f84048f366fdfcf52d3fd1c68fec349177d119" + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cors@^2.8.1: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + dependencies: + object-assign "^4" + vary "^1" + +cosmiconfig@^5.0.7: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" + +crc-32@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" + integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== + dependencies: + exit-on-epipe "~1.0.1" + printj "~1.1.0" + +create-ecdh@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" + dependencies: + bn.js "^4.1.0" + elliptic "^6.5.3" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-fetch@^2.1.0, cross-fetch@^2.1.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" + dependencies: + node-fetch "2.1.2" + whatwg-fetch "2.0.4" + +cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + dependencies: + ms "^2.1.1" + +debug@4, debug@^4.0.1, debug@^4.1.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + dependencies: + ms "2.1.2" + +debug@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decimal.js@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +decompress-response@^3.2.0, decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +deep-equal@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + dependencies: + is-arguments "^1.0.4" + is-date-object "^1.0.1" + is-regex "^1.0.4" + object-is "^1.0.1" + object-keys "^1.1.1" + regexp.prototype.flags "^1.2.0" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + +deferred-leveldown@~1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" + dependencies: + abstract-leveldown "~2.6.0" + +deferred-leveldown@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" + dependencies: + abstract-leveldown "~5.0.0" + inherits "^2.0.3" + +deferred-leveldown@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" + integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== + dependencies: + abstract-leveldown "~6.2.1" + inherits "^2.0.3" + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + +des.js@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff-sequences@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dir-to-object@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-to-object/-/dir-to-object-2.0.0.tgz#29723e9bd1c3e58e4f307bd04ff634c0370c8f8a" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + dependencies: + esutils "^2.0.2" + +dom-walk@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" + +dotignore@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" + dependencies: + minimatch "^3.0.4" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +electron-to-chromium@^1.3.47: + version "1.3.633" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe" + +elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: + version "6.5.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +elliptic@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + +encoding-down@5.0.4, encoding-down@~5.0.0: + version "5.0.4" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-5.0.4.tgz#1e477da8e9e9d0f7c8293d320044f8b2cd8e9614" + dependencies: + abstract-leveldown "^5.0.0" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + xtend "^4.0.1" + +encoding-down@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" + integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== + dependencies: + abstract-leveldown "^6.2.1" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + +encoding@^0.1.11: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + dependencies: + iconv-lite "^0.6.2" + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + dependencies: + once "^1.4.0" + +enquirer@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + dependencies: + ansi-colors "^4.1.1" + +env-paths@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" + +errno@~0.1.1: + version "0.1.8" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.17.0-next.1, es-abstract@^1.17.2: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.1: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es5-ext@^0.10.35, es5-ext@^0.10.50: + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.3" + next-tick "~1.0.0" + +es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + dependencies: + d "^1.0.1" + ext "^1.1.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + +eslint@^5.6.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + +esquery@^1.0.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + +eth-block-tracker@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1" + dependencies: + eth-query "^2.1.0" + ethereumjs-tx "^1.3.3" + ethereumjs-util "^5.1.3" + ethjs-util "^0.1.3" + json-rpc-engine "^3.6.0" + pify "^2.3.0" + tape "^4.6.3" + +eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" + dependencies: + idna-uts46-hx "^2.3.1" + js-sha3 "^0.5.7" + +eth-json-rpc-infura@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz#26702a821067862b72d979c016fd611502c6057f" + dependencies: + cross-fetch "^2.1.1" + eth-json-rpc-middleware "^1.5.0" + json-rpc-engine "^3.4.0" + json-rpc-error "^2.0.0" + +eth-json-rpc-middleware@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz#5c9d4c28f745ccb01630f0300ba945f4bef9593f" + dependencies: + async "^2.5.0" + eth-query "^2.1.2" + eth-tx-summary "^3.1.2" + ethereumjs-block "^1.6.0" + ethereumjs-tx "^1.3.3" + ethereumjs-util "^5.1.2" + ethereumjs-vm "^2.1.0" + fetch-ponyfill "^4.0.0" + json-rpc-engine "^3.6.0" + json-rpc-error "^2.0.0" + json-stable-stringify "^1.0.1" + promise-to-callback "^1.0.0" + tape "^4.6.3" + +eth-lib@0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + +eth-lib@^0.1.26: + version "0.1.29" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + nano-json-stream-parser "^0.1.2" + servify "^0.1.12" + ws "^3.0.0" + xhr-request-promise "^0.1.2" + +eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" + dependencies: + json-rpc-random-id "^1.0.0" + xtend "^4.0.1" + +eth-sig-util@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" + dependencies: + ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" + ethereumjs-util "^5.1.1" + +eth-sig-util@^2.0.0, eth-sig-util@^2.5.2: + version "2.5.3" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.3.tgz#6938308b38226e0b3085435474900b03036abcbe" + dependencies: + buffer "^5.2.1" + elliptic "^6.4.0" + ethereumjs-abi "0.6.5" + ethereumjs-util "^5.1.1" + tweetnacl "^1.0.0" + tweetnacl-util "^0.15.0" + +eth-tx-summary@^3.1.2: + version "3.2.4" + resolved "https://registry.yarnpkg.com/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz#e10eb95eb57cdfe549bf29f97f1e4f1db679035c" + dependencies: + async "^2.1.2" + clone "^2.0.0" + concat-stream "^1.5.1" + end-of-stream "^1.1.0" + eth-query "^2.0.2" + ethereumjs-block "^1.4.1" + ethereumjs-tx "^1.1.1" + ethereumjs-util "^5.0.1" + ethereumjs-vm "^2.6.0" + through2 "^2.0.3" + +ethashjs@~0.0.7: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" + dependencies: + async "^2.1.2" + buffer-xor "^2.0.1" + ethereumjs-util "^7.0.2" + miller-rabin "^4.0.0" + +ethereum-bloom-filters@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz#b7b80735e385dbb7f944ce6b4533e24511306060" + dependencies: + js-sha3 "^0.8.0" + +ethereum-common@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" + +ethereum-common@^0.0.18: + version "0.0.18" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" + +ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-waffle@^3.0.2: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.2.1.tgz#9d6d6b93484c5e1b77dfdeb646c050ed877e836e" + dependencies: + "@ethereum-waffle/chai" "^3.2.1" + "@ethereum-waffle/compiler" "^3.2.1" + "@ethereum-waffle/mock-contract" "^3.2.1" + "@ethereum-waffle/provider" "^3.2.1" + ethers "^5.0.1" + +ethereumjs-abi@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" + dependencies: + bn.js "^4.10.0" + ethereumjs-util "^4.3.0" + +ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": + version "0.6.8" + resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1ce6a1d64235fabe2aaf827fd606def55693508f" + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" + dependencies: + ethereumjs-util "^6.0.0" + rlp "^2.2.1" + safe-buffer "^5.1.1" + +ethereumjs-account@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" + dependencies: + ethereumjs-util "^5.0.0" + rlp "^2.0.0" + safe-buffer "^5.1.1" + +ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" + dependencies: + async "^2.0.1" + ethereumjs-common "^1.5.0" + ethereumjs-tx "^2.1.1" + ethereumjs-util "^5.0.0" + merkle-patricia-tree "^2.1.2" + +ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" + dependencies: + async "^2.0.1" + ethereum-common "0.2.0" + ethereumjs-tx "^1.2.2" + ethereumjs-util "^5.0.0" + merkle-patricia-tree "^2.1.2" + +ethereumjs-blockchain@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz#30f2228dc35f6dcf94423692a6902604ae34960f" + dependencies: + async "^2.6.1" + ethashjs "~0.0.7" + ethereumjs-block "~2.2.2" + ethereumjs-common "^1.5.0" + ethereumjs-util "^6.1.0" + flow-stoplight "^1.0.0" + level-mem "^3.0.1" + lru-cache "^5.1.1" + rlp "^2.2.2" + semaphore "^1.1.0" + +ethereumjs-common@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" + +ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" + +ethereumjs-tx@2.1.2, ethereumjs-tx@^2.1.1, ethereumjs-tx@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" + dependencies: + ethereumjs-common "^1.5.0" + ethereumjs-util "^6.0.0" + +ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3: + version "1.3.7" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" + dependencies: + ethereum-common "^0.0.18" + ethereumjs-util "^5.0.0" + +ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethereumjs-util@^4.3.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz#f4bf9b3b515a484e3cc8781d61d9d980f7c83bd0" + dependencies: + bn.js "^4.8.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + rlp "^2.0.0" + +ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" + dependencies: + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "^0.1.3" + rlp "^2.0.0" + safe-buffer "^5.1.1" + +ethereumjs-util@^7.0.2: + version "7.0.7" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz#484fb9c03b766b2ee64821281070616562fb5a59" + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + +ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2, ethereumjs-util@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz#b55d7b64dde3e3e45749e4c41288238edec32d23" + integrity sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw== + dependencies: + "@types/bn.js" "^5.1.0" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + rlp "^2.2.4" + +ethereumjs-vm@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" + dependencies: + async "^2.1.2" + async-eventemitter "^0.2.2" + core-js-pure "^3.0.1" + ethereumjs-account "^3.0.0" + ethereumjs-block "^2.2.2" + ethereumjs-blockchain "^4.0.3" + ethereumjs-common "^1.5.0" + ethereumjs-tx "^2.1.2" + ethereumjs-util "^6.2.0" + fake-merkle-patricia-tree "^1.0.1" + functional-red-black-tree "^1.0.1" + merkle-patricia-tree "^2.3.2" + rustbn.js "~0.2.0" + safe-buffer "^5.1.1" + util.promisify "^1.0.0" + +ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" + dependencies: + async "^2.1.2" + async-eventemitter "^0.2.2" + ethereumjs-account "^2.0.3" + ethereumjs-block "~2.2.0" + ethereumjs-common "^1.1.0" + ethereumjs-util "^6.0.0" + fake-merkle-patricia-tree "^1.0.1" + functional-red-black-tree "^1.0.1" + merkle-patricia-tree "^2.3.2" + rustbn.js "~0.2.0" + safe-buffer "^5.1.1" + +ethereumjs-wallet@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" + dependencies: + aes-js "^3.1.1" + bs58check "^2.1.2" + ethereum-cryptography "^0.1.3" + ethereumjs-util "^6.0.0" + randombytes "^2.0.6" + safe-buffer "^5.1.2" + scryptsy "^1.2.1" + utf8 "^3.0.0" + uuid "^3.3.2" + +ethers@^5.0.0, ethers@^5.0.1, ethers@^5.0.8: + version "5.0.24" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.24.tgz#fbb8e4d35070d134f2eb846c07500b8c0eaef6d3" + dependencies: + "@ethersproject/abi" "5.0.9" + "@ethersproject/abstract-provider" "5.0.7" + "@ethersproject/abstract-signer" "5.0.9" + "@ethersproject/address" "5.0.8" + "@ethersproject/base64" "5.0.6" + "@ethersproject/basex" "5.0.6" + "@ethersproject/bignumber" "5.0.12" + "@ethersproject/bytes" "5.0.8" + "@ethersproject/constants" "5.0.7" + "@ethersproject/contracts" "5.0.8" + "@ethersproject/hash" "5.0.9" + "@ethersproject/hdnode" "5.0.7" + "@ethersproject/json-wallets" "5.0.9" + "@ethersproject/keccak256" "5.0.6" + "@ethersproject/logger" "5.0.8" + "@ethersproject/networks" "5.0.6" + "@ethersproject/pbkdf2" "5.0.6" + "@ethersproject/properties" "5.0.6" + "@ethersproject/providers" "5.0.17" + "@ethersproject/random" "5.0.6" + "@ethersproject/rlp" "5.0.6" + "@ethersproject/sha2" "5.0.6" + "@ethersproject/signing-key" "5.0.7" + "@ethersproject/solidity" "5.0.7" + "@ethersproject/strings" "5.0.7" + "@ethersproject/transactions" "5.0.8" + "@ethersproject/units" "5.0.8" + "@ethersproject/wallet" "5.0.9" + "@ethersproject/web" "5.0.11" + "@ethersproject/wordlists" "5.0.7" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.3: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + +eventemitter3@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" + +events@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.3.2: + version "0.3.4" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-on-epipe@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" + integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417" + dependencies: + "@jest/types" "^26.6.2" + ansi-styles "^4.0.0" + jest-get-type "^26.3.0" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-regex-util "^26.0.0" + +express@^4.14.0: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + dependencies: + type "^2.0.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fake-merkle-patricia-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" + dependencies: + checkpoint-store "^1.1.0" + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fast-xml-parser@^3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz#cb637ec3f3999f51406dd8ff0e6fc4d83e520d01" + integrity sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg== + +fb-watchman@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" + dependencies: + bser "2.1.1" + +fetch-ponyfill@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" + dependencies: + node-fetch "~1.7.1" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + dependencies: + flat-cache "^2.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + dependencies: + to-regex-range "^5.0.1" + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + +find-package-json@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/find-package-json/-/find-package-json-1.2.0.tgz#4057d1b943f82d8445fe52dc9cf456f6b8b58083" + +find-replace@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" + dependencies: + array-back "^1.0.4" + test-value "^2.1.0" + +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-yarn-workspace-root@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" + dependencies: + fs-extra "^4.0.3" + micromatch "^3.1.4" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flat@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + dependencies: + is-buffer "~2.0.3" + +flatted@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + +flow-stoplight@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" + +follow-redirects@^1.12.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7" + +for-each@~0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + dependencies: + is-callable "^1.1.3" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^4.0.2, fs-extra@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^7.0.0, fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + dependencies: + minipass "^2.6.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" + +fsevents@~2.1.1, fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + +fsevents@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1, function-bind@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + +ganache-core@^2.10.2: + version "2.13.1" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.1.tgz#bf60399a2dd084e1090db91cbbc7ed3885dc01e4" + dependencies: + abstract-leveldown "3.0.0" + async "2.6.2" + bip39 "2.5.0" + cachedown "1.0.0" + clone "2.1.2" + debug "3.2.6" + encoding-down "5.0.4" + eth-sig-util "^2.0.0" + ethereumjs-abi "0.6.8" + ethereumjs-account "3.0.0" + ethereumjs-block "2.2.2" + ethereumjs-common "1.5.0" + ethereumjs-tx "2.1.2" + ethereumjs-util "6.2.1" + ethereumjs-vm "4.2.0" + heap "0.2.6" + keccak "3.0.1" + level-sublevel "6.6.4" + levelup "3.1.1" + lodash "4.17.20" + lru-cache "5.1.1" + merkle-patricia-tree "3.0.0" + patch-package "6.2.2" + seedrandom "3.0.1" + source-map-support "0.5.12" + tmp "0.1.0" + web3-provider-engine "14.2.1" + websocket "1.0.32" + optionalDependencies: + ethereumjs-wallet "0.6.5" + web3 "1.2.11" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-intrinsic@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49" + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +get-stream@^4.0.0, get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + dependencies: + is-glob "^4.0.1" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3, glob@~7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" + dependencies: + min-document "^2.19.0" + process "^0.11.10" + +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +got@9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +got@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + dependencies: + decompress-response "^3.2.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-plain-obj "^1.1.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + p-cancelable "^0.3.0" + p-timeout "^1.1.1" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + url-parse-lax "^1.0.0" + url-to-options "^1.0.1" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +hardhat-typechain@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/hardhat-typechain/-/hardhat-typechain-0.3.5.tgz#8e50616a9da348b33bd001168c8fda9c66b7b4af" + integrity sha512-w9lm8sxqTJACY+V7vijiH+NkPExnmtiQEjsV9JKD1KgMdVk2q8y+RhvU/c4B7+7b1+HylRUCxpOIvFuB3rE4+w== + +hardhat-watcher@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/hardhat-watcher/-/hardhat-watcher-2.1.1.tgz#8b05fec429ed45da11808bbf6054a90f3e34c51a" + integrity sha512-zilmvxAYD34IofBrwOliQn4z92UiDmt2c949DW4Gokf0vS0qk4YTfVCi/LmUBICThGygNANE3WfnRTpjCJGtDA== + dependencies: + chokidar "^3.4.3" + +hardhat@^2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.6.8.tgz#9ef6f8c16f9044acb95609d15a760b89177b8181" + integrity sha512-iRVd5DgcIVV3rNXMlogOfwlXAhHp7Wy/OjjFiUhTey8Unvo6oq5+Is5ANiKVN+Iw07Pcb/HpkGt7jCB6a4ITgg== + dependencies: + "@ethereumjs/block" "^3.4.0" + "@ethereumjs/blockchain" "^5.4.0" + "@ethereumjs/common" "^2.4.0" + "@ethereumjs/tx" "^3.3.0" + "@ethereumjs/vm" "^5.5.2" + "@ethersproject/abi" "^5.1.2" + "@sentry/node" "^5.18.1" + "@solidity-parser/parser" "^0.14.0" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + abort-controller "^3.0.0" + adm-zip "^0.4.16" + ansi-escapes "^4.3.0" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + eth-sig-util "^2.5.2" + ethereum-cryptography "^0.1.2" + ethereumjs-abi "^0.6.8" + ethereumjs-util "^7.1.0" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "^7.1.3" + https-proxy-agent "^5.0.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + lodash "^4.17.11" + merkle-patricia-tree "^4.2.0" + mnemonist "^0.38.0" + mocha "^7.1.2" + node-fetch "^2.6.0" + qs "^6.7.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + slash "^3.0.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + "true-case-path" "^2.2.1" + tsort "0.0.1" + uuid "^3.3.2" + ws "^7.4.6" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + +has-symbols@^1.0.0, has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.3, has@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + +heap@0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" + +hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: + version "2.8.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@1.7.3, http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-https@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24, iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +idna-uts46-hx@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" + dependencies: + punycode "2.1.0" + +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + +immediate@^3.2.3: + version "3.3.0" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" + +immediate@~3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + +immutable@^4.0.0-rc.12: + version "4.0.0-rc.12" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inquirer@^6.2.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + dependencies: + fp-ts "^1.0.0" + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-arguments@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" + dependencies: + call-bind "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-buffer@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + dependencies: + ci-info "^2.0.0" + +is-core-module@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + dependencies: + has "^1.0.3" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + +is-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + +is-function@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + +is-negative-zero@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + +is-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4, is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + dependencies: + has-symbols "^1.0.1" + +is-regex@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + dependencies: + has "^1.0.3" + +is-retry-allowed@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" + +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-svg@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-4.3.1.tgz#8c63ec8c67c8c7f0a8de0a71c8c7d58eccf4406b" + integrity sha512-h2CGs+yPUyvkgTJQS9cJzo9lYK06WgRiXUqBBHtglSzVKAuH4/oWsqk7LGfbSa1hGk9QcZ0SyQtVggvBA8LZXA== + dependencies: + fast-xml-parser "^3.19.0" + +is-symbol@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + dependencies: + has-symbols "^1.0.1" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-url@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + +jest-diff@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" + dependencies: + chalk "^4.0.0" + diff-sequences "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-get-type@^26.3.0: + version "26.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" + +jest-haste-map@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" + dependencies: + "@jest/types" "^26.6.2" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^26.0.0" + jest-serializer "^26.6.2" + jest-util "^26.6.2" + jest-worker "^26.6.2" + micromatch "^4.0.2" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.1.2" + +jest-matcher-utils@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz#8e6fd6e863c8b2d31ac6472eeb237bc595e53e7a" + dependencies: + chalk "^4.0.0" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + pretty-format "^26.6.2" + +jest-message-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.6.2.tgz#58173744ad6fc0506b5d21150b9be56ef001ca07" + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/types" "^26.6.2" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.2" + pretty-format "^26.6.2" + slash "^3.0.0" + stack-utils "^2.0.2" + +jest-pnp-resolver@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" + +jest-regex-util@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" + +jest-resolve@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.6.2.tgz#a3ab1517217f469b504f1b56603c5bb541fbb507" + dependencies: + "@jest/types" "^26.6.2" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-pnp-resolver "^1.2.2" + jest-util "^26.6.2" + read-pkg-up "^7.0.1" + resolve "^1.18.1" + slash "^3.0.0" + +jest-serializer@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.6.2.tgz#d139aafd46957d3a448f3a6cdabe2919ba0742d1" + dependencies: + "@types/node" "*" + graceful-fs "^4.2.4" + +jest-snapshot@^26.5.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.6.2.tgz#f3b0af1acb223316850bd14e1beea9837fb39c84" + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^26.6.2" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.0.0" + chalk "^4.0.0" + expect "^26.6.2" + graceful-fs "^4.2.4" + jest-diff "^26.6.2" + jest-get-type "^26.3.0" + jest-haste-map "^26.6.2" + jest-matcher-utils "^26.6.2" + jest-message-util "^26.6.2" + jest-resolve "^26.6.2" + natural-compare "^1.4.0" + pretty-format "^26.6.2" + semver "^7.3.2" + +jest-util@^26.5.2, jest-util@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1" + dependencies: + "@jest/types" "^26.6.2" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^2.0.0" + micromatch "^4.0.2" + +jest-worker@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +js-sha3@0.5.7, js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + +json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" + dependencies: + async "^2.0.1" + babel-preset-env "^1.7.0" + babelify "^7.3.0" + json-rpc-error "^2.0.0" + promise-to-callback "^1.0.0" + safe-event-emitter "^1.0.1" + +json-rpc-error@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" + dependencies: + inherits "^2.0.1" + +json-rpc-random-id@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +keccak@3.0.1, keccak@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + dependencies: + json-buffer "3.0.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + dependencies: + graceful-fs "^4.1.11" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +level-codec@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" + dependencies: + buffer "^5.6.0" + +level-codec@~7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" + +level-concat-iterator@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" + integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== + +level-errors@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" + dependencies: + errno "~0.1.1" + +level-errors@^2.0.0, level-errors@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" + dependencies: + errno "~0.1.1" + +level-errors@~1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" + dependencies: + errno "~0.1.1" + +level-iterator-stream@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.5" + xtend "^4.0.0" + +level-iterator-stream@~1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" + dependencies: + inherits "^2.0.1" + level-errors "^1.0.3" + readable-stream "^1.0.33" + xtend "^4.0.0" + +level-iterator-stream@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz#2c98a4f8820d87cdacab3132506815419077c730" + dependencies: + inherits "^2.0.1" + readable-stream "^2.3.6" + xtend "^4.0.0" + +level-iterator-stream@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" + integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== + dependencies: + inherits "^2.0.4" + readable-stream "^3.4.0" + xtend "^4.0.2" + +level-mem@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" + dependencies: + level-packager "~4.0.0" + memdown "~3.0.0" + +level-mem@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" + integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== + dependencies: + level-packager "^5.0.3" + memdown "^5.0.0" + +level-packager@^5.0.3: + version "5.1.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" + integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== + dependencies: + encoding-down "^6.3.0" + levelup "^4.3.2" + +level-packager@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" + dependencies: + encoding-down "~5.0.0" + levelup "^3.0.0" + +level-post@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/level-post/-/level-post-1.0.7.tgz#19ccca9441a7cc527879a0635000f06d5e8f27d0" + dependencies: + ltgt "^2.1.2" + +level-sublevel@6.6.4: + version "6.6.4" + resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-6.6.4.tgz#f7844ae893919cd9d69ae19d7159499afd5352ba" + dependencies: + bytewise "~1.1.0" + level-codec "^9.0.0" + level-errors "^2.0.0" + level-iterator-stream "^2.0.3" + ltgt "~2.1.1" + pull-defer "^0.2.2" + pull-level "^2.0.3" + pull-stream "^3.6.8" + typewiselite "~1.0.0" + xtend "~4.0.0" + +level-supports@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" + integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== + dependencies: + xtend "^4.0.2" + +level-ws@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" + dependencies: + readable-stream "~1.0.15" + xtend "~2.1.1" + +level-ws@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-1.0.0.tgz#19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.8" + xtend "^4.0.1" + +level-ws@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" + integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== + dependencies: + inherits "^2.0.3" + readable-stream "^3.1.0" + xtend "^4.0.1" + +levelup@3.1.1, levelup@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" + dependencies: + deferred-leveldown "~4.0.0" + level-errors "~2.0.0" + level-iterator-stream "~3.0.0" + xtend "~4.0.0" + +levelup@^1.2.1: + version "1.3.9" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" + dependencies: + deferred-leveldown "~1.2.1" + level-codec "~7.0.0" + level-errors "~1.0.3" + level-iterator-stream "~1.3.0" + prr "~1.0.1" + semver "~5.4.1" + xtend "~4.0.0" + +levelup@^4.3.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" + integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== + dependencies: + deferred-leveldown "~5.3.0" + level-errors "~2.0.0" + level-iterator-stream "~4.0.0" + level-supports "~1.0.0" + xtend "~4.0.0" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + dependencies: + p-locate "^4.1.0" + +lodash.assign@^4.0.3, lodash.assign@^4.0.6: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + +lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + +log-symbols@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + +log-symbols@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + dependencies: + chalk "^2.4.2" + +looper@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" + +looper@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-3.0.0.tgz#2efa54c3b1cbaba9b94aee2e5914b0be57fbb749" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + +lru-cache@5.1.1, lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + dependencies: + yallist "^3.0.2" + +lru-cache@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" + dependencies: + pseudomap "^1.0.1" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + +ltgt@^2.1.2, ltgt@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + +ltgt@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +mcl-wasm@^0.7.1: + version "0.7.6" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.6.tgz#c1789ebda5565d49b77d2ee195ff3e4d282f1554" + integrity sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +memdown@^1.0.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" + dependencies: + abstract-leveldown "~2.7.1" + functional-red-black-tree "^1.0.1" + immediate "^3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.1.1" + +memdown@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" + integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== + dependencies: + abstract-leveldown "~6.2.1" + functional-red-black-tree "~1.0.1" + immediate "~3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.2.0" + +memdown@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" + dependencies: + abstract-leveldown "~5.0.0" + functional-red-black-tree "~1.0.1" + immediate "~3.2.3" + inherits "~2.0.1" + ltgt "~2.2.0" + safe-buffer "~5.1.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + +merkle-patricia-tree@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" + dependencies: + async "^2.6.1" + ethereumjs-util "^5.2.0" + level-mem "^3.0.1" + level-ws "^1.0.0" + readable-stream "^3.0.6" + rlp "^2.0.0" + semaphore ">=1.0.1" + +merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" + dependencies: + async "^1.4.2" + ethereumjs-util "^5.0.0" + level-ws "0.0.0" + levelup "^1.2.1" + memdown "^1.0.0" + readable-stream "^2.0.0" + rlp "^2.0.0" + semaphore ">=1.0.1" + +merkle-patricia-tree@^4.2.0, merkle-patricia-tree@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.2.tgz#6dec17855370172458244c2f42c989dd60b773a3" + integrity sha512-eqZYNTshcYx9aESkSPr71EqwsR/QmpnObDEV4iLxkt/x/IoLYZYjJvKY72voP/27Vy61iMOrfOG6jrn7ttXD+Q== + dependencies: + "@types/levelup" "^4.3.0" + ethereumjs-util "^7.1.2" + level-mem "^5.0.1" + level-ws "^2.0.0" + readable-stream "^3.6.0" + rlp "^2.2.4" + semaphore-async-await "^1.5.1" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + +mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + dependencies: + mime-db "1.44.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + dependencies: + dom-walk "^0.1.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + +minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + dependencies: + minipass "^2.9.0" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp-promise@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + dependencies: + mkdirp "*" + +mkdirp@*: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + +mkdirp@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" + dependencies: + minimist "^1.2.5" + +mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + dependencies: + minimist "^1.2.5" + +mnemonist@^0.38.0: + version "0.38.3" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.3.tgz#35ec79c1c1f4357cfda2fe264659c2775ccd7d9d" + integrity sha512-2K9QYubXx/NAjv4VLq1d1Ly8pWNC5L3BrixtdkyTegXWJIqY+zLNDhhX/A+ZwWt70tB1S8H4BE8FLYEFyNoOBw== + dependencies: + obliterator "^1.6.1" + +mocha-chai-jest-snapshot@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/mocha-chai-jest-snapshot/-/mocha-chai-jest-snapshot-1.1.1.tgz#7e49f20d0c12e6792d7f7da2e4ee0c38950571cc" + dependencies: + "@jest/test-result" "^26.5.2" + chalk "^4.1.0" + find-package-json "^1.2.0" + jest-snapshot "^26.5.2" + jest-util "^26.5.2" + slash "^3.0.0" + yargs "^16.0.3" + +mocha@^6.2.2: + version "6.2.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "2.2.0" + minimatch "3.0.4" + mkdirp "0.5.4" + ms "2.1.1" + node-environment-flags "1.0.5" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mocha@^7.1.2: + version "7.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "3.0.0" + minimatch "3.0.4" + mkdirp "0.5.5" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mock-fs@^4.1.0: + version "4.13.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.13.0.tgz#31c02263673ec3789f90eb7b6963676aa407a598" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + +multibase@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multibase@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multicodec@^0.5.5: + version "0.5.7" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" + dependencies: + varint "^5.0.0" + +multicodec@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" + dependencies: + buffer "^5.6.0" + varint "^5.0.0" + +multihashes@^0.4.15, multihashes@~0.4.15: + version "0.4.21" + resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" + dependencies: + buffer "^5.5.0" + multibase "^0.7.0" + varint "^5.0.0" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + +nano-json-stream-parser@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + +next-tick@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + +node-environment-flags@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-environment-flags@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-fetch@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" + +node-fetch@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + +node-fetch@~1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-gyp-build@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +nofilter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" + integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== + +normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + +object-assign@^4, object-assign@^4.0.0, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.8.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" + +object-inspect@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + +object-is@^1.0.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.4.tgz#63d6c83c00a43f4cbc9434eb9757c8a5b8565068" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.assign@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.assign@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz#0dfda8d108074d9c563e80490c883b6661091544" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +obliterator@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-1.6.1.tgz#dea03e8ab821f6c4d96a299e17aef6a3af994ef3" + integrity sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig== + +oboe@2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" + dependencies: + http-https "^1.0.0" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0, p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + dependencies: + p-limit "^2.2.0" + +p-timeout@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + dependencies: + p-finally "^1.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + dependencies: + callsites "^3.0.0" + +parse-asn1@^5.0.0, parse-asn1@^5.1.5: + version "5.1.6" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" + dependencies: + asn1.js "^5.2.0" + browserify-aes "^1.0.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-headers@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-json@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +patch-package@6.2.2, patch-package@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.2.tgz#71d170d650c65c26556f0d0fbbb48d92b6cc5f39" + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^2.4.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^1.2.1" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.0" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + +path-browserify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: + version "3.1.1" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + +precond@0.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-solidity@^1.0.0-beta.10: + version "1.0.0-beta.10" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.10.tgz#f2a249002733826b08d981b599335ddb7e93af8d" + integrity sha512-55UsEbeJfqYKB3RFR7Nvpi+ApEoUfgdKHVg2ZybrbOkRW4RTblyONLL3mEr8Vrxpo7wBbObVLbWodGg4YXIQ7g== + dependencies: + "@solidity-parser/parser" "^0.12.1" + dir-to-object "^2.0.0" + emoji-regex "^9.2.2" + escape-string-regexp "^4.0.0" + prettier "^2.2.1" + semver "^7.3.5" + solidity-comments-extractor "^0.0.7" + string-width "^4.2.2" + +prettier@^1.14.3: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + +prettier@^2.0.5, prettier@^2.1.2, prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + +pretty-format@^26.6.2: + version "26.6.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" + dependencies: + "@jest/types" "^26.6.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^17.0.1" + +printj@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" + integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + +promise-to-callback@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" + dependencies: + is-fn "^1.0.0" + set-immediate-shim "^1.0.1" + +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pull-cat@^1.1.9: + version "1.1.11" + resolved "https://registry.yarnpkg.com/pull-cat/-/pull-cat-1.1.11.tgz#b642dd1255da376a706b6db4fa962f5fdb74c31b" + +pull-defer@^0.2.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/pull-defer/-/pull-defer-0.2.3.tgz#4ee09c6d9e227bede9938db80391c3dac489d113" + +pull-level@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pull-level/-/pull-level-2.0.4.tgz#4822e61757c10bdcc7cf4a03af04c92734c9afac" + dependencies: + level-post "^1.0.7" + pull-cat "^1.1.9" + pull-live "^1.0.1" + pull-pushable "^2.0.0" + pull-stream "^3.4.0" + pull-window "^2.1.4" + stream-to-pull-stream "^1.7.1" + +pull-live@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pull-live/-/pull-live-1.0.1.tgz#a4ecee01e330155e9124bbbcf4761f21b38f51f5" + dependencies: + pull-cat "^1.1.9" + pull-stream "^3.4.0" + +pull-pushable@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" + +pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.6.8: + version "3.6.14" + resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.14.tgz#529dbd5b86131f4a5ed636fdf7f6af00781357ee" + +pull-window@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/pull-window/-/pull-window-2.1.4.tgz#fc3b86feebd1920c7ae297691e23f705f88552f0" + dependencies: + looper "^2.0.0" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + +qs@^6.7.0: + version "6.9.4" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687" + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + +raw-body@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" + dependencies: + bytes "3.1.0" + http-errors "1.7.3" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-is@^17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + +readable-stream@^1.0.33: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6, readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~1.0.15: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdirp@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" + dependencies: + picomatch "^2.0.4" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + dependencies: + picomatch "^2.2.1" + +regenerate@^1.2.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp.prototype.flags@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@^2.79.0, request@^2.85.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.17.0, resolve@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + dependencies: + path-parse "^1.0.6" + +resolve@^1.10.0, resolve@^1.18.1, resolve@^1.8.1: + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + dependencies: + is-core-module "^2.1.0" + path-parse "^1.0.6" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + dependencies: + glob "^7.1.3" + +rimraf@^2.2.8, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: + version "2.2.6" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" + dependencies: + bn.js "^4.11.1" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + +run-async@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + +rustbn.js@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + +rxjs@^6.4.0: + version "6.6.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" + dependencies: + tslib "^1.9.0" + +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + +safe-event-emitter@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" + dependencies: + events "^3.0.0" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + +scryptsy@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" + dependencies: + pbkdf2 "^3.0.3" + +secp256k1@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" + dependencies: + elliptic "^6.5.2" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +seedrandom@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" + +semaphore-async-await@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" + integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= + +semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + +semver@^7.3.2: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + dependencies: + lru-cache "^6.0.0" + +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +semver@~5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + +servify@^0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" + dependencies: + body-parser "^1.16.0" + cors "^2.8.1" + express "^4.14.0" + request "^2.79.0" + xhr "^2.3.3" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + +simple-get@^2.7.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" + dependencies: + decompress-response "^3.3.0" + once "^1.3.1" + simple-concat "^1.0.0" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solc@^0.4.20: + version "0.4.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.26.tgz#5390a62a99f40806b86258c737c1cf653cc35cb5" + dependencies: + fs-extra "^0.30.0" + memorystream "^0.3.1" + require-from-string "^1.1.0" + semver "^5.3.0" + yargs "^4.7.1" + +solc@^0.6.3: + version "0.6.12" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solhint-plugin-prettier@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" + dependencies: + prettier-linter-helpers "^1.0.0" + +solhint@^3.2.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.3.2.tgz#ebd7270bb50fd378b427d7a6fc9f2a7fd00216c0" + dependencies: + "@solidity-parser/parser" "^0.8.2" + ajv "^6.6.1" + antlr4 "4.7.1" + ast-parents "0.0.1" + chalk "^2.4.2" + commander "2.18.0" + cosmiconfig "^5.0.7" + eslint "^5.6.0" + fast-diff "^1.1.2" + glob "^7.1.3" + ignore "^4.0.6" + js-yaml "^3.12.0" + lodash "^4.17.11" + semver "^6.3.0" + optionalDependencies: + prettier "^1.14.3" + +solidity-comments-extractor@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" + integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@0.5.12: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.13, source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.7" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz#e9c18a410e5ed7e12442a549fbd8afa767038d65" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" + dependencies: + escape-string-regexp "^2.0.0" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + dependencies: + type-fest "^0.7.1" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + +stream-to-pull-stream@^1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz#4161aa2d2eb9964de60bfa1af7feaf917e874ece" + dependencies: + looper "^3.0.0" + pull-stream "^3.2.3" + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string-width@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" + integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.trim@~1.2.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.3.tgz#d23a22fde01c1e6571a7fadcb9be11decd8061a7" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + +string.prototype.trimend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz#9b4cb590e123bb36564401d59824298de50fd5aa" + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + dependencies: + ansi-regex "^5.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@2.0.1, strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + dependencies: + has-flag "^3.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + dependencies: + has-flag "^3.0.0" + +supports-color@^7.0.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + dependencies: + has-flag "^4.0.0" + +swarm-js@^0.1.40: + version "0.1.40" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" + dependencies: + bluebird "^3.5.0" + buffer "^5.0.5" + eth-lib "^0.1.26" + fs-extra "^4.0.2" + got "^7.1.0" + mime-types "^2.1.16" + mkdirp-promise "^5.0.1" + mock-fs "^4.1.0" + setimmediate "^1.0.5" + tar "^4.0.2" + xhr-request "^1.0.1" + +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +tape@^4.6.3: + version "4.13.3" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.3.tgz#51b3d91c83668c7a45b1a594b607dee0a0b46278" + dependencies: + deep-equal "~1.1.1" + defined "~1.0.0" + dotignore "~0.1.2" + for-each "~0.3.3" + function-bind "~1.1.1" + glob "~7.1.6" + has "~1.0.3" + inherits "~2.0.4" + is-regex "~1.0.5" + minimist "~1.2.5" + object-inspect "~1.7.0" + resolve "~1.17.0" + resumer "~0.0.0" + string.prototype.trim "~1.2.1" + through "~2.3.8" + +tar@^4.0.2: + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.8.6" + minizlib "^1.2.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.3" + +test-value@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" + dependencies: + array-back "^1.0.3" + typical "^2.6.0" + +testrpc@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through2@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through@^2.3.6, through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +timed-out@^4.0.0, timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + +tmp@0.0.33, tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + +tmp@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" + dependencies: + rimraf "^2.6.3" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +"true-case-path@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" + +ts-essentials@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" + +ts-essentials@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.1.tgz#d205508cae0cdadfb73c89503140cf2228389e2d" + +ts-generator@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" + dependencies: + "@types/mkdirp" "^0.5.2" + "@types/prettier" "^2.1.1" + "@types/resolve" "^0.0.8" + chalk "^2.4.1" + glob "^7.1.2" + mkdirp "^0.5.1" + prettier "^2.1.2" + resolve "^1.8.1" + ts-essentials "^1.0.0" + +ts-node@^8.5.4: + version "8.10.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +tslib@^1.9.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl-util@^0.15.0: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +tweetnacl@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + +type-fest@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + +type@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.1.0.tgz#9bdc22c648cf8cf86dd23d32336a41cfb6475e3f" + +typechain@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-4.0.1.tgz#b40eaf5ede15588d97a4b9a5f85120f7ea1cf262" + dependencies: + command-line-args "^4.0.7" + debug "^4.1.1" + fs-extra "^7.0.0" + js-sha3 "^0.8.0" + lodash "^4.17.15" + ts-essentials "^7.0.1" + ts-generator "^0.1.1" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + dependencies: + is-typedarray "^1.0.0" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript@^3.7.3: + version "3.9.7" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" + +typewise-core@^1.2, typewise-core@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" + +typewise@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typewise/-/typewise-1.0.3.tgz#1067936540af97937cc5dcf9922486e9fa284651" + dependencies: + typewise-core "^1.2.0" + +typewiselite@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typewiselite/-/typewiselite-1.0.0.tgz#c8882fa1bb1092c06005a97f34ef5c8508e3664e" + +typical@^2.6.0, typical@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + +underscore@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + +unorm@^1.3.3: + version "1.6.0" + resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + dependencies: + prepend-http "^2.0.0" + +url-set-query@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + +utf-8-validate@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.3.tgz#3b64e418ad2ff829809025fdfef595eab2f03a27" + dependencies: + node-gyp-build "^4.2.0" + +utf8@3.0.0, utf8@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util.promisify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.2" + has-symbols "^1.0.1" + object.getownpropertydescriptors "^2.1.0" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + +uuid@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +varint@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" + +vary@^1, vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +web3-bzz@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" + dependencies: + "@types/node" "^12.12.6" + got "9.6.0" + swarm-js "^0.1.40" + underscore "1.9.1" + +web3-core-helpers@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" + dependencies: + underscore "1.9.1" + web3-eth-iban "1.2.11" + web3-utils "1.2.11" + +web3-core-method@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" + dependencies: + "@ethersproject/transactions" "^5.0.0-beta.135" + underscore "1.9.1" + web3-core-helpers "1.2.11" + web3-core-promievent "1.2.11" + web3-core-subscriptions "1.2.11" + web3-utils "1.2.11" + +web3-core-promievent@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" + dependencies: + eventemitter3 "4.0.4" + +web3-core-requestmanager@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.11" + web3-providers-http "1.2.11" + web3-providers-ipc "1.2.11" + web3-providers-ws "1.2.11" + +web3-core-subscriptions@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-core@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" + dependencies: + "@types/bn.js" "^4.11.5" + "@types/node" "^12.12.6" + bignumber.js "^9.0.0" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-requestmanager "1.2.11" + web3-utils "1.2.11" + +web3-eth-abi@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" + dependencies: + "@ethersproject/abi" "5.0.0-beta.153" + underscore "1.9.1" + web3-utils "1.2.11" + +web3-eth-accounts@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" + dependencies: + crypto-browserify "3.12.0" + eth-lib "0.2.8" + ethereumjs-common "^1.3.2" + ethereumjs-tx "^2.1.1" + scrypt-js "^3.0.1" + underscore "1.9.1" + uuid "3.3.2" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-utils "1.2.11" + +web3-eth-contract@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" + dependencies: + "@types/bn.js" "^4.11.5" + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-promievent "1.2.11" + web3-core-subscriptions "1.2.11" + web3-eth-abi "1.2.11" + web3-utils "1.2.11" + +web3-eth-ens@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" + dependencies: + content-hash "^2.5.2" + eth-ens-namehash "2.0.8" + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-promievent "1.2.11" + web3-eth-abi "1.2.11" + web3-eth-contract "1.2.11" + web3-utils "1.2.11" + +web3-eth-iban@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" + dependencies: + bn.js "^4.11.9" + web3-utils "1.2.11" + +web3-eth-personal@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" + dependencies: + "@types/node" "^12.12.6" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-net "1.2.11" + web3-utils "1.2.11" + +web3-eth@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" + dependencies: + underscore "1.9.1" + web3-core "1.2.11" + web3-core-helpers "1.2.11" + web3-core-method "1.2.11" + web3-core-subscriptions "1.2.11" + web3-eth-abi "1.2.11" + web3-eth-accounts "1.2.11" + web3-eth-contract "1.2.11" + web3-eth-ens "1.2.11" + web3-eth-iban "1.2.11" + web3-eth-personal "1.2.11" + web3-net "1.2.11" + web3-utils "1.2.11" + +web3-net@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-utils "1.2.11" + +web3-provider-engine@14.2.1: + version "14.2.1" + resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" + dependencies: + async "^2.5.0" + backoff "^2.5.0" + clone "^2.0.0" + cross-fetch "^2.1.0" + eth-block-tracker "^3.0.0" + eth-json-rpc-infura "^3.1.0" + eth-sig-util "^1.4.2" + ethereumjs-block "^1.2.2" + ethereumjs-tx "^1.2.0" + ethereumjs-util "^5.1.5" + ethereumjs-vm "^2.3.4" + json-rpc-error "^2.0.0" + json-stable-stringify "^1.0.1" + promise-to-callback "^1.0.0" + readable-stream "^2.2.9" + request "^2.85.0" + semaphore "^1.0.3" + ws "^5.1.1" + xhr "^2.2.0" + xtend "^4.0.1" + +web3-providers-http@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" + dependencies: + web3-core-helpers "1.2.11" + xhr2-cookies "1.1.0" + +web3-providers-ipc@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" + dependencies: + oboe "2.1.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-providers-ws@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + websocket "^1.0.31" + +web3-shh@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-core-subscriptions "1.2.11" + web3-net "1.2.11" + +web3-utils@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" + dependencies: + bn.js "^4.11.9" + eth-lib "0.2.8" + ethereum-bloom-filters "^1.0.6" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + underscore "1.9.1" + utf8 "3.0.0" + +web3-utils@^1.0.0-beta.31: + version "1.3.1" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.1.tgz#9aa880dd8c9463fe5c099107889f86a085370c2e" + dependencies: + bn.js "^4.11.9" + eth-lib "0.2.8" + ethereum-bloom-filters "^1.0.6" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + underscore "1.9.1" + utf8 "3.0.0" + +web3@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" + dependencies: + web3-bzz "1.2.11" + web3-core "1.2.11" + web3-eth "1.2.11" + web3-eth-personal "1.2.11" + web3-net "1.2.11" + web3-shh "1.2.11" + web3-utils "1.2.11" + +websocket@1.0.32: + version "1.0.32" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" + dependencies: + bufferutil "^4.0.1" + debug "^2.2.0" + es5-ext "^0.10.50" + typedarray-to-buffer "^3.1.5" + utf-8-validate "^5.0.2" + yaeti "^0.0.6" + +websocket@^1.0.31: + version "1.0.33" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" + dependencies: + bufferutil "^4.0.1" + debug "^2.2.0" + es5-ext "^0.10.50" + typedarray-to-buffer "^3.1.5" + utf-8-validate "^5.0.2" + yaeti "^0.0.6" + +whatwg-fetch@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@1.3.1, which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + dependencies: + mkdirp "^0.5.1" + +ws@7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" + +ws@^3.0.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +ws@^5.1.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + dependencies: + async-limiter "~1.0.0" + +ws@^7.4.6: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + +xhr-request-promise@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" + dependencies: + xhr-request "^1.1.0" + +xhr-request@^1.0.1, xhr-request@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" + dependencies: + buffer-to-arraybuffer "^0.0.5" + object-assign "^4.1.1" + query-string "^5.0.1" + simple-get "^2.7.0" + timed-out "^4.0.1" + url-set-query "^1.0.0" + xhr "^2.0.4" + +xhr2-cookies@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" + dependencies: + cookiejar "^2.1.1" + +xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: + version "2.6.0" + resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" + dependencies: + global "~4.4.0" + is-function "^1.0.1" + parse-headers "^2.0.0" + xtend "^4.0.0" + +xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + dependencies: + object-keys "~0.4.0" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +y18n@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + +yaeti@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" + +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.0.6" + +yargs-parser@^20.2.2: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + +yargs-unparser@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" + dependencies: + flat "^4.1.0" + lodash "^4.17.15" + yargs "^13.3.0" + +yargs@13.3.2, yargs@^13.3.0: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@^16.0.3: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^4.7.1: + version "4.8.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + lodash.assign "^4.0.3" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.1" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^2.4.1" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"